FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 06-20-2008, 11:15 AM
"Gianluca Cecchi"
 
Default 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@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 06-20-2008, 01:52 PM
"Patrick O'Callaghan"
 
Default current directory during rpm post install phase

On Fri, 2008-06-20 at 13:15 +0200, Gianluca Cecchi wrote:
> 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?

In the rpm process' current directory.

> it seems that if I place the file in the same directory where I run
> the "rpm -ivh package.rpm" command doesn't work...

Very likely rpm changes to a working directory when it starts up. You
could either look at the source of rpm, or run it under 'ltrace' and
look for calls to 'chdir'.

poc

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

Thread Tools




All times are GMT. The time now is 12:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org