current directory during rpm post install phase



I'm trying to install an rpm that has a post-install action.
During this phase I notice with ps that a temporary script named
/var/tmp/rpm-tmp.67318 is created and executed.
And its contents are the same as what stored inside the rpm (query done with
rpm -qp --scripts package.rpm)
Inside the postinstall script there is a call to another script
(something.sh).
In this latest script there is a test such as :

if [ -f $file ]; then
cp -vf $file /some/dir
if [ $? -eq 0 ]; then
echo "$file copied sucessfully!!!"
fi
else
.....
fi

I want the script to find the $file so that it skips the "else" section.

$file is a filename without any path or prefix.

I have no source rpm.

So the question is: supposed that in /var/tmp/rpm-tmp.67318 and in
something.sh there isn't any CD command, in which dir would happen the check
about the presence of $file?
it seems that if I place the file in the same directory where I run the "rpm
-ivh package.rpm" command doesn't work...

Thanks in advance.
Gianluca
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

Relevant Pages

  • Re: rpm check script problem
    ... Part of the script involves using file descriptors. ... come from $filename, you should have said ... The next read statment is reading from channel 0 so it reads the first ... line of $filename and puts it into the variable rpm. ...
    (Fedora)
  • [opensuse] BASH script help needed - Why is full path required?
    ... the full path name for rpm to be able to install the file, ... script is executed in the same directory as the file. ... I have underlined the rpm ... file as a command line option or make sure it is in the present working ...
    (SuSE)
  • Re: [SLE] repost: Just installed apt4rpm on SuSE 8.2 and having problems
    ... I made a script that can easily test the rpm update (it actually performs "rpm ... Tired of knowing which apt command does what and tired of the special argument ... The script will hide commands like: ...
    (SuSE)
  • Re: Running a Script- and debugging.
    ... $0 is usually the name of the script itself, so 'dirname $0' is the ... bash or csh script or something else. ... change log for the bash rpm and read the bug reports. ...
    (Fedora)
  • Re: Running a Script- and debugging.
    ... $0 is usually the name of the script itself, so 'dirname $0' is the ... bash or csh script or something else. ... change log for the bash rpm and read the bug reports. ...
    (Fedora)