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

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

 




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)}

Or just

Source1: my-shared-script
%include %{SOURCE1}

Ah. Right. I never realised there was an %include for spec files. I really ought to have thought of testing if perhaps something like this was supported, though. I did know about expand and %(...), but didn't think of the above variant, either. I guess my imagination is failing me...

Thanks.

- Toralf


_______________________________________________
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