summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-12-25 12:34:38 +0200
committerLars Wirzenius <liw@liw.fi>2016-12-25 12:34:38 +0200
commit2c4b176eb61db337e6cb9f08fa191fdd727f8664 (patch)
treece8da464fcc057a825dfb87f48d3cd45a5220af5
parent1cb746e1495ba43eca99534871cfa0070d90c107 (diff)
downloadick-2c4b176eb61db337e6cb9f08fa191fdd727f8664.tar.gz
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.
-rw-r--r--icklib/step_debian_ci_upload.py17
-rw-r--r--icklib/step_debian_publish.py12
2 files changed, 29 insertions, 0 deletions
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'))