Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
rpm -ivh --badreloc --relocate '/usr/bin=/tmp/tmp.gVVF7ufa4M/bin' --relocate '/usr/share=/tmp/tmp.gVVF7ufa4M/share' relocatable-package*.rpm
does not install the pkg and return error
Version-Release number of selected component (if applicable):
rpm-4.9.1.3-7.el7.x86_64
How reproducible:
always
Steps to Reproduce:
1. Build the following spec file
Name: relocatable-package
Version: 1.0
Release: 1
Summary: This package is a relocatable-package
Group: test
License: test
URL: none
#Source0: relocatable-package.txt
BuildArch: noarch
Prefix: %{_prefix}
%description
This is a test package only used for testing.
%prep
#touch relocatable-package.txt
#[ ! -d bin ] && mkdir bin
#[ ! -d lib ] && mkdir lib
mkdir -p bin
mkdir -p lib
mkdir -p share/doc/relocatable-package
touch bin/a-test-file
touch lib/a-test-file
touch share/doc/relocatable-package/a-test-file
%build
#do nothing
%install
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT/%{prefix}
cp -ar bin $RPM_BUILD_ROOT/%{prefix}
cp -ar lib $RPM_BUILD_ROOT/%{prefix}
cp -ar share $RPM_BUILD_ROOT/%{prefix}
%clean
echo RPM_BUILD_ROOT=$RPM_BUILD_ROOT
echo BUILD=%{buildroot}
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
/%{prefix}/bin/a-test-file
/%{prefix}/lib/a-test-file
/%{prefix}/share/doc/relocatable-package
/%{prefix}/share/doc/relocatable-package/a-test-file
2. This works:
# rpm -qip relocatable-package-1.0-1.noarch.rpm
Name : relocatable-package
Version : 1.0
Release : 1
Architecture: noarch
Install Date: (not installed)
Group : test
Size : 0
License : test
Signature : (none)
Source RPM : relocatable-package-1.0-1.src.rpm
Build Date : Tue 05 Jun 2012 12:34:44 PM CEST
Build Host : rhel70
Relocations : /usr
URL : none
Summary : This package is a relocatable-package
Description :
This is a test package only used for testing.
# rpm -ivh --relocate '/usr=/tmp' relocatable-package-1.0-1.noarch.rpm Preparing... ########################################### [100%]
1:relocatable-package ########################################### [100%]
# rpm -e relocatable-package
# rpm -ivh --prefix '/tmp' relocatable-package-1.0-1.noarch.rpm
Preparing... ########################################### [100%]
1:relocatable-package ########################################### [100%]
# rpm -e relocatable-package
3. But this fail on RHEL7:
# rpm -ivh --badreloc --relocate '/usr/bin=/tmp/bin' --relocate '/usr/share=/tmp/share' relocatable-package-1.0-1.noarch.rpm
error: Failed dependencies:
path /usr/bin in package relocatable-package-1.0-1.noarch is not relocatable
path /usr/share in package relocatable-package-1.0-1.noarch is not relocatable
4. On RHEL6 the above command install the pkg to defined path
Actual results:
rpm install fail
Expected results:
the package is installed to required destination
Additional info:
(In reply to comment #2)
> Isn't the answer to any --relocate question "don't use --relocate"?
>
> More seriously, what are you using relocation support for?
Well, I agree that it is not really used by package mainteiners (I have not found any relocatable package in current RHEL7 and one maybe two in RHEL6). The issue is that it is a feature that worked in RHEL6, so it suppose to work also in RHEL7.
--relocate is indeed a grande PITA but its not something we can just rip out as numerous 3rd party packages pretty much rely on it being there :-/
The issue here is not --relocate itself, its --badreloc that's not working. Easily reprocuced, I'll have a look.
This request was resolved in Red Hat Enterprise Linux 7.0.
Contact your manager or support representative in case you have further questions about the request.
Description of problem: rpm -ivh --badreloc --relocate '/usr/bin=/tmp/tmp.gVVF7ufa4M/bin' --relocate '/usr/share=/tmp/tmp.gVVF7ufa4M/share' relocatable-package*.rpm does not install the pkg and return error Version-Release number of selected component (if applicable): rpm-4.9.1.3-7.el7.x86_64 How reproducible: always Steps to Reproduce: 1. Build the following spec file Name: relocatable-package Version: 1.0 Release: 1 Summary: This package is a relocatable-package Group: test License: test URL: none #Source0: relocatable-package.txt BuildArch: noarch Prefix: %{_prefix} %description This is a test package only used for testing. %prep #touch relocatable-package.txt #[ ! -d bin ] && mkdir bin #[ ! -d lib ] && mkdir lib mkdir -p bin mkdir -p lib mkdir -p share/doc/relocatable-package touch bin/a-test-file touch lib/a-test-file touch share/doc/relocatable-package/a-test-file %build #do nothing %install rm -rf $RPM_BUILD_ROOT mkdir $RPM_BUILD_ROOT mkdir $RPM_BUILD_ROOT/%{prefix} cp -ar bin $RPM_BUILD_ROOT/%{prefix} cp -ar lib $RPM_BUILD_ROOT/%{prefix} cp -ar share $RPM_BUILD_ROOT/%{prefix} %clean echo RPM_BUILD_ROOT=$RPM_BUILD_ROOT echo BUILD=%{buildroot} rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) /%{prefix}/bin/a-test-file /%{prefix}/lib/a-test-file /%{prefix}/share/doc/relocatable-package /%{prefix}/share/doc/relocatable-package/a-test-file 2. This works: # rpm -qip relocatable-package-1.0-1.noarch.rpm Name : relocatable-package Version : 1.0 Release : 1 Architecture: noarch Install Date: (not installed) Group : test Size : 0 License : test Signature : (none) Source RPM : relocatable-package-1.0-1.src.rpm Build Date : Tue 05 Jun 2012 12:34:44 PM CEST Build Host : rhel70 Relocations : /usr URL : none Summary : This package is a relocatable-package Description : This is a test package only used for testing. # rpm -ivh --relocate '/usr=/tmp' relocatable-package-1.0-1.noarch.rpm Preparing... ########################################### [100%] 1:relocatable-package ########################################### [100%] # rpm -e relocatable-package # rpm -ivh --prefix '/tmp' relocatable-package-1.0-1.noarch.rpm Preparing... ########################################### [100%] 1:relocatable-package ########################################### [100%] # rpm -e relocatable-package 3. But this fail on RHEL7: # rpm -ivh --badreloc --relocate '/usr/bin=/tmp/bin' --relocate '/usr/share=/tmp/share' relocatable-package-1.0-1.noarch.rpm error: Failed dependencies: path /usr/bin in package relocatable-package-1.0-1.noarch is not relocatable path /usr/share in package relocatable-package-1.0-1.noarch is not relocatable 4. On RHEL6 the above command install the pkg to defined path Actual results: rpm install fail Expected results: the package is installed to required destination Additional info: