[issue25187] bdist_rpm fails due to wrong hardcoded assumption about RPM filename format

David Ward report at bugs.python.org
Sun Sep 20 04:12:36 CEST 2015


New submission from David Ward:

bdist_rpm wrongly assumes a hard-coded format for the filename of the non-source RPM which is generated when it calls rpmbuild, specifically:
"%{arch}/%{name}-%{version}-%{release}.%{arch}.rpm"

The format used by rpmbuild is actually specified by the RPM macro %{_rpmfilename}. With the /usr/lib/rpm/macros file that is shipped with official releases of RPM (at http://rpm.org), %{_rpmfilename} evaluates to the value above. However this value cannot be assumed: the directory "%{arch}/" is dropped under the Mock chroot environment (https://fedoraproject.org/wiki/Mock). Mock is used to build all official Fedora Project packages (by Koji) as well as unofficial packages (by Copr). These two build systems also target Extra Packages for Enterprise Linux (EPEL) in addition to Fedora releases.

As a result, bdist_rpm fails when trying to move the non-source RPM to the 'dist' folder after it is built by rpmbuild.

The attached patch causes bdist_rpm to evaluate "%{_rpmfilename}" instead of relying on the hard-coded value.

----------
components: Distutils
files: python-bdist_rpm-evaluate-_rpmfilename.patch
keywords: patch
messages: 251136
nosy: dpward, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: bdist_rpm fails due to wrong hardcoded assumption about RPM filename format
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40523/python-bdist_rpm-evaluate-_rpmfilename.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25187>
_______________________________________


More information about the Python-bugs-list mailing list