[game-data-packager] 02/14: Always build vfs.zip, and optionally use it even when uninstalled

Simon McVittie smcv at debian.org
Mon Nov 2 00:49:17 UTC 2015


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository game-data-packager.

commit 1a8117cc0d3605eba9bac5aa86aef84c1d06052e
Author: Simon McVittie <smcv at debian.org>
Date:   Sun Nov 1 14:39:24 2015 +0000

    Always build vfs.zip, and optionally use it even when uninstalled
---
 Makefile                    | 19 ++++++++++++++-----
 debian/changelog            |  1 +
 debian/rules                |  5 +----
 game_data_packager/paths.py |  2 +-
 4 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index e1522c8..54adba7 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,8 @@ copyright := $(patsubst ./data/%,./out/%,$(wildcard ./data/*.copyright))
 dot_in    := $(patsubst ./data/%,./out/%,$(wildcard ./data/*.in))
 
 default: $(DIRS) $(png) $(svgz) $(json) $(copyright) $(dot_in) \
-      out/bash_completion out/changelog.gz out/copyright out/game-data-packager
+      out/bash_completion out/changelog.gz out/copyright \
+      out/game-data-packager out/vfs.zip
 
 out/%: data/%
 	if [ -L $< ]; then cp -a $< $@ ; else install -m644 $< $@ ; fi
@@ -31,10 +32,17 @@ out/%: data/%
 out/%.json: data/%.yaml
 	python3 tools/yaml2json.py $< $@
 
-out/vfs.zip:
+out/vfs.zip: $(json)
 	rm -f out/vfs.zip
-	find out -regex '.*\.\(json\|files\|size_and_md5\|cksums\|md5sums\|sha1sums\|sha256sums\)' \
-          | LC_ALL=C sort | TZ=UTC zip out/vfs.zip -9 -X -j -q -@
+	rm -fr out/vfs
+	mkdir out/vfs
+	cp out/*.json out/*.files out/*.size_and_md5 out/*.cksums out/vfs/
+	cp out/*.md5sums out/*.sha1sums out/*.sha256sums out/vfs/
+	if [ -n "$(BUILD_DATE)" ]; then \
+		touch --date='$(BUILD_DATE)' out/vfs/*; \
+	fi
+	cd out/vfs && ls -1 | LC_ALL=C sort | \
+		env TZ=UTC zip ../vfs.zip -9 -X -q -@
 
 out/bash_completion: $(in_yaml)
 	python3 tools/bash_completion.py > ./out/bash_completion
@@ -89,6 +97,7 @@ clean:
 	rm -f ./out/*.json
 	rm -f ./out/vfs.zip
 	rm -f ./out/index.html
+	rm -fr out/vfs
 	rm -rf game_data_packager/__pycache__
 	rm -rf game_data_packager/games/__pycache__
 	rm -rf tools/__pycache__
@@ -111,4 +120,4 @@ html: $(DIRS) $(json)
 	LC_ALL=C GDP_UNINSTALLED=1 PYTHONPATH=. python3 -m tools.babel
 	rsync out/index.html alioth.debian.org:/var/lib/gforge/chroot/home/groups/pkg-games/htdocs/game-data/ -e ssh -v
 
-.PHONY: default clean check manual-check html out/vfs.zip
+.PHONY: default clean check manual-check html
diff --git a/debian/changelog b/debian/changelog
index 79210f3..6319df9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,7 @@ game-data-packager (44) UNRELEASED; urgency=medium
 
   [ Simon McVittie ]
   * quake, quake2: make aliases consistently strings
+  * Always build vfs.zip, and optionally use it even when uninstalled
 
  -- Simon McVittie <smcv at debian.org>  Sun, 01 Nov 2015 11:10:56 +0100
 
diff --git a/debian/rules b/debian/rules
index 5fdb907..d1336a6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,16 +5,13 @@
 export DH_OPTIONS
 
 include /usr/share/dpkg/pkg-info.mk
-BUILD_DATE := $(shell dpkg-parsechangelog --show-field=Date)
 
 %:
 	dh $@ --parallel --with python3,bash-completion
 
 override_dh_auto_build:
+	BUILD_DATE="$$(dpkg-parsechangelog --show-field=Date)" \
 	dh_auto_build --parallel
-	find out -regex '.*\.\(json\|files\|size_and_md5\|cksums\|md5sums\|sha1sums\|sha256sums\)' \
-          -exec touch --date='$(BUILD_DATE)' {} \;
-	make out/vfs.zip
 
 override_dh_auto_clean:
 	dh_auto_clean --parallel
diff --git a/game_data_packager/paths.py b/game_data_packager/paths.py
index 417ca31..2991ed4 100644
--- a/game_data_packager/paths.py
+++ b/game_data_packager/paths.py
@@ -6,7 +6,7 @@ if os.environ.get('GDP_UNINSTALLED'):
     CONFIG = './etc/game-data-packager.conf'
     DATADIR = './out'
     ETCDIR = './etc'
-    USE_VFS = False
+    USE_VFS = bool(os.environ.get('GDP_USE_VFS'))
 else:
     CONFIG = '/etc/game-data-packager.conf'
     DATADIR = '/usr/share/games/game-data-packager'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list