diff options
author | Éric Araujo <merwok@netwok.org> | 2012-02-05 12:41:47 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2012-02-05 12:41:47 (GMT) |
commit | cd2a6033ac0bafd69a7cba2d132e092127acc895 (patch) | |
tree | 4e5d6c97edcf7056659a37371a24da12ef018172 /Lib | |
parent | bd249c1bae9e70368ca190ca8e60b3e5343e9344 (diff) | |
parent | 89dfd5cf80965fcf1d3fe4db8268f8acc67b5f64 (diff) | |
download | cpython-cd2a6033ac0bafd69a7cba2d132e092127acc895.zip cpython-cd2a6033ac0bafd69a7cba2d132e092127acc895.tar.gz cpython-cd2a6033ac0bafd69a7cba2d132e092127acc895.tar.bz2 |
Branch merge
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/command/bdist_rpm.py | 12 | ||||
-rw-r--r-- | Lib/distutils/tests/test_bdist_rpm.py | 9 | ||||
-rw-r--r-- | Lib/shutil.py | 1 |
3 files changed, 21 insertions, 1 deletions
diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index 678e118..357eaa5 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -365,16 +365,28 @@ class bdist_rpm(Command): self.spawn(rpm_cmd) if not self.dry_run: + if self.distribution.has_ext_modules(): + pyversion = get_python_version() + else: + pyversion = 'any' + if not self.binary_only: srpm = os.path.join(rpm_dir['SRPMS'], source_rpm) assert(os.path.exists(srpm)) self.move_file(srpm, self.dist_dir) + filename = os.path.join(self.dist_dir, source_rpm) + self.distribution.dist_files.append( + ('bdist_rpm', pyversion, filename)) if not self.source_only: for rpm in binary_rpms: rpm = os.path.join(rpm_dir['RPMS'], rpm) if os.path.exists(rpm): self.move_file(rpm, self.dist_dir) + filename = os.path.join(self.dist_dir, + os.path.basename(rpm)) + self.distribution.dist_files.append( + ('bdist_rpm', pyversion, filename)) def _dist_path(self, path): return os.path.join(self.dist_dir, os.path.basename(path)) diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py index 804fb13..ab7a1bf 100644 --- a/Lib/distutils/tests/test_bdist_rpm.py +++ b/Lib/distutils/tests/test_bdist_rpm.py @@ -78,6 +78,10 @@ class BuildRpmTestCase(support.TempdirManager, dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) self.assertTrue('foo-0.1-1.noarch.rpm' in dist_created) + # bug #2945: upload ignores bdist_rpm files + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files) + def test_no_optimize_flag(self): # XXX I am unable yet to make this test work without @@ -117,6 +121,11 @@ class BuildRpmTestCase(support.TempdirManager, dist_created = os.listdir(os.path.join(pkg_dir, 'dist')) self.assertTrue('foo-0.1-1.noarch.rpm' in dist_created) + + # bug #2945: upload ignores bdist_rpm files + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files) + os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm')) def test_suite(): diff --git a/Lib/shutil.py b/Lib/shutil.py index 00bffe5..d1b1af3 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -493,7 +493,6 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None): _ARCHIVE_FORMATS = { 'gztar': (_make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"), - 'bztar': (_make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"), 'tar': (_make_tarball, [('compress', None)], "uncompressed tar file"), 'zip': (_make_zipfile, [],"ZIP file") } |