Skip to content

Commit

Permalink
Add "local_generator"
Browse files Browse the repository at this point in the history
This generator can be used by .spec file, which ships their own
generators:

~~~
Source1: generator.req
%global __local_generator_requires bash %{SOURCE1}
~~~

Resolves rpm-software-management#782
  • Loading branch information
voxik committed Oct 24, 2023
1 parent c284d09 commit 4b04cc3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build/rpmfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,11 @@ static int initAttrs(rpmfc fc)

/* Discover known attributes from pathnames + initialize them */
if (rpmGlob(attrPath, NULL, &files) == 0) {
nattrs = argvCount(files);
nattrs = argvCount(files) + 1;
fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes));
for (int i = 0; i < nattrs; i++) {
char *bn = basename(files[i]);
fc->atypes[0] = rpmfcAttrNew("local_generator");
for (int i = 1; i < nattrs; i++) {
char *bn = basename(files[i - 1]);
bn[strlen(bn)-strlen(".attr")] = '\0';
fc->atypes[i] = rpmfcAttrNew(bn);
}
Expand Down

0 comments on commit 4b04cc3

Please # to comment.