[game-data-packager] 17/25: Check completeness of contents in common code before building package

Simon McVittie smcv at debian.org
Sun Oct 9 21:26:06 UTC 2016


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 8ee92721a73f819f564e107cfc4e19e8bc7059f7
Author: Simon McVittie <smcv at debian.org>
Date:   Sun Oct 9 18:18:17 2016 +0100

    Check completeness of contents in common code before building package
---
 game_data_packager/build.py           | 21 ++++++---------------
 game_data_packager/games/lgeneral.py  |  5 +----
 game_data_packager/games/morrowind.py |  5 +----
 game_data_packager/games/quake2.py    |  7 ++-----
 4 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 74f20e5..334f4f6 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -1480,9 +1480,6 @@ class PackagingTask(object):
         os.chmod(control, 0o644)
 
     def fill_dest_dir(self, package, destdir):
-        if not self.check_complete(package, log=True):
-            return False
-
         pkgdocdir = self.packaging.substitute('$pkgdocdir', package.name)
         dest_pkgdocdir = os.path.join(destdir, pkgdocdir.strip('/'))
         mkdir_p(dest_pkgdocdir)
@@ -1590,8 +1587,6 @@ class PackagingTask(object):
 
         self.fill_extra_files(package, destdir)
 
-        return True
-
     def our_dh_fixperms(self, destdir):
         for dirpath, dirnames, filenames in os.walk(destdir):
             for fn in filenames + dirnames:
@@ -2443,6 +2438,9 @@ class PackagingTask(object):
                 arch = self.packaging.get_architecture(arch)
             arch = self.packaging.ARCH_DECODE.get(arch, arch)
 
+            if not self.check_complete(package, log=True):
+                raise SystemExit(1)
+
             if self.packaging.derives_from('deb'):
                 pkg = self.build_deb(package, arch, destination, compress=compress)
             elif self.packaging.derives_from('rpm'):
@@ -2587,10 +2585,7 @@ class PackagingTask(object):
         destdir = os.path.join(self.get_workdir(), '%s.deb.d' % package.name)
 
         self.check_component(package)
-        if not self.fill_dest_dir(package, destdir):
-            # FIXME: probably better as an exception?
-            return None
-
+        self.fill_dest_dir(package, destdir)
         self.fill_dest_dir_deb(package, destdir)
         self.our_dh_fixperms(destdir)
 
@@ -2631,10 +2626,7 @@ class PackagingTask(object):
 
     def build_arch(self, package, arch, destination, compress=True):
         destdir = os.path.join(self.get_workdir(), '%s.pkg.d' % package.name)
-
-        if not self.fill_dest_dir(package, destdir):
-            return None
-
+        self.fill_dest_dir(package, destdir)
         self.fill_dest_dir_arch(package, destdir, compress, arch)
         self.our_dh_fixperms(destdir)
 
@@ -2665,8 +2657,7 @@ class PackagingTask(object):
     def build_rpm(self, package, arch, compress=True):
         destdir = os.path.join(self.get_workdir(), '%s.rpm.d' % package.name)
 
-        if not self.fill_dest_dir(package, destdir):
-            return None
+        self.fill_dest_dir(package, destdir)
 
         if arch == 'noarch':
             setarch = []
diff --git a/game_data_packager/games/lgeneral.py b/game_data_packager/games/lgeneral.py
index 8b77966..6cff876 100644
--- a/game_data_packager/games/lgeneral.py
+++ b/game_data_packager/games/lgeneral.py
@@ -60,8 +60,7 @@ class LGeneralTask(PackagingTask):
 
     def fill_dest_dir(self, package, destdir):
         assert package.name == 'lgeneral-data-nonfree'
-        if not super(LGeneralTask, self).fill_dest_dir(package, destdir):
-            return False
+        super(LGeneralTask, self).fill_dest_dir(package, destdir)
 
         installdir = os.path.join(destdir, 'usr/share/games/lgeneral')
         unpackdir = os.path.join(self.get_workdir(), 'tmp', 'pg-data.tar.gz.d')
@@ -83,6 +82,4 @@ class LGeneralTask(PackagingTask):
                              'package-contains-timestamped-gzip',
                              'usr/share/games/lgeneral/pg-data.tar.gz')
 
-        return True
-
 GAME_DATA_SUBCLASS = LGeneralGameData
diff --git a/game_data_packager/games/morrowind.py b/game_data_packager/games/morrowind.py
index 809f494..aa5339f 100644
--- a/game_data_packager/games/morrowind.py
+++ b/game_data_packager/games/morrowind.py
@@ -30,8 +30,7 @@ class MorrowindGameData(GameData):
 
 class MorrowindTask(PackagingTask):
     def fill_dest_dir(self, package, destdir):
-        if not super(MorrowindTask, self).fill_dest_dir(package, destdir):
-            return False
+        super(MorrowindTask, self).fill_dest_dir(package, destdir)
 
         install_to = self.packaging.substitute(package.install_to,
                                                package.name)
@@ -76,8 +75,6 @@ class MorrowindTask(PackagingTask):
         # $ mkdir -p ~/.config/openmw/
         # $ cp /usr/share/games/morrowind-fr/openmw.cfg ~/.config/openmw/
 
-        return True
-
 # 1) sample output of openmw-iniimporter without "Data Files"
 
 #cfg file does not exist
diff --git a/game_data_packager/games/quake2.py b/game_data_packager/games/quake2.py
index de0180b..0025fe4 100644
--- a/game_data_packager/games/quake2.py
+++ b/game_data_packager/games/quake2.py
@@ -31,12 +31,11 @@ class Quake2GameData(GameData):
 
 class Quake2Task(PackagingTask):
     def fill_dest_dir(self, package, destdir):
-        if not super(Quake2Task, self).fill_dest_dir(package, destdir):
-            return False
+        super(Quake2Task, self).fill_dest_dir(package, destdir)
 
         if package.name not in ('quake2-reckoning-data',
                                 'quake2-groundzero-data'):
-            return True
+            return
 
         subdir = {
             'quake2-groundzero-data': 'rogue',
@@ -61,6 +60,4 @@ class Quake2Task(PackagingTask):
             os.path.join(unpackdir, expect_dir, 'release', 'game.so'),
             os.path.join(installdir, subdir, 'game.so')])
 
-        return True
-
 GAME_DATA_SUBCLASS = Quake2GameData

-- 
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