aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data/scripts/dist.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/build-data/scripts/dist.py')
-rwxr-xr-xsrc/build-data/scripts/dist.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/build-data/scripts/dist.py b/src/build-data/scripts/dist.py
index fb13947a0..8d707ff3e 100755
--- a/src/build-data/scripts/dist.py
+++ b/src/build-data/scripts/dist.py
@@ -107,6 +107,8 @@ def gpg_sign(keyid, passphrase_file, files):
check_subprocess_results(gpg, 'gpg')
+ return [filename + '.asc' for filename in files]
+
def parse_args(args):
parser = optparse.OptionParser(
"usage: %prog [options] <version #>\n" +
@@ -234,10 +236,10 @@ def main(args = None):
logging.info('Found revision id %s' % (rev_id))
- output_basename = os.path.join(options.output_dir, output_name(args))
+ output_basename = output_name(args)
if os.access(output_basename, os.X_OK):
- logging.debug('Removing existing ouptut dir %s' % (output_basename))
+ logging.info('Removing existing output dir %s' % (output_basename))
shutil.rmtree(output_basename)
run_monotone(options.mtn_db,
@@ -309,13 +311,18 @@ def main(args = None):
shutil.rmtree(output_basename)
- if options.pgp_key_id != '':
- gpg_sign(options.pgp_key_id, options.pgp_passphrase_file, output_files)
-
if options.print_output_names:
for output_file in output_files:
print output_file
+ if options.pgp_key_id != '':
+ output_files += gpg_sign(options.pgp_key_id, options.pgp_passphrase_file, output_files)
+
+ if options.output_dir != '.':
+ for output_file in output_files:
+ logging.debug('Moving %s to %s' % (output_file, options.output_dir))
+ shutil.move(output_file, os.path.join(options.output_dir, output_file))
+
return 0
if __name__ == '__main__':