Bug 11248 - RPM 3.0.4-0.48 executes install script incorrectly
RPM 3.0.4-0.48 executes install script incorrectly
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2000-05-05 13:54 EDT by Richard Cobbe
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-05-05 14:15:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Richard Cobbe 2000-05-05 13:54:53 EDT
I'm trying to build an RPM out of the MICO orb, and my %install section
contains the following commands:

pushd $RPM_BUILD_ROOT/usr/share/mico
JAVA_CUP_DIR=dirname `locate lalr_item_set.class`
cp -a $JAVA_CUP_DIR .

The intent is to determine the location of another package, which is

Now, the actual bash script generated by RPM appears to be correct:

pushd $RPM_BUILD_ROOT/usr/share/mico
JAVA_CUP_DIR=dirname `locate lalr_item_set.class`
cp -a $JAVA_CUP_DIR .

However, when this script is actually run, it is not interpreted correctly:

+ pushd /var/tmp/mico-root/usr/share/mico
/var/tmp/mico-root/usr/share/mico /usr/src/redhat/BUILD/mico
++ locate lalr_item_set.class
+ JAVA_CUP_DIR=dirname
+ /usr/lib/java/java_cup/lalr_item_set.class
/var/tmp/rpm-tmp.25852: /usr/lib/java/java_cup/lalr_item_set.class:
Permission denied
Bad exit status from /var/tmp/rpm-tmp.25852 (%install)

It appears that rpm interprets the script as follows:

pushd $RPM_BUILD_ROOT/usr/share/mico
`locate lalr_item_set.class`
dirname # etc.
Comment 1 Jeff Johnson 2000-05-05 14:15:59 EDT
Fix your script:
	JAVA_CUP_DIR=$(dirname `locate lalr_item_set.class`)
Comment 2 Richard Cobbe 2000-05-05 15:12:59 EDT
Thanks....boy do I feel dumb....

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