From 040f032a1f39038ed3209712b468c356c34a5df5 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sun, 21 Aug 2005 23:33:40 +0000 Subject: Fix problem w/bdist_rpm and setuptools, reported by Walter Doerwald. I was trying to have setuptools fix distutils' broken filename handling that assumes people haven't put punctuation in their distribution names, including '-' (which prevents unambiguous parsing of distribution names). However, bdist_rpm's attempt to guess a source distribution's filename isn't compatible with this fix, without making other changes. I decided therefore to drop the fixes for the sake of backward compatibility, but monkeypatch bdist_rpm so that it runs "egg_info" first, to ensure that any --tag-svn-revision or other tagging options take effect. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041215 --- setuptools/command/bdist_rpm.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 setuptools/command/bdist_rpm.py (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py new file mode 100755 index 00000000..004419ce --- /dev/null +++ b/setuptools/command/bdist_rpm.py @@ -0,0 +1,11 @@ +# This is just a kludge so that bdist_rpm doesn't guess wrong about the +# distribution name and version, if the egg_info command is going to alter them + +from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm + +class bdist_rpm(_bdist_rpm): + + def run(self): + self.run_command('egg_info') # ensure distro name is up-to-date + _bdist_rpm.run(self) + -- cgit v1.2.1 From 78e2272d52969e26af767e0cbfadeaefebe84657 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sat, 3 Sep 2005 04:51:27 +0000 Subject: Added support for old-style RPMs (i.e. non-egg RPMs) --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041238 --- setuptools/command/bdist_rpm.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 004419ce..2cc3fb18 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -1,11 +1,33 @@ # This is just a kludge so that bdist_rpm doesn't guess wrong about the -# distribution name and version, if the egg_info command is going to alter them +# distribution name and version, if the egg_info command is going to alter +# them, and another kludge to allow you to build old-style non-egg RPMs from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm class bdist_rpm(_bdist_rpm): + user_options = _bdist_rpm.user_options + [ + ('no-egg', None, "Don't install as an egg (may break the package!)") + ] + + boolean_options = _bdist_rpm.boolean_options + ['no-egg'] + + def initialize_options(self): + _bdist_rpm.initialize_options(self) + self.no_egg = None + def run(self): self.run_command('egg_info') # ensure distro name is up-to-date _bdist_rpm.run(self) + def _make_spec_file(self): + spec = _bdist_rpm._make_spec_file(self) + if not self.no_egg: + return spec + + # Hack the spec file so that we install old-style + return [ + line.replace( + "setup.py install ","setup.py install --old-and-unmanageable " + ) for line in spec + ] -- cgit v1.2.1 From 1c5aaf1332c6c00139883eeffe44c563737176ae Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sat, 19 Nov 2005 19:36:29 +0000 Subject: 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. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041482 --- setuptools/command/bdist_rpm.py | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 2cc3fb18..4db04a32 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -21,7 +21,24 @@ class bdist_rpm(_bdist_rpm): _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 @@ class bdist_rpm(_bdist_rpm): "setup.py install ","setup.py install --old-and-unmanageable " ) for line in spec ] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1 From 66d77b786bd16b4f186c37951f18edfc1c8dec00 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Wed, 14 Dec 2005 18:10:11 +0000 Subject: Added a ``--single-version-externally-managed`` option to the ``install`` command so that you can more easily wrap a "flat" egg in a system package. Enhanced ``bdist_rpm`` so that it installs single-version eggs that don't rely on a ``.pth`` file. The ``--no-egg`` option has been removed, since all RPMs are now built in a more backwards-compatible format. Some work is now needed for easy_install to recognize bdist_wininst .exe's that wrap these new flat eggs, as currently the .egg-info will not be recognized. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041673 --- setuptools/command/bdist_rpm.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 4db04a32..1a0b0484 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -6,12 +6,6 @@ from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm class bdist_rpm(_bdist_rpm): - user_options = _bdist_rpm.user_options + [ - ('no-egg', None, "Don't install as an egg (may break the package!)") - ] - - boolean_options = _bdist_rpm.boolean_options + ['no-egg'] - def initialize_options(self): _bdist_rpm.initialize_options(self) self.no_egg = None @@ -30,6 +24,9 @@ class bdist_rpm(_bdist_rpm): line.replace( "Source0: %{name}-%{version}.tar", "Source0: %{name}-%{unmangled_version}.tar" + ).replace( + "setup.py install ", + "setup.py install --single-version-externally-managed " ).replace( "%setup", "%setup -n %{name}-%{unmangled_version}" @@ -37,18 +34,7 @@ class bdist_rpm(_bdist_rpm): for line in spec ] spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) - - - if not self.no_egg: - return spec - - # Hack the spec file so that we install old-style - return [ - line.replace( - "setup.py install ","setup.py install --old-and-unmanageable " - ) for line in spec - ] - + return spec -- cgit v1.2.1 From 0660a02f3cce2010406b4f2ec597142430e4265d Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Thu, 21 Sep 2006 22:01:22 +0000 Subject: Fix ``upload`` not uploading files built by ``bdist_rpm`` on Python 2.3 and 2.4. (Backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4051961 --- setuptools/command/bdist_rpm.py | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 1a0b0484..cbc03bd1 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -1,8 +1,10 @@ # This is just a kludge so that bdist_rpm doesn't guess wrong about the # distribution name and version, if the egg_info command is going to alter -# them, and another kludge to allow you to build old-style non-egg RPMs +# them, another kludge to allow you to build old-style non-egg RPMs, and +# finally, a kludge to track .rpm files for uploading when run on Python <2.5. from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm +import sys class bdist_rpm(_bdist_rpm): @@ -10,10 +12,33 @@ class bdist_rpm(_bdist_rpm): _bdist_rpm.initialize_options(self) self.no_egg = None + if sys.version<"2.5": + # Track for uploading any .rpm file(s) moved to self.dist_dir + def move_file(self, src, dst, level=1): + _bdist_rpm.move_file(self, src, dst, level) + if dst==self.dist_dir and src.endswith('.rpm'): + getattr(self.distribution,'dist_files',[]).append( + ('bdist_egg', + src.endswith('.src.rpm') and 'any' or get_python_version(), + os.path.join(dst, os.path.basename(src))) + ) + def run(self): self.run_command('egg_info') # ensure distro name is up-to-date _bdist_rpm.run(self) + + + + + + + + + + + + def _make_spec_file(self): version = self.distribution.get_version() rpmversion = version.replace('-','_') @@ -46,17 +71,6 @@ class bdist_rpm(_bdist_rpm): - - - - - - - - - - - -- cgit v1.2.1 From 76dfb37a768a71adde2d97b7e73c537a11e5a826 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Fri, 29 Dec 2006 00:41:11 +0000 Subject: Fix import problem for bdist_rpm w/Python<2.5 --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053182 --- setuptools/command/bdist_rpm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index cbc03bd1..9ca75e10 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -4,7 +4,7 @@ # finally, a kludge to track .rpm files for uploading when run on Python <2.5. from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm -import sys +import sys, os class bdist_rpm(_bdist_rpm): -- cgit v1.2.1 From e75740baecd2096b927d8c30264e5da8f9bb0936 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Tue, 9 Jan 2007 19:21:05 +0000 Subject: Bump version to 0.6c5, and backport bdist_rpm and cygwin dll fixes --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053317 --- setuptools/command/bdist_rpm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 9ca75e10..24e851a4 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -18,7 +18,7 @@ class bdist_rpm(_bdist_rpm): _bdist_rpm.move_file(self, src, dst, level) if dst==self.dist_dir and src.endswith('.rpm'): getattr(self.distribution,'dist_files',[]).append( - ('bdist_egg', + ('bdist_rpm', src.endswith('.src.rpm') and 'any' or get_python_version(), os.path.join(dst, os.path.basename(src))) ) -- cgit v1.2.1 From 3c7dab35677614a2bedb4c05d52ab59df68c9892 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Tue, 9 Jan 2007 22:23:01 +0000 Subject: Fix missing backport of import fix for bdist_rpm building non-source rpms. --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053325 --- setuptools/command/bdist_rpm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 24e851a4..8c48da35 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -19,7 +19,7 @@ class bdist_rpm(_bdist_rpm): if dst==self.dist_dir and src.endswith('.rpm'): getattr(self.distribution,'dist_files',[]).append( ('bdist_rpm', - src.endswith('.src.rpm') and 'any' or get_python_version(), + src.endswith('.src.rpm') and 'any' or sys.version[:3], os.path.join(dst, os.path.basename(src))) ) -- cgit v1.2.1 From 0407725e4bd3b01f41017b48aac1d57e3c6c3cf6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 30 Mar 2014 11:40:03 +0100 Subject: Remove excess whitespace; Normalize imports. --HG-- extra : amend_source : 62f689b409b4645eda5f81b2604c50a84713ee52 --- setuptools/command/bdist_rpm.py | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 8c48da35..380fd196 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -3,8 +3,9 @@ # them, another kludge to allow you to build old-style non-egg RPMs, and # finally, a kludge to track .rpm files for uploading when run on Python <2.5. +import sys +import os from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm -import sys, os class bdist_rpm(_bdist_rpm): @@ -27,25 +28,13 @@ class bdist_rpm(_bdist_rpm): self.run_command('egg_info') # ensure distro name is up-to-date _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 = [ + spec = [ line.replace( "Source0: %{name}-%{version}.tar", "Source0: %{name}-%{unmangled_version}.tar" @@ -60,23 +49,3 @@ class bdist_rpm(_bdist_rpm): ] spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) return spec - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.1 From 49298396c6067617cc6ba08e0c88921c604c28b3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 30 Mar 2014 11:43:40 +0100 Subject: Remove legacy compatibility in bdist_rpm --HG-- extra : amend_source : 829ebde0696d12adfb54aca74ea6b1b510177ff4 --- setuptools/command/bdist_rpm.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 380fd196..d71420d5 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -1,10 +1,7 @@ # This is just a kludge so that bdist_rpm doesn't guess wrong about the # distribution name and version, if the egg_info command is going to alter -# them, another kludge to allow you to build old-style non-egg RPMs, and -# finally, a kludge to track .rpm files for uploading when run on Python <2.5. +# them, another kludge to allow you to build old-style non-egg RPMs. -import sys -import os from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm class bdist_rpm(_bdist_rpm): @@ -13,17 +10,6 @@ class bdist_rpm(_bdist_rpm): _bdist_rpm.initialize_options(self) self.no_egg = None - if sys.version<"2.5": - # Track for uploading any .rpm file(s) moved to self.dist_dir - def move_file(self, src, dst, level=1): - _bdist_rpm.move_file(self, src, dst, level) - if dst==self.dist_dir and src.endswith('.rpm'): - getattr(self.distribution,'dist_files',[]).append( - ('bdist_rpm', - src.endswith('.src.rpm') and 'any' or sys.version[:3], - os.path.join(dst, os.path.basename(src))) - ) - def run(self): self.run_command('egg_info') # ensure distro name is up-to-date _bdist_rpm.run(self) -- cgit v1.2.1 From ab81837b707280b960ca02675a85da7918d17fec Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 30 Mar 2014 11:54:24 +0100 Subject: Adjust to match modern style conventions. --- setuptools/command/bdist_rpm.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index d71420d5..194fa266 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -11,15 +11,17 @@ class bdist_rpm(_bdist_rpm): self.no_egg = None 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) 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 + line23 = '%define version ' + version + line24 = '%define version ' + rpmversion spec = [ line.replace( "Source0: %{name}-%{version}.tar", @@ -30,8 +32,10 @@ class bdist_rpm(_bdist_rpm): ).replace( "%setup", "%setup -n %{name}-%{unmangled_version}" - ).replace(line23,line24) + ).replace(line23, line24) 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 -- cgit v1.2.1 From ee51f57c4616357bb032e61a726a34cda0e71a66 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 30 Mar 2014 12:12:01 +0100 Subject: The no_egg option is no longer present. --- setuptools/command/bdist_rpm.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 194fa266..a2258401 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -6,10 +6,6 @@ from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm class bdist_rpm(_bdist_rpm): - def initialize_options(self): - _bdist_rpm.initialize_options(self) - self.no_egg = None - def run(self): # ensure distro name is up-to-date self.run_command('egg_info') -- cgit v1.2.1 From 58eb4b2b034d90f45b3daa12900f24a390bb4782 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 30 Mar 2014 12:16:15 +0100 Subject: Replace outdated deprecating comments with a proper doc string. --- setuptools/command/bdist_rpm.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index a2258401..c13732fa 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -1,10 +1,15 @@ -# This is just a kludge so that bdist_rpm doesn't guess wrong about the -# distribution name and version, if the egg_info command is going to alter -# them, another kludge to allow you to build old-style non-egg RPMs. - from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm class bdist_rpm(_bdist_rpm): + """ + Override the default bdist_rpm behavior to do the following: + + 1. Run egg_info to ensure the name and version are properly calculated. + 2. Always run 'install' using --single-version-externally-managed to + disable eggs in RPM distributions. + 3. Replace dash with underscore in the version numbers for better RPM + compatibility. + """ def run(self): # ensure distro name is up-to-date -- cgit v1.2.1 From 573c2c86d4d4f506a87a1fc16060f32c1386ad38 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 30 Apr 2014 17:38:29 -0400 Subject: Correct indentation and clarify meaning by using namespacing --HG-- extra : amend_source : 20ab7547c8478eb084767fe701e627bdd462ba16 --- setuptools/command/bdist_rpm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index c13732fa..99386824 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -1,6 +1,6 @@ -from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm +import distutils.command.bdist_rpm as orig -class bdist_rpm(_bdist_rpm): +class bdist_rpm(orig.bdist_rpm): """ Override the default bdist_rpm behavior to do the following: @@ -15,12 +15,12 @@ class bdist_rpm(_bdist_rpm): # ensure distro name is up-to-date self.run_command('egg_info') - _bdist_rpm.run(self) + orig.bdist_rpm.run(self) def _make_spec_file(self): version = self.distribution.get_version() rpmversion = version.replace('-','_') - spec = _bdist_rpm._make_spec_file(self) + spec = orig.bdist_rpm._make_spec_file(self) line23 = '%define version ' + version line24 = '%define version ' + rpmversion spec = [ -- cgit v1.2.1 From 8e3f9d3253d1d0fb820dad4249d5110d017595c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Wed, 18 Jun 2014 20:31:05 +0300 Subject: Fixed PEP 8 compliancy of the setuptools.command package --- setuptools/command/bdist_rpm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 99386824..70730927 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -1,5 +1,6 @@ import distutils.command.bdist_rpm as orig + class bdist_rpm(orig.bdist_rpm): """ Override the default bdist_rpm behavior to do the following: @@ -19,7 +20,7 @@ class bdist_rpm(orig.bdist_rpm): def _make_spec_file(self): version = self.distribution.get_version() - rpmversion = version.replace('-','_') + rpmversion = version.replace('-', '_') spec = orig.bdist_rpm._make_spec_file(self) line23 = '%define version ' + version line24 = '%define version ' + rpmversion -- cgit v1.2.1 From 760e2e1df9c9c9d1fc072e7b6ad9df4c32bfc835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 27 Jul 2018 14:36:34 +0200 Subject: Remove spurious executable permissions --- setuptools/command/bdist_rpm.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 setuptools/command/bdist_rpm.py (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py old mode 100755 new mode 100644 -- cgit v1.2.1 From 9a7710b1ef1bef6c3d8ad6427e87ee886860b40e Mon Sep 17 00:00:00 2001 From: Thomas Hisch Date: Sun, 30 Aug 2020 12:34:59 +0200 Subject: Reduce size of setuptools' bdist_rpm._make_spec_file There are some setuptools specific changes in the bdist_rpm module that are no longer needed, because the upstream/shipped version of distutils already contains them. The code that is removed in this commit from bdist_rpm is already part of the python-3.5 version of distutils. Related: #2377 --- setuptools/command/bdist_rpm.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 70730927..0eb1b9c2 100644 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -8,8 +8,6 @@ class bdist_rpm(orig.bdist_rpm): 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. - 3. Replace dash with underscore in the version numbers for better RPM - compatibility. """ def run(self): @@ -19,25 +17,15 @@ class bdist_rpm(orig.bdist_rpm): orig.bdist_rpm.run(self) def _make_spec_file(self): - version = self.distribution.get_version() - rpmversion = version.replace('-', '_') spec = orig.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.py install ", "setup.py install --single-version-externally-managed " ).replace( "%setup", "%setup -n %{name}-%{unmangled_version}" - ).replace(line23, line24) + ) for line in spec ] - insert_loc = spec.index(line24) + 1 - unmangled_version = "%define unmangled_version " + version - spec.insert(insert_loc, unmangled_version) return spec -- cgit v1.2.1 From 87848e1dcbe85e444b560a0aae419dc5ccd39b9e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 9 Sep 2021 14:25:43 +0300 Subject: Deprecate bdist_rpm --- setuptools/command/bdist_rpm.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'setuptools/command/bdist_rpm.py') diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 0eb1b9c2..98bf5dea 100644 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -1,4 +1,7 @@ import distutils.command.bdist_rpm as orig +import warnings + +from setuptools import SetuptoolsDeprecationWarning class bdist_rpm(orig.bdist_rpm): @@ -11,6 +14,12 @@ class bdist_rpm(orig.bdist_rpm): """ def run(self): + warnings.warn( + "bdist_rpm is deprecated and will be removed in a future " + "version. Use bdist_wheel (wheel packages) instead.", + SetuptoolsDeprecationWarning, + ) + # ensure distro name is up-to-date self.run_command('egg_info') -- cgit v1.2.1