1 |
commit: b1f0646fa63d741dec211cbf468739eacdaea538 |
2 |
Author: Vadim A. Misbakh-Soloviov <git <AT> mva <DOT> name> |
3 |
AuthorDate: Fri Aug 5 21:49:08 2016 +0000 |
4 |
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name> |
5 |
CommitDate: Fri Aug 5 21:49:08 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=b1f0646f |
7 |
|
8 |
xonotic-maps: fix bug reported by email. TODO: ask Nikoli to KILL IT WITH FIRE and rewrite |
9 |
|
10 |
games-fps/xonotic-maps/metadata.xml | 2 +- |
11 |
games-fps/xonotic-maps/xonotic-maps-9999.ebuild | 55 +++++++++---------------- |
12 |
2 files changed, 21 insertions(+), 36 deletions(-) |
13 |
|
14 |
diff --git a/games-fps/xonotic-maps/metadata.xml b/games-fps/xonotic-maps/metadata.xml |
15 |
index 0945c61..f3eb681 100644 |
16 |
--- a/games-fps/xonotic-maps/metadata.xml |
17 |
+++ b/games-fps/xonotic-maps/metadata.xml |
18 |
@@ -1,7 +1,7 @@ |
19 |
<?xml version="1.0" encoding="UTF-8"?> |
20 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
21 |
<pkgmetadata> |
22 |
- <maintainer> |
23 |
+ <maintainer type="person"> |
24 |
<email>nikoli@×××××××.com</email> |
25 |
<name>Nikoli</name> |
26 |
</maintainer> |
27 |
|
28 |
diff --git a/games-fps/xonotic-maps/xonotic-maps-9999.ebuild b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild |
29 |
index 1d7d151..460d48d 100644 |
30 |
--- a/games-fps/xonotic-maps/xonotic-maps-9999.ebuild |
31 |
+++ b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild |
32 |
@@ -1,10 +1,12 @@ |
33 |
-# Copyright 1999-2013 Gentoo Foundation |
34 |
+# Copyright 1999-2016 Gentoo Foundation |
35 |
# Distributed under the terms of the GNU General Public License v2 |
36 |
-# $Header: $ |
37 |
|
38 |
-EAPI=5 |
39 |
+# QA: FUCKING CRAP!!! |
40 |
+# TODO: ask Nikoli to rewrite if I ever find him |
41 |
|
42 |
-inherit games check-reqs |
43 |
+EAPI=6 |
44 |
+ |
45 |
+inherit check-reqs |
46 |
|
47 |
MY_PN="${PN%-maps}" |
48 |
DESCRIPTION="Xonotic maps" |
49 |
@@ -13,6 +15,7 @@ HOMEPAGE="http://www.xonotic.org/" |
50 |
LICENSE="GPL-2" |
51 |
SLOT="0" |
52 |
IUSE="unofficial" |
53 |
+KEYWORDS="" |
54 |
|
55 |
RDEPEND="" |
56 |
DEPEND=" |
57 |
@@ -22,19 +25,18 @@ DEPEND=" |
58 |
S="${WORKDIR}" |
59 |
RESTRICT="test" |
60 |
|
61 |
-if use unofficial; then |
62 |
- CHECKREQS_DISK_USR="1G" |
63 |
-else |
64 |
- CHECKREQS_DISK_USR="155M" |
65 |
-fi |
66 |
- |
67 |
pkg_pretend() { |
68 |
+ if use unofficial; then |
69 |
+ CHECKREQS_DISK_USR="1G" |
70 |
+ else |
71 |
+ CHECKREQS_DISK_USR="155M" |
72 |
+ fi |
73 |
+ |
74 |
check-reqs_pkg_pretend |
75 |
} |
76 |
|
77 |
pkg_setup() { |
78 |
check-reqs_pkg_setup |
79 |
- games_pkg_setup |
80 |
|
81 |
ewarn "Downloaded pk3 files will be stored in \"xonotic-maps\" subdirectory of your DISTDIR" |
82 |
echo |
83 |
@@ -61,6 +63,7 @@ src_unpack() { |
84 |
|
85 |
# FETCHCOMMAND from make.globals is example |
86 |
local WGET="/usr/bin/wget -t 3 -T 60" |
87 |
+ local SED="sed" |
88 |
local base_url="http://beta.xonotic.org/autobuild-bsp/" |
89 |
|
90 |
einfo "Downloading lists" |
91 |
@@ -70,32 +73,22 @@ src_unpack() { |
92 |
$WGET -O official_maps.html \ |
93 |
'http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=tree;f=maps' || die |
94 |
|
95 |
- grep -e '\.map</a>' official_maps.html |\ |
96 |
- sed -e 's,.*">\([^<]*\).map<\/a>.*,\1,' > official_maps.txt || die |
97 |
+ grep -e '\.map</a>' official_maps.html | ${SED} -e 's,.*">\([^<]*\).map<\/a>.*,\1,' > official_maps.txt || die |
98 |
[ -s official_maps.txt ] || die "List of official maps is empty" |
99 |
cp official_maps.txt install_maps.txt || die |
100 |
|
101 |
if use unofficial; then |
102 |
# For maps not in master branch we need to download fullpk3 |
103 |
# AllMaps - OfficialMaps = UnofficialMaps |
104 |
- grep all_maps.html \ |
105 |
- -e '<td class="mapname">' |\ |
106 |
- sed -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\ |
107 |
- sort -u |\ |
108 |
- grep -v -x -e '' \ |
109 |
- -f official_maps.txt |\ |
110 |
- sed -e 's,$,-full,' > unofficial_maps.txt |
111 |
+ grep all_maps.html -e '<td class="mapname">' | ${SED} -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\ |
112 |
+ sort -u | grep -v -x -e '' -f official_maps.txt | ${SED} -e 's,$,-full,' > unofficial_maps.txt |
113 |
[ -s unofficial_maps.txt ] || die "List of unofficial maps is empty" |
114 |
cat unofficial_maps.txt >> install_maps.txt |
115 |
fi |
116 |
|
117 |
latest_pk3_version() { |
118 |
# latest builds of maps are above |
119 |
- latest_version="$( |
120 |
- grep all_maps.html -m1 \ |
121 |
- -e "href=\"${name%-full}-.*.pk3\">bspk3<" |\ |
122 |
- sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1," |
123 |
- )" |
124 |
+ latest_version="$(grep all_maps.html -m1 -e "href=\"${name%-full}-.*.pk3\">bspk3<" |sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1,")" |
125 |
} |
126 |
|
127 |
validate_pk3() { |
128 |
@@ -111,14 +104,8 @@ src_unpack() { |
129 |
# If map becomes official, it changes branch and git hashes in name => no need to check both fullpk3 and bsppk3 |
130 |
einfo "Cleaning \"${MAPS_STORE_DIR}\"" |
131 |
for file in "${MAPS_STORE_DIR}"/*; do |
132 |
- local name="$( |
133 |
- echo "${file}" |\ |
134 |
- sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-[0-9a-f]\{40\}-[0-9a-f]\{40\}.pk3$,\1," |
135 |
- )" |
136 |
- local version="$( |
137 |
- echo "${file}" |\ |
138 |
- sed -e "s,${MAPS_STORE_DIR}/${name}-\([0-9a-f]\{40\}-[0-9a-f]\{40\}\).pk3$,\1," |
139 |
- )" |
140 |
+ local name="$(echo "${file}" |sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-[0-9a-f]\{40\}-[0-9a-f]\{40\}.pk3$,\1,")" |
141 |
+ local version="$(echo "${file}"|sed -e "s,${MAPS_STORE_DIR}/${name}-\([0-9a-f]\{40\}-[0-9a-f]\{40\}\).pk3$,\1,")" |
142 |
latest_pk3_version |
143 |
|
144 |
if [ "${version}" != "${latest_version}" ]; then |
145 |
@@ -161,6 +148,4 @@ src_install() { |
146 |
while read file; do |
147 |
nonfatal doins "${MAPS_STORE_DIR}/${file}" || ewarn "installing \"${file}\" failed" |
148 |
done < install_files.txt |
149 |
- |
150 |
- prepgamesdirs |
151 |
} |