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.
Bug 828784 - rpm --relocate not working as expected
Summary: rpm --relocate not working as expected
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm
Version: 7.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: Patrik Kis
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-05 11:34 UTC by Patrik Kis
Modified: 2014-06-13 09:26 UTC (History)
1 user (show)

Fixed In Version: rpm-4.10.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 09:26:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Patrik Kis 2012-06-05 11:34:24 UTC
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:

Comment 2 Bill Nottingham 2012-06-08 15:49:33 UTC
Isn't the answer to any --relocate question "don't use --relocate"?

More seriously, what are you using relocation support for?

Comment 3 Patrik Kis 2012-06-11 06:58:00 UTC
(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.

Comment 4 Panu Matilainen 2012-06-18 08:08:13 UTC
--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.

Comment 5 Panu Matilainen 2012-08-07 07:34:46 UTC
FWIW fixed upstream now, should be easily backportable: http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=4fbb58c7e6ee7d1bb565b27e4f81dcf2fee93995

Comment 6 Panu Matilainen 2012-10-08 07:12:53 UTC
Fixed in rpm-4.10.1-1.el7.

Comment 8 Ludek Smid 2014-06-13 09:26:15 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.