[Python-checkins] commit of r41482 - sandbox/trunk/setuptools/setuptools/command

phillip.eby@python.org phillip.eby at python.org
Sat Nov 19 20:36:29 CET 2005


Author: phillip.eby
Date: Sat Nov 19 20:36:29 2005
New Revision: 41482

Modified:
   sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py
Log:
Kludges to make building packages with '-' in their version work with
bdist_rpm.  This still doesn't address the issue of building RPMs that
don't effectively install as multi-version eggs, but at least now
building RPMs for development eggs is possible.


Modified: sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py	(original)
+++ sandbox/trunk/setuptools/setuptools/command/bdist_rpm.py	Sat Nov 19 20:36:29 2005
@@ -21,7 +21,24 @@
         _bdist_rpm.run(self)
 
     def _make_spec_file(self):
+        version = self.distribution.get_version()
+        rpmversion = version.replace('-','_')
         spec = _bdist_rpm._make_spec_file(self)
+        line23 = '%define version '+version
+        line24 = '%define version '+rpmversion
+        spec  = [
+            line.replace(
+                "Source0: %{name}-%{version}.tar",
+                "Source0: %{name}-%{unmangled_version}.tar"
+            ).replace(
+                "%setup",
+                "%setup -n %{name}-%{unmangled_version}"
+            ).replace(line23,line24)
+            for line in spec
+        ]
+        spec.insert(spec.index(line24)+1, "%define unmangled_version "+version)
+
+
         if not self.no_egg:
             return spec
 
@@ -31,3 +48,35 @@
                 "setup.py install ","setup.py install --old-and-unmanageable "
             ) for line in spec
         ]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


More information about the Python-checkins mailing list