[Rpm-maint] [rpm-software-management/rpm] RFE: Support creating new sub-packages after %install execution (#1222)
notifications at github.com
Tue Nov 17 12:03:22 UTC 2020
Changed title to more generic.
As mentioned in the related PR, I think the suggested approach of parsing a single section of the spec fundamentally differently from others is neither the easiest or the best solution, both from user and implementation perspective. The mixed macros vs pseudo macros vs shell script mess of spec is difficult to follow as it is, we should be making things easier not harder.
An external file that is parsed for inclusion after `%install` execution can be created from the spec or external scripts/tooling, be it `%spec -f <foo>` or whatever in the spec syntax itself (something modeled after the familiar `%files -f foo`, see below). As that file is parsed with the same macro expansion as the spec itself, this doesn't prevent deep macro magic in any way. And as that file doesn't even exist initially there can be no confusion about when and where things are expanded etc.
We can have a new scriptlet that *executes* after %install for creating that file, but it needs to be *parsed* along the rest of the spec. That could of course be equally achieved from end of `%install` but conceptual separation from that would probably be better (just like we should have separate slots for unpacking and configuring the sources)
As for the inclusion syntax, we could add a kind of pseudo section named `%spec` which if present, marks the beginning of a spec, just like `%files` does for file section (optionally accompanied with `%end`). This might well serve some other parsing-related purposes as well, but for starters it gives us a place to add that `-f <foo>` for the subspec to be parsed after `%install`. At the beginning of a spec it would place it quite far from the place where said file gets created so there might well be better alternatives (such as allowing multiple `%spec -f` constructs throughout, or something) this is just to outline a design that fits with the rest of rpm / spec.
That sort of thing makes it possible to add new sub-packages on the fly from any old tooling, but additionally we could look at a native Lua API that could be used for adding sub-packages, running from a special Lua-specific slotf after `%install` - *not* talking about macros here.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rpm-maint