]> granicus.if.org Git - python/commitdiff
Fixed the move-RPM-files hack so it knows about the '--binary-only' and
authorGreg Ward <gward@python.net>
Tue, 15 Aug 2000 13:05:35 +0000 (13:05 +0000)
committerGreg Ward <gward@python.net>
Tue, 15 Aug 2000 13:05:35 +0000 (13:05 +0000)
'--source-only' options.

Lib/distutils/command/bdist_rpm.py

index 1da0b81f39df5973811b9466cee1a32c12e38da4..026a3ba4d5a24a607c45044823cc0c759e95ebdc 100644 (file)
@@ -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()