Re: %post helper scripts

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

 



On Tue, 2005-11-29 at 11:36 +0100, Mattias Brändström wrote:
> Hello,
> 
> I have a question regarding the %post script (this probably relates to 
> other scripts as well).

See the previous thread - "Share code between install-time script and
trigger?".

> The above tasks translates into a bit long %post script. I would like to 
> split these tasks out of the spec file to make it a bit more clear and 
> easier to read and just call a helper script from %post:
> 
> %post
> if [ "$1" = "1" ]; then
>    post-install.sh
> fi

You have two options here - one would be to ship the script in %files
and call it in %post with a path - eg /usr/share/mypkg/setupdb.sh

Secondly add the script fragment as a Source with a sufficiently unique
name

Source1: mypkg-0.1.2-post-install

%post
if [ "$1" = "1" ]; then
%include %{SOURCE1}
fi

Personally I'd just include it in the file manifest in this case as
administrators may want to recreate the initial setup without
re-install/run an rpm query.

Paul


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

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux