diff options
author | lloyd <[email protected]> | 2013-03-05 01:27:23 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-03-05 01:27:23 +0000 |
commit | b35173a6ac0c491e1ec24b5def58007ef349c55e (patch) | |
tree | 51fb88f207a9bc13a32a9801817f19932501d9b1 | |
parent | 0643e437fceaabf3baf8a6e7cf0141d15b12a9f9 (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
-rwxr-xr-x | src/build-data/scripts/dist.py | 17 |
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__': |