public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gamerlay:master commit in: games-fps/xonotic-maps/
@ 2013-07-19 16:43 Nikoli
  0 siblings, 0 replies; 2+ messages in thread
From: Nikoli @ 2013-07-19 16:43 UTC (permalink / raw
  To: gentoo-commits

commit:     46b68003df21ca8e7700d76f9c7d08fd85895d68
Author:     Nikoli <nikoli <AT> lavabit <DOT> com>
AuthorDate: Fri Jul 19 16:14:26 2013 +0000
Commit:     Nikoli <nikoli <AT> lavabit <DOT> com>
CommitDate: Fri Jul 19 16:14:26 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gamerlay.git;a=commit;h=46b68003

xonotic-maps: eapi5, update ebuild

Package-Manager: portage-2.1.12.2

---
 games-fps/xonotic-maps/xonotic-maps-9999.ebuild | 169 ++++++++++++------------
 1 file changed, 87 insertions(+), 82 deletions(-)

diff --git a/games-fps/xonotic-maps/xonotic-maps-9999.ebuild b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild
index 4cf4ad2..1d7d151 100644
--- a/games-fps/xonotic-maps/xonotic-maps-9999.ebuild
+++ b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
-EAPI=2
+EAPI=5
 
 inherit games check-reqs
 
@@ -12,17 +12,28 @@ HOMEPAGE="http://www.xonotic.org/"
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS=""
 IUSE="unofficial"
 
-RDEPEND="~games-fps/xonotic-data-9999"
+RDEPEND=""
 DEPEND="
 	app-arch/unzip
 	net-misc/wget
 "
 S="${WORKDIR}"
+RESTRICT="test"
+
+if use unofficial; then
+	CHECKREQS_DISK_USR="1G"
+else
+	CHECKREQS_DISK_USR="155M"
+fi
+
+pkg_pretend() {
+	check-reqs_pkg_pretend
+}
 
 pkg_setup() {
+	check-reqs_pkg_setup
 	games_pkg_setup
 
 	ewarn "Downloaded pk3 files will be stored in \"xonotic-maps\" subdirectory of your DISTDIR"
@@ -32,9 +43,6 @@ pkg_setup() {
 		ewarn "You have enabled \"unofficial\" USE flag. Incomplete, unstable or broken maps may be installed."
 		echo
 	fi
-
-	CHECKREQS_DISK_USR="350" \
-	check_reqs
 }
 
 src_unpack() {
@@ -55,107 +63,104 @@ src_unpack() {
 	local WGET="/usr/bin/wget -t 3 -T 60"
 	local base_url="http://beta.xonotic.org/autobuild-bsp/"
 
-	$WGET -O \
-		autobuild-bsp.list \
+	einfo "Downloading lists"
+	$WGET -O all_maps.html \
 		"${base_url}" || die
 
-	local OfficialMaps="$(
-		$WGET -O- \
-		'http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=tree;f=maps' |\
-		grep -e '\.map</a>' |\
-		sed -e 's,.*">\([^<]*\).map<\/a>.*,\1,'
-	)"
-	if [ "x${OfficialMaps}" = "x" ]; then
-		die "List of official maps is empty"
-	fi
-	local Maps="${OfficialMaps}"
+	$WGET -O official_maps.html \
+		'http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=tree;f=maps' || die
+
+	grep -e '\.map</a>' official_maps.html |\
+		sed -e 's,.*">\([^<]*\).map<\/a>.*,\1,' > official_maps.txt || die
+	[ -s official_maps.txt ] || die "List of official maps is empty"
+	cp official_maps.txt install_maps.txt || die
 
 	if use unofficial; then
-	# For maps not in master branch we need to download fullpk3,
-	# but some old unofficial maps have only bspk3, exclude them.
+	# For maps not in master branch we need to download fullpk3
 		# AllMaps - OfficialMaps = UnofficialMaps
-		echo "${OfficialMaps}" |\
-		sed -e 's,\(.*\),^\1$,' \
-			> OfficialMaps.grep || die
-		local UnofficialMaps="$(
-			grep autobuild-bsp.list \
-				-e '<td class="mapname">' |\
-			sed -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\
-			sort -u |\
-			grep -v -e '^$' \
-				-e '^arahia$' \
-				-e '^darkzone$' \
-				-e '^facility_114$' \
-				-e '^valentine114$' \
-				-f OfficialMaps.grep |\
-			sed -e 's,$,-full,'
-		)"
-		if [ "x${UnofficialMaps}" = "x" ]; then
-			die "List of unofficial maps is empty"
-		fi
-		Maps+=" ${UnofficialMaps}"
+		grep all_maps.html \
+			-e '<td class="mapname">' |\
+		sed -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\
+		sort -u |\
+		grep -v -x -e '' \
+			-f official_maps.txt |\
+		sed -e 's,$,-full,' > unofficial_maps.txt
+		[ -s unofficial_maps.txt ] || die "List of unofficial maps is empty"
+		cat unofficial_maps.txt >> install_maps.txt
 	fi
 
-	MapFiles=""
-	for i in ${Maps}; do
-		local version="$(
-			grep autobuild-bsp.list -m1 \
-				-e "href=\"${i%-full}-.*.pk3\">bspk3<" |\
-			sed -e "s,.*href=\"${i%-full}-\([^\"]*\).pk3\">bspk3<.*,\1,"
+	latest_pk3_version() {
+		# latest builds of maps are above
+		latest_version="$(
+			grep all_maps.html -m1 \
+				-e "href=\"${name%-full}-.*.pk3\">bspk3<" |\
+			sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1,"
 		)"
-		local name="${i}-${version}.pk3"
-		MapFiles+=" ${name}"
-		local path="${MAPS_STORE_DIR}/${name}"
-		local url="${base_url}${name}"
+	}
 
-		if [[ ! -f "${path}" ]]; then
-			rm -f "${path}" 2> /dev/null
-			einfo "Downloading ${name}"
-			$WGET "${url}" -O "${path}" || ewarn "downloading ${url} failed"
+	validate_pk3() {
+		if unzip -t "${1}" > /dev/null; then
+			true
+		else
+			ewarn "\"${1}\" is not valid pk3 file, removing"
+			rm -f "${1}" || die
 		fi
-	done
+	}
 
 	# Remove obsolete and broken files from MAPS_STORE_DIR
 	# If map becomes official, it changes branch and git hashes in name => no need to check both fullpk3 and bsppk3
-	for i in "${MAPS_STORE_DIR}"/*; do
+	einfo "Cleaning \"${MAPS_STORE_DIR}\""
+	for file in "${MAPS_STORE_DIR}"/*; do
 		local name="$(
-			echo "${i}" |\
-			sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-.*-.*.pk3$,\1,"
+			echo "${file}" |\
+			sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-[0-9a-f]\{40\}-[0-9a-f]\{40\}.pk3$,\1,"
 		)"
 		local version="$(
-			echo "${i}" |\
-			sed -e "s,${MAPS_STORE_DIR}/${name}-\([^/]*\).pk3$,\1,"
-		)"
-		# latest builds of maps are above
-		local Cversion="$(
-			grep autobuild-bsp.list -m1 \
-				-e "href=\"${name%-full}-.*.pk3\">bspk3<" |\
-			sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1,"
+			echo "${file}" |\
+			sed -e "s,${MAPS_STORE_DIR}/${name}-\([0-9a-f]\{40\}-[0-9a-f]\{40\}\).pk3$,\1,"
 		)"
+		latest_pk3_version
 
-		if [ "${version}" != "${Cversion}" ]; then
-			einfo "${i} is obsolete, removing"
-			rm -f "${i}"
+		if [ "${version}" != "${latest_version}" ]; then
+			einfo "\"${file}\" is obsolete, removing"
+			rm -f "${file}" || die
 		elif [ "x${version}" = "x" ]; then
-			ewarn "${i} has incorrect name, removing"
-			rm -f "${i}"
-		elif [ "x${Cversion}" = "x" ]; then
-			ewarn "${i} is not available in ${base_url}, removing"
-			rm -f "${i}"
-		elif unzip -t "${i}" > /dev/null; then
-			true
+			ewarn "\"${file}\" has incorrect name, removing"
+			rm -f "${file}" || die
+		elif [ "x${latest_version}" = "x" ]; then
+			ewarn "\"${file}\" is not available in ${base_url}, removing"
+			rm -f "${file}" || die
 		else
-			ewarn "${i} is not valid pk3 file, removing"
-			rm -f "${i}"
+			validate_pk3 "${file}"
 		fi
 	done
+
+	einfo "Downloading maps"
+	while read name; do
+		latest_pk3_version
+		local file="${name}-${latest_version}.pk3"
+		local path="${MAPS_STORE_DIR}/${file}"
+		local url="${base_url}${file}"
+
+		if [[ ! -f "${path}" ]]; then
+			rm -f "${path}" 2> /dev/null || die
+			einfo "Downloading ${file}"
+			$WGET "${url}" -O "${path}" || ewarn "downloading \"${url}\" failed"
+			validate_pk3 "${path}"
+		fi
+		echo "${file}" >> install_files.txt
+	done < install_maps.txt
 }
 
+src_prepare() { :; }
+src_configure() { :; }
+src_compile() { :; }
+
 src_install() {
 	insinto "${GAMES_DATADIR}/${MY_PN}/data"
-	for i in ${MapFiles}; do
-		doins "${MAPS_STORE_DIR}/${i}" || ewarn "installing ${i} failed"
-	done
+	while read file; do
+		nonfatal doins "${MAPS_STORE_DIR}/${file}" || ewarn "installing \"${file}\" failed"
+	done < install_files.txt
 
 	prepgamesdirs
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/gamerlay:master commit in: games-fps/xonotic-maps/
@ 2016-08-05 21:49 Vadim A. Misbakh-Soloviov
  0 siblings, 0 replies; 2+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2016-08-05 21:49 UTC (permalink / raw
  To: gentoo-commits

commit:     b1f0646fa63d741dec211cbf468739eacdaea538
Author:     Vadim A. Misbakh-Soloviov <git <AT> mva <DOT> name>
AuthorDate: Fri Aug  5 21:49:08 2016 +0000
Commit:     Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
CommitDate: Fri Aug  5 21:49:08 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=b1f0646f

xonotic-maps: fix bug reported by email. TODO: ask Nikoli to KILL IT WITH FIRE and rewrite

 games-fps/xonotic-maps/metadata.xml             |  2 +-
 games-fps/xonotic-maps/xonotic-maps-9999.ebuild | 55 +++++++++----------------
 2 files changed, 21 insertions(+), 36 deletions(-)

diff --git a/games-fps/xonotic-maps/metadata.xml b/games-fps/xonotic-maps/metadata.xml
index 0945c61..f3eb681 100644
--- a/games-fps/xonotic-maps/metadata.xml
+++ b/games-fps/xonotic-maps/metadata.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-	<maintainer>
+	<maintainer type="person">
 		<email>nikoli@lavabit.com</email>
 		<name>Nikoli</name>
 	</maintainer>

diff --git a/games-fps/xonotic-maps/xonotic-maps-9999.ebuild b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild
index 1d7d151..460d48d 100644
--- a/games-fps/xonotic-maps/xonotic-maps-9999.ebuild
+++ b/games-fps/xonotic-maps/xonotic-maps-9999.ebuild
@@ -1,10 +1,12 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: $
 
-EAPI=5
+# QA: FUCKING CRAP!!!
+# TODO: ask Nikoli to rewrite if I ever find him
 
-inherit games check-reqs
+EAPI=6
+
+inherit check-reqs
 
 MY_PN="${PN%-maps}"
 DESCRIPTION="Xonotic maps"
@@ -13,6 +15,7 @@ HOMEPAGE="http://www.xonotic.org/"
 LICENSE="GPL-2"
 SLOT="0"
 IUSE="unofficial"
+KEYWORDS=""
 
 RDEPEND=""
 DEPEND="
@@ -22,19 +25,18 @@ DEPEND="
 S="${WORKDIR}"
 RESTRICT="test"
 
-if use unofficial; then
-	CHECKREQS_DISK_USR="1G"
-else
-	CHECKREQS_DISK_USR="155M"
-fi
-
 pkg_pretend() {
+	if use unofficial; then
+		CHECKREQS_DISK_USR="1G"
+	else
+		CHECKREQS_DISK_USR="155M"
+	fi
+
 	check-reqs_pkg_pretend
 }
 
 pkg_setup() {
 	check-reqs_pkg_setup
-	games_pkg_setup
 
 	ewarn "Downloaded pk3 files will be stored in \"xonotic-maps\" subdirectory of your DISTDIR"
 	echo
@@ -61,6 +63,7 @@ src_unpack() {
 
 	# FETCHCOMMAND from make.globals is example
 	local WGET="/usr/bin/wget -t 3 -T 60"
+	local SED="sed"
 	local base_url="http://beta.xonotic.org/autobuild-bsp/"
 
 	einfo "Downloading lists"
@@ -70,32 +73,22 @@ src_unpack() {
 	$WGET -O official_maps.html \
 		'http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=tree;f=maps' || die
 
-	grep -e '\.map</a>' official_maps.html |\
-		sed -e 's,.*">\([^<]*\).map<\/a>.*,\1,' > official_maps.txt || die
+	grep -e '\.map</a>' official_maps.html | ${SED} -e 's,.*">\([^<]*\).map<\/a>.*,\1,' > official_maps.txt || die
 	[ -s official_maps.txt ] || die "List of official maps is empty"
 	cp official_maps.txt install_maps.txt || die
 
 	if use unofficial; then
 	# For maps not in master branch we need to download fullpk3
 		# AllMaps - OfficialMaps = UnofficialMaps
-		grep all_maps.html \
-			-e '<td class="mapname">' |\
-		sed -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\
-		sort -u |\
-		grep -v -x -e '' \
-			-f official_maps.txt |\
-		sed -e 's,$,-full,' > unofficial_maps.txt
+		grep all_maps.html -e '<td class="mapname">' | ${SED} -e 's,.*="mapname">\([^<]*\)<.*,\1,' |\
+		sort -u | grep -v -x -e '' -f official_maps.txt | ${SED} -e 's,$,-full,' > unofficial_maps.txt
 		[ -s unofficial_maps.txt ] || die "List of unofficial maps is empty"
 		cat unofficial_maps.txt >> install_maps.txt
 	fi
 
 	latest_pk3_version() {
 		# latest builds of maps are above
-		latest_version="$(
-			grep all_maps.html -m1 \
-				-e "href=\"${name%-full}-.*.pk3\">bspk3<" |\
-			sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1,"
-		)"
+		latest_version="$(grep all_maps.html -m1 -e "href=\"${name%-full}-.*.pk3\">bspk3<" |sed -e "s,.*href=\"${name%-full}-\([^\"]*\).pk3\">bspk3<.*,\1,")"
 	}
 
 	validate_pk3() {
@@ -111,14 +104,8 @@ src_unpack() {
 	# If map becomes official, it changes branch and git hashes in name => no need to check both fullpk3 and bsppk3
 	einfo "Cleaning \"${MAPS_STORE_DIR}\""
 	for file in "${MAPS_STORE_DIR}"/*; do
-		local name="$(
-			echo "${file}" |\
-			sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-[0-9a-f]\{40\}-[0-9a-f]\{40\}.pk3$,\1,"
-		)"
-		local version="$(
-			echo "${file}" |\
-			sed -e "s,${MAPS_STORE_DIR}/${name}-\([0-9a-f]\{40\}-[0-9a-f]\{40\}\).pk3$,\1,"
-		)"
+		local name="$(echo "${file}" |sed -e "s,${MAPS_STORE_DIR}/\([^/]*\)-[0-9a-f]\{40\}-[0-9a-f]\{40\}.pk3$,\1,")"
+		local version="$(echo "${file}"|sed -e "s,${MAPS_STORE_DIR}/${name}-\([0-9a-f]\{40\}-[0-9a-f]\{40\}\).pk3$,\1,")"
 		latest_pk3_version
 
 		if [ "${version}" != "${latest_version}" ]; then
@@ -161,6 +148,4 @@ src_install() {
 	while read file; do
 		nonfatal doins "${MAPS_STORE_DIR}/${file}" || ewarn "installing \"${file}\" failed"
 	done < install_files.txt
-
-	prepgamesdirs
 }


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-05 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-05 21:49 [gentoo-commits] proj/gamerlay:master commit in: games-fps/xonotic-maps/ Vadim A. Misbakh-Soloviov
  -- strict thread matches above, loose matches on Subject: below --
2013-07-19 16:43 Nikoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox