summaryrefslogtreecommitdiff
path: root/icklib
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-04-09 19:26:31 +0300
committerLars Wirzenius <liw@liw.fi>2016-04-09 19:35:41 +0300
commit53a61bd1313d3ef1bf5ab5bae539405e1295ac8a (patch)
tree5e6b3bb9b8c014b6dfb6f6fcd22734195e3663f6 /icklib
parente7bfff153bd1a615995b36b86604f6ff12f6a096 (diff)
downloadick-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.
Diffstat (limited to 'icklib')
-rw-r--r--icklib/step_debian_ci_upload.py20
1 files changed, 20 insertions, 0 deletions
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)