[Python-checkins] release: Issue #27337: Ensure that the tar program in use for building source tarballs

ned.deily python-checkins at python.org
Tue Jul 12 00:28:31 EDT 2016


https://hg.python.org/release/rev/42fbca9d4b53
changeset: 106:42fbca9d4b53
user: Ned Deily <nad at python.org>
date: Mon Jul 11 15:19:10 2016 -0400
summary:
 Issue #27337: Ensure that the tar program in use for building source tarballs
is a GNU tar. BSD tar, the default on current OS X systems, does not strip
relative prefixes like GNU tar does.
files:
 release.py | 12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/release.py b/release.py
--- a/release.py
+++ b/release.py
@@ -54,10 +54,14 @@
 def check_env():
 if 'EDITOR' not in os.environ:
 error('editor not detected.',
- 'Please set your EDITOR enviroment variable')
+ 'Please set your EDITOR environment variable')
 if not os.path.exists('.hg'):
 error('CWD is not a Mercurial clone')
-
+ if 'TAR' not in os.environ:
+ os.environ['TAR'] = 'tar'
+ if 'GNU' not in get_output([os.environ['TAR'], '--version']).strip().decode():
+ error('"tar" must be GNU tar.',
+ 'Please set your TAR environment variable')
 
 def get_arg_parser():
 usage = '%prog [options] tagname'
@@ -192,9 +196,9 @@
 base = os.path.basename(source)
 tgz = base + '.tgz'
 xz = base + '.tar.xz'
- run_cmd(['tar cf - %s | gzip -9 > %s' % (source, tgz)])
+ run_cmd(['$TAR cf - %s | gzip -9 > %s' % (source, tgz)])
 print("Making .tar.xz")
- run_cmd(['tar cf - %s | xz > %s' % (source, xz)])
+ run_cmd(['$TAR cf - %s | xz > %s' % (source, xz)])
 print('Calculating md5 sums')
 checksum_tgz = hashlib.md5()
 with open(tgz, 'rb') as data:
-- 
Repository URL: https://hg.python.org/release


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /