From 87842322e011d19edaa2bd802eb630ea75a134ac Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Thu, 5 Jun 2014 19:46:09 +0200 Subject: [PATCH] debian_build.py: Change distribution for archive01 in changes file. --- debian_build.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/debian_build.py b/debian_build.py index 1775a2d..c01145b 100755 --- a/debian_build.py +++ b/debian_build.py @@ -106,15 +106,16 @@ def getopts(): def upload_to_archive01(archive01_target, archive01_dist, changes_file, logger): try: - # dpkg-genchanges -b -DDistribution=$dist > $changes_file - cmd = ['dpkg-genchanges', '-b', '-DDistribution=' + archive01_dist] - logger.debug('Executing "{command}" ...'.format(command=' '.join(cmd))) - process = subprocess.Popen(cmd, close_fds=True, stdout=subprocess.PIPE, cwd=os.getcwd()) - changes = process.communicate()[0] - - filehandler = open(changes_file, 'w') - filehandler.write(changes) - filehandler.close() + # Change distribution for archive01 in changes file + cmd = ['sed', '-i', r's/^\(Distribution: \).*$/\1' + archive01_dist + '/', + changes_file] + command = ' '.join(cmd) + logger.debug('Executing "{command}" ...'.format(command=command)) + if subprocess.call(cmd) == 0: + logger.debug('%s succeeded.' % command) + else: + logger.warn('%s failed.' % command) + return cmd = ['dput', archive01_target, changes_file] command = ' '.join(cmd) -- 2.39.5