From 2c4b176eb61db337e6cb9f08fa191fdd727f8664 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 25 Dec 2016 12:34:38 +0200 Subject: Removve .buildinfo lines from .changes These record the build environment for reproducible builds, which is useful, but not they break reprepo 4.17.1-1, which is the newst version available outside of Debian experimental. --- icklib/step_debian_ci_upload.py | 17 +++++++++++++++++ icklib/step_debian_publish.py | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/icklib/step_debian_ci_upload.py b/icklib/step_debian_ci_upload.py index 06b3401..e474d01 100644 --- a/icklib/step_debian_ci_upload.py +++ b/icklib/step_debian_ci_upload.py @@ -49,6 +49,7 @@ class UploadDebianPackagesToCIRepo(icklib.BuildStep): # dget doesn't URL-decode file:// URLs. So we do that. changes_url = urllib.unquote(changes_url) self._fixup_dbgsym(changes_url) + self._fixup_buildinfo(changes_url) cliapp.runcmd( ['dget', '-du', changes_url], cwd=incoming, @@ -88,3 +89,19 @@ class UploadDebianPackagesToCIRepo(icklib.BuildStep): with open(path, 'w') as f: f.write(fixed) + + def _fixup_buildinfo(self, changes_url): + scheme, _, path, _, _, _ = urlparse.urlparse( + changes_url) + assert scheme == 'file' + + with open(path) as f: + text = f.read() + + fixed = ''.join( + '{}\n'.format(line) + for line in text.splitlines() + if '.buildinfo' not in line) + + with open(path, 'w') as f: + f.write(fixed) diff --git a/icklib/step_debian_publish.py b/icklib/step_debian_publish.py index 94d4934..2820959 100644 --- a/icklib/step_debian_publish.py +++ b/icklib/step_debian_publish.py @@ -41,6 +41,7 @@ class PublishDebianPackages(icklib.BuildStep): with self.run_state.logger: tempdir = self._copy_packages() self._remove_dbgsym_packages_from_changes_files(tempdir) + self._remove_buildinfo_from_changes_files(tempdir) self._debsign(tempdir) self._dput_targets(tempdir) self._dput_unstable(tempdir) @@ -65,6 +66,17 @@ class PublishDebianPackages(icklib.BuildStep): with open(filename, 'w') as f: f.write(modified) + def _remove_buildinfo_from_changes_files(self, tempdir): + for filename in self._changes_files(tempdir): + with open(filename) as f: + text = f.read() + modified = ''.join( + '{}\n'.format(line) + for line in text.splitlines() + if '.buildinfo' not in line) + with open(filename, 'w') as f: + f.write(modified) + def _changes_files(self, tempdir): return glob.glob(os.path.join(tempdir, '*.changes')) -- cgit v1.2.1