Re: [Rpm-maint] [rpm-software-management/rpm] PVS-Studio Analysis Results for RPM (#1052)

2020-02-06 Thread Panu Matilainen
There's some truly useless stuff in there, such as a "high" warning on "The '_RPMUTIL_H' include guard is already defined in the 'rpmutil.h' header. The 'rpmutil.h' header will be excluded from compilation." ... on the rpmutil.h file itself :roll_eyes: However among that cruft there clearly

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Igor Gnatenko
Do you have some example how this could be used? -- 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#issuecomment-582803014___

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
Just noticed this isn't working when called from rpmdeps, need to sort that out. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] PVS-Studio Analysis Results for RPM (#1052)

2020-02-06 Thread Florian Festi
> There's some truly useless stuff in there, such as a "high" warning on "The > '_RPMUTIL_H' include guard is already defined in the 'rpmutil.h' header. The > 'rpmutil.h' header will be excluded from compilation." ... on the rpmutil.h > file itself roll_eyes It may be picking up the copy in

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -1784,6 +1784,29 @@ rpmDefineMacro(rpmMacroContext mc, const char * macro, > int level) return rc; } +int rpmMacroIsDefined(rpmMacroContext mc, const char *n) +{ +int defined = 0; +if ((mc = rpmmctxAcquire(mc)) != NULL) { + if

[Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
In some cases generators are remarkably simple, such as just echoing back the basename of the file in some namespace such as foo(lib.so), and forking out a shell to perform such a mundane task is both hideously slow and plain dumb, when we have quite some string processing facilities and even a

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Florian Festi
This deserves both some documentation and a test case. Ok, documentation can go into https://rpm.org/user_doc/dependency_generators.html as soon as this is upstream/released. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on

[Rpm-maint] [rpm-software-management/rpm] Fixup few issues found by PVS (#1054)

2020-02-06 Thread Igor Gnatenko
build/files.c: * Expression rc == 0 is always true. * The path variable is assigned but is not used by the end of the function. build/parsePreamble.c: * The argv variable is assigned but is not used by the end of the function. tools/rpmgraph.c: * The argv variable is assigned but is not used

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
Testcase added. -- 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#issuecomment-582828428___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Michael Schroeder
mlschroe 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,

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
pmatilai commented on this pull request. > @@ -1784,6 +1784,29 @@ rpmDefineMacro(rpmMacroContext mc, const char * macro, > int level) return rc; } +int rpmMacroIsDefined(rpmMacroContext mc, const char *n) +{ +int defined = 0; +if ((mc = rpmmctxAcquire(mc)) != NULL) { + if

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
For an example, take a look at kmod.prov (which is actually what inspired this whole thing): the core of it boils down to echoing the basename of the filename back, stripped of suffix. For each, it spawns a shell and runs external utilities. When you consider that the kernel has (tens of)

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
@pmatilai pushed 1 commit. a3614643b55eaeabe28c1f23822602994d9d9582 Add support for macro-only dependency generators -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] PVS-Studio Analysis Results for RPM (#1052)

2020-02-06 Thread Florian Festi
OK, as everyone is just browsing the list... If you see something that you think needs fixing or thorough investigation or you want to take on yourself please state so here in a comment. I'll take on the following myself: -

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
@pmatilai pushed 1 commit. 4bca4dc8908e34c7d12b8378bda436210def4f0b Add support for macro-only dependency generators -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
Fixed rpmdeps case where buildroot is not defined. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

[Rpm-maint] [rpm-software-management/rpm] The escape mechanism in macro expansion only works for %% (#1055)

2020-02-06 Thread Michael Schroeder
I think this should print `hel%loo`: ``` rpm --define 'foo() %1' --define 'loo what' --define 'bar hel%(echo %)loo' --eval '%{foo %bar}' ``` IMHO we should rip out mb->escape and instead double all '%' characters in the argv. -- You are receiving this because you are subscribed to this thread.

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
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,

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
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,

[Rpm-maint] [rpm-software-management/rpm] 4.15.1 creates unreproducible rpm DEPENDSDICT (#1056)

2020-02-06 Thread Bernhard M. Wiedemann
While working on reproducible builds for openSUSE, I found that our poco package build had variations in the resulting `poco-devel` rpms in the `DEPENDSDICT` header. Likely from build/rpmfc.c rpmfcGenerateDepends function. Steps To Reproduce: ```bash osc co openSUSE:Factory/poco && cd $_ osc

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
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,

Re: [Rpm-maint] [rpm-software-management/rpm] Fixup few issues found by PVS (#1054)

2020-02-06 Thread Panu Matilainen
Closed #1054. -- 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/1054#event-3013596466___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Fixup few issues found by PVS (#1054)

2020-02-06 Thread Panu Matilainen
Um, thanks but no thanks. The code is not *wrong* in any of these cases, so these are not actually fixing anything at all. PVS chatters a lot about things that are considered rpm coding style (such as setting pointers to NULL on free), and we're *not* going through major plastic surgery every

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Michael Schroeder
mlschroe 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,

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
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,

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for macro-only dependency generators (#1053)

2020-02-06 Thread Panu Matilainen
@pmatilai pushed 1 commit. 53fa6af7a59e307eee0468ad5a94e45906ea2b2f Add support for macro-only dependency generators -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] PVS-Studio Analysis Results for RPM (#1052)

2020-02-06 Thread Alexander Stefanov
@ignatenkobrain i know nothing about CI builds with PVS but i can do regular rpm builds from git for you on OpenMandriva infrastructure if you need. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

[Rpm-maint] [rpm-software-management/rpm] Signature sorting is buggy, has side-effects (#1057)

2020-02-06 Thread Panu Matilainen
Spotted by PVS-Studio scan in #1052: http://repoclosure.openmandriva.org/fullhtml/sources/rpmvs.c_42.html#ln425 The obvious fix breaks three testcases, one of which is expected for DSA <-> RSA sort order, but in tests 287 and 292 this turns a NOKEY failure into a "no signature" failure, which

[Rpm-maint] [rpm-software-management/rpm] Double the '%' chars when splitting macro args (#1058)

2020-02-06 Thread Michael Schroeder
Before this commit, there was an escape flag that made the macro expansion keep %% escapes. But this did not work for macros that returned an % character by other means. Remove the old escape mechanism and instead double the % characters when the body is split into argument. Fixes: #1055 You can

Re: [Rpm-maint] [rpm-software-management/rpm] Double the '%' chars when splitting macro args (#1058)

2020-02-06 Thread Panu Matilainen
Merged #1058 into master. -- 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/1058#event-3013987494___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] The escape mechanism in macro expansion only works for %% (#1055)

2020-02-06 Thread Panu Matilainen
Closed #1055 via #1058. -- 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/issues/1055#event-3013987502___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Double the '%' chars when splitting macro args (#1058)

2020-02-06 Thread Panu Matilainen
Oh and thanks for the patch. -- 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/1058#issuecomment-582918173___ Rpm-maint mailing

[Rpm-maint] [rpm-software-management/rpm] Fix pointer dereference before testing for NULL in rpmtdGetNumber() (#1059)

2020-02-06 Thread Panu Matilainen
You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1059 -- Commit Summary -- * Fix pointer dereference before testing for NULL in rpmtdGetNumber() -- File Changes -- M lib/rpmtd.c (6) -- Patch Links --

Re: [Rpm-maint] [rpm-software-management/rpm] Double the '%' chars when splitting macro args (#1058)

2020-02-06 Thread Panu Matilainen
pmatilai approved this pull request. I wont claim to have actually thought this through, when clearly you have. This is less code, what's not to like. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Fix pointer dereference before testing for NULL in rpmtdGetNumber() (#1059)

2020-02-06 Thread Florian Festi
Merged #1059 into master. -- 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/1059#event-3014107091___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --restore/--setperms/ --setugids/--setcaps should ignore ghost files by default (#591)

2020-02-06 Thread Orion Poplawski
Also, the files may not exist: ``` $ rpm --setperms ipa-server-common-4.6.5-11.sl7_7.4.noarch chmod: cannot access ‘/etc/httpd/conf.d/ipa-pki-proxy.conf’: No such file or directory chmod: cannot access ‘/etc/systemd/system/httpd.d/ipa.conf’: No such file or directory chmod: cannot access

Re: [Rpm-maint] [rpm-software-management/rpm] Process scriplets by dependency generators (#1033)

2020-02-06 Thread mikhailnov
> They do nothing as far as I know. I'm pretty sure those are just stubs. Thay seems to work, `build/build.c`. For me it is not very clear what code like `(void) fputs(buildPost, fp);` does. And I see that `doScript()` does create temporary files with scriptlets (`rpmMkTempFile()`). That is

Re: [Rpm-maint] [rpm-software-management/rpm] Process scriplets by dependency generators (#1033)

2020-02-06 Thread mikhailnov
ALT's rpm-build does have this feature. I am unsecsessfully trying to find where and how they do it. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Process scriplets by dependency generators (#1033)

2020-02-06 Thread mikhailnov
Ok, another hack is possible. I can make a macro ` %__scriptlets_directory`, create that directory inside the buildroot and copy scriptlets there. Then process them with a dependency generator. But, according to docs https://rpm.org/user_doc/dependency_generators.html , a generator cannot make

Re: [Rpm-maint] [rpm-software-management/rpm] Process scriplets by dependency generators (#1033)

2020-02-06 Thread mikhailnov
`rpmMkTempFile()` stores scriptlets in `%_tmppath` (`/var/tmp`), I have made a dependency generator which runs `ls /var/tmp`, it showed that there are no files with scriptlets in %_tmppath at that stage :-( I thought to process them via a generator as a hack. -- You are receiving this because