Re: Share code between install-time script and trigger?

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

 



On 11/28/05, Valery Reznic <valery_reznic@xxxxxxxxx> wrote:
>
>
> --- Toralf Lund <toralf@xxxxxxxxxxxxxx> wrote:
>
> > I've often found myself in the situation where I
> > need a "triggerpostun"
> > that does excatly the same as "post"
> I face the same problem and solve it as following:
>
> - put "shared" command in the separate file
> - instead .spec file write .spec.in file and
>  write "include my_file" in appropiative places
> - use /script/awk/sed/whatsoever to process .spec.in
> into spec
>

Also, you cqn get there without processing the spec.  You can do something like:

   %{expand: %(cat $path_to_your_code)}

Just place that where ever you want the code "pasted" in.  If you
don't need macros expanded from the included file you don't need the
%{expand: ...}, and can just do:

   %(cat $path_to_your_code)

If you don't know (I know you know Valery), %() is like back ticks
(i.e. `` or $()) in shell, so it just takes the output of the command
to be run by the shell and inserts it into the specfile at that point.
 It does not evaluate any macros therein, and thus if you want that to
occur you have to do %{expand: ...}.

Cheers...james

_______________________________________________
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