current directory during rpm post install phase

Gianluca Cecchi gianluca.cecchi at gmail.com
Fri Jun 20 11:15:53 UTC 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20080620/b9039569/attachment-0001.htm>


More information about the fedora-list mailing list