diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-04-09 19:26:31 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-04-09 19:35:41 +0300 |
commit | 53a61bd1313d3ef1bf5ab5bae539405e1295ac8a (patch) | |
tree | 5e6b3bb9b8c014b6dfb6f6fcd22734195e3663f6 | |
parent | e7bfff153bd1a615995b36b86604f6ff12f6a096 (diff) | |
download | ick-53a61bd1313d3ef1bf5ab5bae539405e1295ac8a.tar.gz |
Remove -dbgsym lines from changes files
This allows reprepro from jessie handle builds from unstable, which
now automatically include -dbgsym packages. For my purposes they
aren't useful, so ick just removes them from the changes files.
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | icklib/step_debian_ci_upload.py | 20 |
2 files changed, 21 insertions, 0 deletions
@@ -4,6 +4,7 @@ NEWS for Ick Version 0.15+git, not yet released ---------------------------------- +* Ick now removes -dbgsym packages from .changes files. Version 0.15, released 2016-03-16 ---------------------------------- diff --git a/icklib/step_debian_ci_upload.py b/icklib/step_debian_ci_upload.py index 193687b..06b3401 100644 --- a/icklib/step_debian_ci_upload.py +++ b/icklib/step_debian_ci_upload.py @@ -21,6 +21,7 @@ import re import subprocess import sys import urllib +import urlparse import cliapp @@ -43,8 +44,11 @@ class UploadDebianPackagesToCIRepo(icklib.BuildStep): line_logger = icklib.LineLogger( self.run_state.progress, self.run_state.logger) for changes_url in self.run_state.changes_files: + self.run_state.logger.important( + 'changes_url: %r' % changes_url) # dget doesn't URL-decode file:// URLs. So we do that. changes_url = urllib.unquote(changes_url) + self._fixup_dbgsym(changes_url) cliapp.runcmd( ['dget', '-du', changes_url], cwd=incoming, @@ -68,3 +72,19 @@ class UploadDebianPackagesToCIRepo(icklib.BuildStep): stderr=subprocess.STDOUT) else: sys.exit(exit_code) + + def _fixup_dbgsym(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 '-dbgsym' not in line) + + with open(path, 'w') as f: + f.write(fixed) |