From b35173a6ac0c491e1ec24b5def58007ef349c55e Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 5 Mar 2013 01:27:23 +0000 Subject: 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 --- src/build-data/scripts/dist.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/build-data') 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] \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__': -- cgit v1.2.3