[game-data-packager] 01/01: arch: create architecture-depedent packages

Alexandre Detiste detiste-guest at moszumanska.debian.org
Thu Jan 7 00:17:42 UTC 2016


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

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

commit aaf5cdfb4516074a1cdc2d703c51969bcf7213cb
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Thu Jan 7 01:16:54 2016 +0100

    arch: create architecture-depedent packages
---
 game_data_packager/build.py          | 18 +++++++++---------
 game_data_packager/packaging/arch.py |  9 +++++++++
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 168f96e..7e30cb9 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -1425,7 +1425,7 @@ class PackagingTask(object):
     def fill_extra_files(self, package, destdir):
         pass
 
-    def fill_dest_dir_arch(self, package, destdir, compress):
+    def fill_dest_dir_arch(self, package, destdir, compress, arch):
         PKGINFO = os.path.join(destdir, '.PKGINFO')
         short_desc, _ = self.generate_description(package)
         size = check_output(['du','-bs','.'], cwd=destdir)
@@ -1442,7 +1442,7 @@ class PackagingTask(object):
             pkginfo.write('builddate = %i\n' % int(time.time()))
             pkginfo.write('packager = Alexandre Detiste <alexandre at detiste.be>\n')
             pkginfo.write('size = %i\n' % size)
-            pkginfo.write('arch = any\n')
+            pkginfo.write('arch = %s\n' % arch)
             pkginfo.write('license = Commercial\n')
             pkginfo.write('group = games\n')
             if package.expansion_for:
@@ -2637,19 +2637,19 @@ class PackagingTask(object):
         if not self.fill_dest_dir(package, destdir):
             return None
 
-        self.fill_dest_dir_arch(package, destdir, compress)
+        arch = package.architecture
+        if arch == 'all':
+            arch = 'any'
+        else:
+            arch = self.packaging.get_architecture(arch)
+
+        self.fill_dest_dir_arch(package, destdir, compress, arch)
         self.our_dh_fixperms(destdir)
 
         assert os.path.isdir(os.path.join(destdir, 'usr')), destdir
         assert os.path.isfile(os.path.join(destdir, '.PKGINFO')), destdir
         assert os.path.isfile(os.path.join(destdir, '.MTREE')), destdir
 
-        arch = package.architecture
-        if arch != 'all':
-            arch = self.packaging.get_architecture(arch)
-        if arch == 'all':
-            arch = 'any'
-
         pkg_basename = '%s-%s-1-%s.pkg.tar.xz' % (package.name, package.version, arch)
         outfile = os.path.join(os.path.abspath(destination), pkg_basename)
 
diff --git a/game_data_packager/packaging/arch.py b/game_data_packager/packaging/arch.py
index fb6b773..a9b209b 100644
--- a/game_data_packager/packaging/arch.py
+++ b/game_data_packager/packaging/arch.py
@@ -17,6 +17,7 @@
 # /usr/share/common-licenses/GPL-2.
 
 import logging
+import os
 import subprocess
 
 from . import (PackagingSystem)
@@ -25,6 +26,8 @@ from ..util import (run_as_root, check_output)
 logger = logging.getLogger(__name__)
 
 class ArchPackaging(PackagingSystem):
+    LICENSEDIR = 'usr/share/licenses'
+
     install_cmd = 'pacman -S'
     package_map = {
                   'id-shr-extract': None,
@@ -32,6 +35,12 @@ class ArchPackaging(PackagingSystem):
                   # XXX
                   }
 
+    def read_architecture(self):
+        super(ArchPackaging, self).read_architecture()
+        # https://wiki.archlinux.org/index.php/Multilib
+        if self._architecture == 'amd64' and os.path.exists('/usr/lib32/libc.so'):
+            self._foreign_architectures = set(['i386'])
+
     def is_installed(self, package):
         return subprocess.call(['pacman', '-Q', package],
                                 stdout=subprocess.DEVNULL,

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