[game-data-packager] 16/25: When building RPMs, append distro to release number

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 76af710763511ac12ab78f862cf96397cb77f110
Author: Simon McVittie <smcv at debian.org>
Date:   Sun Oct 9 17:21:30 2016 +0100

    When building RPMs, append distro to release number
    
    So that we can distinguish between different variants.
---
 game_data_packager/build.py         | 6 ++++++
 game_data_packager/packaging/rpm.py | 1 +
 2 files changed, 7 insertions(+)

diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index 7a5c599..74f20e5 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -2682,10 +2682,16 @@ class PackagingTask(object):
             try:
                 release = check_output(['rpm', '-q', '--qf' ,'%{RELEASE}',
                                          package.name]).decode('ascii')
+                if (self.packaging.distro is not None and
+                        release.endswith('.' + self.packaging.distro)):
+                    release = release[:-(len(self.packaging.distro) + 1)]
                 release = str(int(release) + 1)
             except (subprocess.CalledProcessError, ValueError):
                 release = '0'
 
+        if self.packaging.distro is not None:
+            release = release + '.' + self.packaging.distro
+
         specfile = self.fill_dest_dir_rpm(package, destdir, compress,
                                           arch, release)
         self.our_dh_fixperms(destdir)
diff --git a/game_data_packager/packaging/rpm.py b/game_data_packager/packaging/rpm.py
index 3c52645..ddb9b6a 100644
--- a/game_data_packager/packaging/rpm.py
+++ b/game_data_packager/packaging/rpm.py
@@ -36,6 +36,7 @@ class RpmPackaging(PackagingSystem):
 
     def __init__(self, distro=None):
         super(RpmPackaging, self).__init__()
+        self.distro = distro
         if distro is None or distro == 'generic':
             self._contexts = ('rpm', 'generic')
         else:

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