[Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)
Panu Matilainen
notifications at github.com
Thu Feb 6 11:05:39 UTC 2020
pmatilai commented on this pull request.
> @@ -514,6 +514,22 @@ static ARGV_t runCmd(const char *cmd,
return output;
}
+static ARGV_t runCall(const char *cmd,
+ const char *buildRoot, const char *fn)
+{
+
+ ARGV_t output = NULL;
+ char *fullcmd = rstrscat(NULL, "%{", cmd, " ", "%{?buildroot:buildroot/}", fn, "}", NULL);
Hmm, annoying but true. One simple way around this would be passing the argument via a separately defined macro, eg
```
char *path = rstrscat(NULL, buildRoot ? buildRoot : "", "/", fn, NULL);
rpmPushMacro(NULL, "filename", NULL, path, 0);
char *exp = rpmExpand("%{", cmd, "}", NULL);
rpmPopMacro(NULL, "filename");
...
```
...and then use %{filename} instead of %{1} in the macro, but that's not very elegant. Maybe there should be a rpmPushMacroArg() or such to get around this in a generic way.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1053#discussion_r375771770
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200206/e5e1972d/attachment.html>
More information about the Rpm-maint
mailing list