[28858] in Source-Commits

home help back first fref pref prev next nref lref last post

build-system commit: out_of_date_binaries: Include release tag in comparison

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Sun May 6 19:23:01 2018

Date: Sun, 6 May 2018 19:22:56 -0400
From: Anders Kaseorg <andersk@mit.edu>
Message-Id: <201805062322.w46NMuCU012595@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/build-system/commit/27d628d04ae2fe92b1510860af6393fc91f9c58d
commit 27d628d04ae2fe92b1510860af6393fc91f9c58d
Author: Anders Kaseorg <andersk@mit.edu>
Date:   Sun May 6 19:22:34 2018 -0400

    out_of_date_binaries: Include release tag in comparison
    
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>

 dabuildsys/apt.py |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/dabuildsys/apt.py b/dabuildsys/apt.py
index 66022d5..eb34439 100644
--- a/dabuildsys/apt.py
+++ b/dabuildsys/apt.py
@@ -165,14 +165,8 @@ class APTBinaryPackage(object):
     def __init__(self, name, version, architecture, manifest):
         self.name = name
         self.architecture = architecture
-
-        # We do not need ~ubuntu-version suffix here
         self.full_version = version
-        if '~' in version:
-            self.version = Version(version.split('~')[0])
-        else:
-            self.version = Version(version)
-
+        self.version = Version(version)
         self.manifest = manifest
         self.relations = manifest.relations
 
@@ -265,11 +259,12 @@ class APTDistribution(object):
 
                 # Actually compare versions
                 bin_pkg = bin_pkgs[arch]
-                if bin_pkg.version > src_pkg.version:
+                target_version = Version(src_pkg.version.full_version + '~' + config.release_tags[self.release])
+                if bin_pkg.version > target_version:
                     # Circumvent edge cases of version comparison with manual-config packages
                     if not (name.startswith('debathena-manual-') and name.endswith('-config')):
                         raise BuildError("Package %s has version higher in binary than in source" % bin_pkg.name)
-                if src_pkg.version > bin_pkg.version:
+                if target_version > bin_pkg.version:
                     out_of_date = True
                     continue
 

home help back first fref pref prev next nref lref last post