[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: when using --prefix tag



The script chunk and the shell variable (from what I understand) will work in all four major script types, pre, post, preun and postun. (I could be wrong about the preun and postun.. you'd have to try that.)

So if I understand things right, you would modify the sourceable script in a %post to match the --prefix. Then it's the users responsiblity to source that script at "run time".

--Mark


Phil Conan wrote:



From: Mark Hatle <fray@mvista.com>
Reply-To: rpm-list@redhat.com
To: rpm-list@redhat.com
Subject: Re: when using --prefix tag
Date: Thu, 28 Aug 2003 11:26:32 -0500

Phil Conan wrote:

Hello.

is there any way to determine whether a user has used the --prefix tag.
What I want to do is sed a file with the prefix information if the user
choses to relocate the package.

this is using redhat 7.3 and rpm 4.0.4

thanks,
Phil


Are you refering to in a post (pre) install script? Or after the user has installed?


I have a script which needs to be sourced, by the user, once the rpm is installed.
I need to edit that script depending on where the user installs the rpm. The scriplet you`ve included should work although i would have to include it in pre, no?



If you are refering to a post install script, this little scriptlet might be what you need:


if [ "${RPM_INSTALL_PREFIX}" = "%{prefix}" ] ; then
  # User has not use --prefix
else
  # User has used prefix
fi

(or you can just always use RPM_INSTALL_PREFIX if you are doing something like setting up configuration files.)

--Mark


_______________________________________________ Rpm-list mailing list Rpm-list@redhat.com https://www.redhat.com/mailman/listinfo/rpm-list


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



_______________________________________________ Rpm-list mailing list Rpm-list@redhat.com https://www.redhat.com/mailman/listinfo/rpm-list








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []