Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-15 Thread Florian Festi
Merged as #2911 Thanks for the patch! -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734#issuecomment-1945539722 You are receiving this because you are subscribed to this thread. Message ID:

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-15 Thread Florian Festi
Closed #2734. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734#event-11811695188 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-14 Thread Panu Matilainen
@pmatilai commented on this pull request. > if (rpmGlob(attrPath, NULL, ) == 0) { - nattrs = argvCount(files); - fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes)); - for (int i = 0; i < nattrs; i++) { - char *bn = basename(files[i]); -

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-14 Thread Florian Festi
@ffesti pushed 1 commit. 805d83186bec6297ef35a1b0d1405aec845c069a Add %_local_file_attrs macro -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/95b89b63ab47a576e1006e512cb14935d980361e..805d83186bec6297ef35a1b0d1405aec845c069a You are receiving this because

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-14 Thread Florian Festi
@ffesti commented on this pull request. > if (rpmGlob(attrPath, NULL, ) == 0) { - nattrs = argvCount(files); - fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes)); - for (int i = 0; i < nattrs; i++) { - char *bn = basename(files[i]); -

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-14 Thread Panu Matilainen
@pmatilai commented on this pull request. > if (rpmGlob(attrPath, NULL, ) == 0) { - nattrs = argvCount(files); - fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes)); - for (int i = 0; i < nattrs; i++) { - char *bn = basename(files[i]); -

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Florian Festi
@ffesti commented on this pull request. > if (rpmGlob(attrPath, NULL, ) == 0) { - nattrs = argvCount(files); - fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes)); - for (int i = 0; i < nattrs; i++) { - char *bn = basename(files[i]); -

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Panu Matilainen
@pmatilai commented on this pull request. > if (rpmGlob(attrPath, NULL, ) == 0) { - nattrs = argvCount(files); - fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes)); - for (int i = 0; i < nattrs; i++) { - char *bn = basename(files[i]); -

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Florian Festi
OK, removed one underscore from the macro name, rewrite the init code and added two test cases that deal with already installed file attributes. -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734#issuecomment-1941456054 You are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Florian Festi
@ffesti pushed 1 commit. e1dea8eafaf3f4da91e7ba132f9e953eec3a9665 Add more test cases -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/7c64e73308a328d3aad40c118024f799503bc96f..e1dea8eafaf3f4da91e7ba132f9e953eec3a9665 You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Florian Festi
@ffesti pushed 1 commit. 7c64e73308a328d3aad40c118024f799503bc96f Local File Attrs: Remove one underscore -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/ab3a293498ec59129d3551e76e444e964b9f0985..7c64e73308a328d3aad40c118024f799503bc96f You are receiving

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Florian Festi
@ffesti pushed 1 commit. 7023620eb258af338b1e53b3806b8f66ad9384d7 Local File Attrs: Remove one underscore -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/fb9b6ec25e2e72daa7944175e64c2928104cd016..7023620eb258af338b1e53b3806b8f66ad9384d7 You are receiving

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Florian Festi
@ffesti pushed 1 commit. fb9b6ec25e2e72daa7944175e64c2928104cd016 Local File Attrs: Remove one underscore -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/5ff3074187b888f9ff62416d9495fe36f7890468..fb9b6ec25e2e72daa7944175e64c2928104cd016 You are receiving

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-13 Thread Florian Festi
> One more thing wrt the macro name: I wonder if this is a case where it should > _not_ have those leading underscores. The generator itself is full of double > underscore names, but the newly added macro here is something directly > intended for packager use in a spec. I dunno, it may even be

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Vít Ondruch
@voxik commented on this pull request. > @@ -995,6 +995,25 @@ runroot rpm -qp --requires > /build/RPMS/noarch/shebang-0.1-1.noarch.rpm|grep -v ^ []) RPMTEST_CLEANUP +AT_SETUP([Local dependency generator]) +AT_KEYWORDS([build]) +RPMTEST_CHECK([ +RPMDB_INIT + +runroot rpmbuild -bb --quiet \

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Panu Matilainen
One more thing wrt the macro name: I wonder if this is a case where it should *not* have those leading underscores. The generator itself is full of those, but the newly added macro here is something directly intended for packager use. -- Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Panu Matilainen
@pmatilai commented on this pull request. > @@ -995,6 +995,25 @@ runroot rpm -qp --requires > /build/RPMS/noarch/shebang-0.1-1.noarch.rpm|grep -v ^ []) RPMTEST_CLEANUP +AT_SETUP([Local dependency generator]) +AT_KEYWORDS([build]) +RPMTEST_CHECK([ +RPMDB_INIT + +runroot rpmbuild -bb --quiet

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Panu Matilainen
@pmatilai commented on this pull request. > - bn[strlen(bn)-strlen(".attr")] = '\0'; - fc->atypes[i] = rpmfcAttrNew(bn); + nfiles = argvCount(files); +} +char * local_attr_names = rpmExpand("%{?__local_file_attrs}", NULL); +ARGV_t local_attrs =

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Panu Matilainen
@pmatilai commented on this pull request. > - fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes)); - for (int i = 0; i < nattrs; i++) { - char *bn = basename(files[i]); - bn[strlen(bn)-strlen(".attr")] = '\0'; - fc->atypes[i] = rpmfcAttrNew(bn); +

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Panu Matilainen
@pmatilai commented on this pull request. > - bn[strlen(bn)-strlen(".attr")] = '\0'; - fc->atypes[i] = rpmfcAttrNew(bn); + nfiles = argvCount(files); +} +char * local_attr_names = rpmExpand("%{?__local_file_attrs}", NULL); +ARGV_t local_attrs =

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Florian Festi
Ok, renamed back to `__local_file_attrs`. I squashed the patches and improved the docs a little bit. From my POV this is now complete. Can someone please prove read the docs? Thanks! -- Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-06 Thread Florian Festi
@ffesti pushed 1 commit. 5ff3074187b888f9ff62416d9495fe36f7890468 Add %__local_file_attrs macro -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/57334a2b0b0ad7d84e8e398bf6c6e6a8b53d2481..5ff3074187b888f9ff62416d9495fe36f7890468 You are receiving this because

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-02-02 Thread Panu Matilainen
> This all makes `__local_file_attrs` look less horrible than I first thought Indeed. It's sufficiently vague to cover both cases we care about, and totally accurate in the sense that its local to the build. > `__additional_file_attrs` is actually kinda close but not quite as it implies >

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-31 Thread Vít Ondruch
`__embedded_file_attrs`? -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734#issuecomment-1918940894 You are receiving this because you are subscribed to this thread. Message ID: ___ Rpm-maint

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-31 Thread Florian Festi
I think the issue here that they can be both overriding existing ones or being an add-on. This makes it difficult to find a good name that covers both cases. OK, technically the macro doesn't override existing file attrs. Overriding/defining the macros does. So here we are registering file attr

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-23 Thread Vít Ondruch
`__override_file_attrs`, which would give higher prominence to the regular installed attrs and discouraged use of this feature. But that brings me back to the `__extra_file_attrs`, which I have read after I was thinking about `__override_file_attrs` ;) IOW `__extra_file_attrs` sounds good to

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-23 Thread Panu Matilainen
I find `packaged` quite misleading, because the case is to allow for attributes and generators that are local to the *build*. Those attributes *may also* be packaged, but that's not relevant for this feature. I see two separate main cases for this: - build a package with the generator it ships

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-22 Thread Vít Ondruch
`packaged` or `package`? I am asking, because the generators are not packaged yet as I perceive that. But I can live also with `packaged` :) -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734#issuecomment-1904388907 You are receiving

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-22 Thread Vít Ondruch
@voxik commented on this pull request. > @@ -132,6 +132,14 @@ Enabling the multifile mode is done by setting %__foo_protocol multifile ``` +## Using File Attributes in their own Package + +Normally file attributes and their dependency generators are shipped in separate packages that need

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-22 Thread Florian Festi
OK, I replaced the word "local" as its meaning is just too vague here. "Packaged" discourages using file attributes that are just on the machine without being shipped or being installed from another package. While this is technically possible this is something we clearly don't want to

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-22 Thread Florian Festi
@ffesti pushed 2 commits. 2468b76d5b7e4bae8c55ddabb188d0d2f4807dbf Filter duplicate file attributes 57334a2b0b0ad7d84e8e398bf6c6e6a8b53d2481 Add documentation for __packaged_file_attrs -- View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Florian Festi
OK, just to write down how the current system works: The `fileattrs/*.attr` are read in at the beginning with all other macro files. The macros in there can be over written by the spec file - or by `%load` ing the `.attr` file in the Sources. RPM goes through the list of file attrs (currently

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Florian Festi
@ffesti pushed 1 commit. 5059816af9185cc7c3f19ad729b4dc657f912cde Rename __local_file_attrs to __packaged_file_attrs -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/cd4bd81ad1c446c119a27eec77b2828b5ea1624a..5059816af9185cc7c3f19ad729b4dc657f912cde You are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Vít Ondruch
> I think the issues is reproducibility and correctness. If you fix the > dependency generator in your package you don't want to old - possibly broken > - deps still in your package, just because the old package is still on your > build system. That is actually good point. So in the Ruby

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Florian Festi
I think the issues is reproducibility and correctness. If you fix the dependency generator in your package you don't want to old - possibly broken - deps still in your package, just because the old package is still on your build system. -- Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Vít Ondruch
> I am thinking about actually shipping the dependency generator but also using > it in the package itself. This ^^ actually is my use case and here is how it looks in practice: https://src.fedoraproject.org/rpms/ruby/blob/308b2c0ab2c6268847ed3bf2008e74bce334e810/f/ruby.spec#_187-190

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Florian Festi
Hmm, I guess we are taking about two different use cases. You are thinking about a dependency generator that is in the package only and not installed ever. For that you want a unique name that won't ever clash with installed file attributes. I am thinking about actually shipping the dependency

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Vít Ondruch
On the second thought, maybe it really is the right way. I am coming from place where no "local" generator us was possible, so one was already great improvement. But maybe there are use cases for multiple generators? OTOH, one could call them via some helper script or by chaining them (in the

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Vít Ondruch
@voxik commented on this pull request. > @@ -866,6 +866,7 @@ RPMTEST_CHECK([ RPMDB_INIT runroot rpmbuild -bb --quiet \ + --define '__local_file_attrs local_generator' \ Maybe something like `totally_random_generator_name` -- Reply to this email directly or view it on

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Vít Ondruch
> OK, just hard coding one file attribute doesn't seem like a good idea. I > added a macro that allows you to register an arbitrary number of local file > attributes and generators. Nice, now we can argue if the `__local_file_attrs` is the right name or rather e.g. `__package_local_file_attrs`

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-18 Thread Vít Ondruch
@voxik commented on this pull request. > @@ -866,6 +866,7 @@ RPMTEST_CHECK([ RPMDB_INIT runroot rpmbuild -bb --quiet \ + --define '__local_file_attrs local_generator' \ While this is "just test case", maybe the `local_generator` could use different name, just to avoid the

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-17 Thread Florian Festi
OK, just hard coding one file attribute doesn't seem like a good idea. I added a macro that allows you to register an arbitrary number of local file attributes and generators. I am still wondering if we need a mechanism to avoid executing generators twice when the package is already installed

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2024-01-17 Thread Florian Festi
@ffesti pushed 1 commit. cd4bd81ad1c446c119a27eec77b2828b5ea1624a Add %__local_file_attrs macro -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/61bd40a9df5170da6182e560d172fb16f4e3213b..cd4bd81ad1c446c119a27eec77b2828b5ea1624a You are receiving this because

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-27 Thread Vít Ondruch
> If `local_generator.attr` file exists then `local_generator` created twice. This is good point. Not sure if this is real problem though. > Why not simply create an empty `local_generator.attr` file instead? I have proposed this earlier in

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-26 Thread Panu Matilainen
I'd prefer a name that indicates the spec/package specifity somehow. @ffesti , @dmnks , thoughts, other ideas? And yeah adding that empty file with just a comment on the purpose would actually be even more simple. -- Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Mikolaj Izdebski
If `local_generator.attr` file exists then `local_generator` created twice. Why not simply create an empty `local_generator.attr` file instead? -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734#issuecomment-1779258988 You are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Vít Ondruch
@voxik commented on this pull request. > char *bn = basename(files[i]); bn[strlen(bn)-strlen(".attr")] = '\0'; fc->atypes[i] = rpmfcAttrNew(bn); } + fc->atypes[nattrs - 1] = rpmfcAttrNew("local_generator"); The `nfiles` could be used here

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Vít Ondruch
> I have to say, there's beauty to the simplicity of this. Would be even > simpler if the new generator was added as the last thing to the array I think. Done. On top of that, I have added also some test case. The other generator abuses `script.attr` AFAICT. Or shell the other test cases be

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Vít Ondruch
@voxik pushed 1 commit. 61bd40a9df5170da6182e560d172fb16f4e3213b Add "local_generator" -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/8a532b24e527f48cc45f7f49fc24d6fc4be39d49..61bd40a9df5170da6182e560d172fb16f4e3213b You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Vít Ondruch
@voxik pushed 1 commit. 8a532b24e527f48cc45f7f49fc24d6fc4be39d49 Add "local_generator" -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/33c10c89387b168bceaa93ee2be7c6210a90aa2e..8a532b24e527f48cc45f7f49fc24d6fc4be39d49 You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Vít Ondruch
@voxik pushed 1 commit. 33c10c89387b168bceaa93ee2be7c6210a90aa2e Add "local_generator" -- View it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734/files/4b04cc38167dd637c3c1f68bf6d858453ccf24a1..33c10c89387b168bceaa93ee2be7c6210a90aa2e You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Panu Matilainen
Hmm, but just "package" kinda gives the idea that these are the only dependencies this package will have, which is not the case. "package_local" maybe? -- Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/2734#issuecomment-1778645654 You are

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-25 Thread Panu Matilainen
The name should imply this is a per-spec thing, so I don't think "find" is good. "local" is much better, but in rpm context I tend to associate that with "this host" rather than per package. "spec" seems accurate, because it is a per-spec thing. But then that makes me think of dependencies of

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-24 Thread Vít Ondruch
> > Subject to name-bikeshedding of course. "local_generator" is not a bad for > > what it is, but my head keeps coming up with spec_somethings instead (and > > then rejecting)  > > This is the hardest think, right :( And that is why I have also considered the `find` name, which was already

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-24 Thread Vít Ondruch
> I have to say, there's beauty to the simplicity of this. Would be even > simpler if the new generator was added as the last thing to the array I think. That is an option. Will look at it tomorrow > Subject to name-bikeshedding of course. "local_generator" is not a bad for > what it is, but

Re: [Rpm-maint] [rpm-software-management/rpm] Add "local_generator" (PR #2734)

2023-10-24 Thread Panu Matilainen
I have to say, there's beauty to the simplicity of this. Would be even simpler if the new generator was added as the last thing to the array I think. Subject to name-bikeshedding of course. "local_generator" is not a bad for what it is, but my head keeps coming up with spec_somethings instead