Re: Running the same code for 2 subpackages

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

 



On March 21, 2007 3:22:25 PM +0200 Erez Zilber <erezz@xxxxxxxxxxxx> wrote:
Hi,

I have a spec file that generates 2 subpackages (using the %package
directive). For both subpackages, I want to run the same code in the
%post section. Do I need to duplicate my code?

Yes.

Or can I put a function call anywhere and call it from the %post section?

No, because each scriptlet is independent.  You can have a file in the
rpm which contains the function, and have the scriptlet call that.  Or
you can have that file be the entire function, and just use it as the
interpreter (%post -n package -p file_with_scriptlet_function).  Or,
create a macro and include that macro in your scriptlet.

%define fn\
foo() {\
do_something\
}\
%nil

%post -n pkg
%fn

The syntax above may not be 100% correct, but you get the idea.

-frank

_______________________________________________
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