aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-03-05 01:27:23 +0000
committerlloyd <[email protected]>2013-03-05 01:27:23 +0000
commitb35173a6ac0c491e1ec24b5def58007ef349c55e (patch)
tree51fb88f207a9bc13a32a9801817f19932501d9b1 /src/build-data
parent0643e437fceaabf3baf8a6e7cf0141d15b12a9f9 (diff)
Create the checkout in the current working directory, then move the
archive to output dir at the end. As it was, the tar file was getting the full path included in it when used with --output-dir
Diffstat (limited to 'src/build-data')
-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__':