Commit ab81837b authored by Jason R. Coombs's avatar Jason R. Coombs

Adjust to match modern style conventions.

parent 49298396
...@@ -11,15 +11,17 @@ class bdist_rpm(_bdist_rpm): ...@@ -11,15 +11,17 @@ class bdist_rpm(_bdist_rpm):
self.no_egg = None self.no_egg = None
def run(self): def run(self):
self.run_command('egg_info') # ensure distro name is up-to-date # ensure distro name is up-to-date
self.run_command('egg_info')
_bdist_rpm.run(self) _bdist_rpm.run(self)
def _make_spec_file(self): def _make_spec_file(self):
version = self.distribution.get_version() version = self.distribution.get_version()
rpmversion = version.replace('-','_') rpmversion = version.replace('-','_')
spec = _bdist_rpm._make_spec_file(self) spec = _bdist_rpm._make_spec_file(self)
line23 = '%define version '+version line23 = '%define version ' + version
line24 = '%define version '+rpmversion line24 = '%define version ' + rpmversion
spec = [ spec = [
line.replace( line.replace(
"Source0: %{name}-%{version}.tar", "Source0: %{name}-%{version}.tar",
...@@ -30,8 +32,10 @@ class bdist_rpm(_bdist_rpm): ...@@ -30,8 +32,10 @@ class bdist_rpm(_bdist_rpm):
).replace( ).replace(
"%setup", "%setup",
"%setup -n %{name}-%{unmangled_version}" "%setup -n %{name}-%{unmangled_version}"
).replace(line23,line24) ).replace(line23, line24)
for line in spec for line in spec
] ]
spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) insert_loc = spec.index(line24) + 1
unmangled_version = "%define unmangled_version " + version
spec.insert(insert_loc, unmangled_version)
return spec return spec
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment