Bug 91979 - $RPM_INSTALL_PREFIX broken still/again?
$RPM_INSTALL_PREFIX broken still/again?
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-30 11:22 EDT by Robert Flemming
Modified: 2007-04-18 12:54 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-27 11:49:34 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)

  None (edit)
Description Robert Flemming 2003-05-30 11:22:37 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)

Description of problem:
I see this problem mentioned with regards to RH8 and rpm < 4.2, but I
seem to be seeing the same problem on RH9 with rpm-4.2-0.69.  Here is a
sample spec file:

Summary:        Test package
Name:           test-package
Version:        1.0
Release:        1
Group:          System Environment/Daemons
License:        GPL
BuildRoot:      %{_builddir}/%name-%version
BuildArch:      noarch
Prefix:         /usr/local

%description
This is a test package

%pre
echo "pre - RPM_INSTALL_PREFIX = \"$RPM_INSTALL_PREFIX\""

%install

%post
echo "post - RPM_INSTALL_PREFIX = \"$RPM_INSTALL_PREFIX\"";

%files

%changelog
* Thu May 29 2003 Robert Flemming <flemming@spiralout.net>
- Test package

Here are the results when install it on my RH9 system:

foo:/tmp# rpm -ivh test-package-1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
pre - RPM_INSTALL_PREFIX = ""
   1:test-package           ########################################### [100%]
post - RPM_INSTALL_PREFIX = ""

foo:/tmp# rpm -ivh --prefix=/tmp test-package-1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
pre - RPM_INSTALL_PREFIX = ""
   1:test-package           ########################################### [100%]
post - RPM_INSTALL_PREFIX = ""

Now here is the same package being installed on a 7.2 machine with
rpm-4.0.3-1.03 installed:

[root@bar tmp]# rpm -ivh test-package-1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
pre - RPM_INSTALL_PREFIX = "/usr/local"
post - RPM_INSTALL_PREFIX = "/usr/local"

[root@bar tmp]# rpm -ivh --prefix=/tmp test-package-1.0-1.noarch.rpm
Preparing...                ########################################### [100%]
pre - RPM_INSTALL_PREFIX = "/tmp"
post - RPM_INSTALL_PREFIX = "/tmp"

With $RPM_INSTALL_PREFIX returning nothing, all scripts are performing operations on the root file system, which is VERY bad in the context of the package I'm building.  I've added a test in the pre section so I don't hose my test machine (again), but this is kind of a important problem.

Robert


Version-Release number of selected component (if applicable):
rpm-4.2-0.69

How reproducible:
Always

Steps to Reproduce:
1. Use the included test-package spec file
2.
3.


Actual Results:  See above

Expected Results:  See what happens on RH 7.2 system as noted above

Additional info:
Comment 1 Jeff Johnson 2003-12-27 11:49:34 EST
Yup, RPM_INSTALL_PREFIX is not set in rpm-4.2.2 if there are no
files in the package. Add files, you will see RPM_INSTALL_PREFIX
set (verified with rpm-4.2.2, but I believe true all the way back
to rpm-4.2).

I do not think that not specifying a scriptlet envvar for a
package that has no files that need relocating is a problem
worth solving.

Reopen this bug if you wish to argue.

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