summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-08-15 13:05:35 (GMT)
committerGreg Ward <gward@python.net>2000-08-15 13:05:35 (GMT)
commit44a980dff9d9181979c6c587a081eb446cc6f6df (patch)
tree20868ee9765bdcdde0b0b219acc137f642f7f689 /Lib/distutils
parenta12c195064f5fa51bf7c425a3b55aa103c3f5a7c (diff)
downloadcpython-44a980dff9d9181979c6c587a081eb446cc6f6df.zip
cpython-44a980dff9d9181979c6c587a081eb446cc6f6df.tar.gz
cpython-44a980dff9d9181979c6c587a081eb446cc6f6df.tar.bz2
Fixed the move-RPM-files hack so it knows about the '--binary-only' and
'--source-only' options.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/command/bdist_rpm.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py
index 1da0b81..026a3ba 100644
--- a/Lib/distutils/command/bdist_rpm.py
+++ b/Lib/distutils/command/bdist_rpm.py
@@ -295,14 +295,17 @@ class bdist_rpm (Command):
# find out the names of the RPM files created; also, this assumes
# that RPM creates exactly one source and one binary RPM.
if not self.dry_run:
- srpms = glob.glob(os.path.join(rpm_dir['SRPMS'], "*.rpm"))
- rpms = glob.glob(os.path.join(rpm_dir['RPMS'], "*/*.rpm"))
- assert len(srpms) == 1, \
- "unexpected number of SRPM files found: %s" % srpms
- assert len(rpms) == 1, \
- "unexpected number of RPM files found: %s" % rpms
- self.move_file(srpms[0], self.dist_dir)
- self.move_file(rpms[0], self.dist_dir)
+ if not self.binary_only:
+ srpms = glob.glob(os.path.join(rpm_dir['SRPMS'], "*.rpm"))
+ assert len(srpms) == 1, \
+ "unexpected number of SRPM files found: %s" % srpms
+ self.move_file(srpms[0], self.dist_dir)
+
+ if not self.source_only:
+ rpms = glob.glob(os.path.join(rpm_dir['RPMS'], "*/*.rpm"))
+ assert len(rpms) == 1, \
+ "unexpected number of RPM files found: %s" % rpms
+ self.move_file(rpms[0], self.dist_dir)
# run()