Bug 75550 - --relocate is ignored & RPM_INSTALL_PREFIX isn't defined
--relocate is ignored & RPM_INSTALL_PREFIX isn't defined
Status: CLOSED DUPLICATE of bug 75057
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
8.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Jeff Johnson
:
: 76326 77433 77967 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-09 16:44 EDT by Todd Allen
Modified: 2005-10-31 17:00 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-11-16 15:10:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Makefile (827 bytes, text/plain)
2002-10-09 16:46 EDT, Todd Allen
no flags Details
"it" rpm spec (426 bytes, text/plain)
2002-10-09 16:46 EDT, Todd Allen
no flags Details

  None (edit)
Description Todd Allen 2002-10-09 16:44:40 EDT
Description of Problem:

If the --relocate option is specified when installing an rpm, it is ignored.
(Although it does still do syntax checking on it.)  The rpm contents end up
being installed in the default place.

Also, the RPM_INSTALL_PREFIX and RPM_INSTALL_PREFIXn environment variables are
left undefined, regardless of whether or not --relocate was specified.  This
actually is worse for those of us rpm writers packagers who use that variable in
the target of a symlink.  The symlink ends up pointing into the weeds.

Version-Release number of selected component (if applicable): 4.1-1.06

How Reproducible: every time

Steps to Reproduce:
1. Get the Makefile and it.spec that I'll put in attachments.
2. make
3. rpm -ivh --relocate /usr/opt=/elsewhere it-1.0-1.i386.rpm
4. rpm -ql it

Actual Results:

The "rpm -ivh" command will dump any RPM-related environment variables. There
will be none.  The "rpm -ql" command will show that the files are installed in
/usr/opt and not /elsewhere.

Expected Results:

The "rpm -ivh" command should dump:
   RPM_INSTALL_PREFIX=/elsewhere
   RPM_INSTALL_PREFIX0=/elsewhere
The "rpm -ql" command should report:
   /elsewhere/smurf/it
   /elsewhere/it/it

Additional Information:
	
This works with 4.0.4 (from 7.3) and 4.1-0.81 (from 7.3.94/null).

Furthermore, an rpm built with 4.1-1.06 can be installed properly on a system
with 4.1-0.81.  So, it appears to be a bug in the rpm command doing the
installation, as opposed to the rpmbuild building it.
Comment 1 Todd Allen 2002-10-09 16:46:19 EDT
Created attachment 79705 [details]
Makefile
Comment 2 Todd Allen 2002-10-09 16:46:51 EDT
Created attachment 79706 [details]
"it" rpm spec
Comment 3 Jason Merrill 2002-11-05 00:21:26 EST
*** Bug 76326 has been marked as a duplicate of this bug. ***
Comment 4 Jeff Johnson 2002-11-16 15:08:23 EST
*** Bug 77967 has been marked as a duplicate of this bug. ***
Comment 5 Jeff Johnson 2002-11-16 15:10:33 EST
*** Bug 77433 has been marked as a duplicate of this bug. ***
Comment 6 Jeff Johnson 2002-11-16 15:12:08 EST

*** This bug has been marked as a duplicate of 75057 ***
Comment 7 SHwareSyst 2003-02-14 13:41:56 EST
--relocate is/was broken in rpm-4.1.  This is now fixed in rpm-4.2

Added for folks linking here from ActiveState download pages
Comment 8 ashish gandhi 2005-10-21 08:31:35 EDT
hi This is my spec file which i used to create rpm----

%define VCS ashish
                                                                               
                                  
                                                                               
                                  
Provides: /%{VCS}
Prefix: /etc%{provides}
                                                                               
                                  
                                                                               
                                  
%files
%{prefix}/conf/sample_WebSphere5/main.cf
%{prefix}/conf/sample_WebSphere5/WebSphere5Types.cf
/opt%{provides}/bin/WebSphere5/monitor
/opt%{provides}/bin/WebSphere5/WebSphere5.pm
/opt%{provides}/bin/WebSphere5/WebSphere5.xml
                                                                               
                                  
-------------------
i had problem for using multiple prefix and in relocations

in my file list i had directory structure such as follows
/etc/ashish/conf/sample_WebSphere5/main.cf
/etc/ashish/conf/sample_WebSphere5/WebSphere5Types.cf
/opt/ashish/bin/WebSphere5/monitor
/opt/ashish/bin/WebSphere5/WebSphere5.pm
/opt/ashish/bin/WebSphere5/WebSphere5.xml

so i had the problem of multiple relocations

i wanted to relocate /etc/ashish/* to /etc/gandhi/* and /opt/ashish/* to
/opt/gandhi/*.

with the rpm -install time i had problem in using multiple prefixes

so with above solution it worked well

i typed the commands as

rpm -i --relocate /opt/ashish=/opt/gandhi --relocate /etc/ashish=/etc/gandhi
<pkgname>.rpm

it worked

as wll as

rpm -i <pkgname>.rpm

worked

thankx

ashish gandhi

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