[Rpm-maint] [rpm-software-management/rpm] RFE: store a copy of files maked as config in /usr/lib/rpm/config (#1178)

2020-04-14 Thread Michael Schroeder
If a file is marked as config file, rpmbuild could automatically create a copy and store it in `/usr/lib/rpm/config/first-digest-byte/file-digest`. We can then make use of this to: - allow to display the changes done by the user - use a three-way merge algorithm - handle digest algorithm changes

Re: [Rpm-maint] [rpm-software-management/rpm] Handle manually specified debuginfo package more gracefully (#1177)

2020-04-14 Thread Michael Schroeder
@mlschroe approved this pull request. -- 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/1177#pullrequestreview-392794740___

Re: [Rpm-maint] [rpm-software-management/rpm] Fix regression causing all ELF files classified as OCaml (#1174)

2020-04-09 Thread Michael Schroeder
@mlschroe approved this pull request. -- 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/1174#pullrequestreview-390727170___

Re: [Rpm-maint] [rpm-software-management/rpm] Ocaml dependency generators running on all ELF files (#1173)

2020-04-09 Thread Michael Schroeder
Of course rpm can do that, you need to put "magic_and_path" in the flags. ``` %__ocaml_flags magic_and_path ``` -- 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] Discussion: spec tag order and side-effects (#1161)

2020-04-08 Thread Michael Schroeder
There is no "new evaluate on declaration thing". Rpm always evaluates macros when it parses lines. How do you think macros like ``` %perl_req Requires: perl = %{perl_version} ``` work? You can also do something like this: ``` %define p0 Patch0: patch.diff %p0 ``` There is no way to get rid of

[Rpm-maint] [rpm-software-management/rpm] Support DSA2 in digest_libgcrypt.c (#1168)

2020-04-08 Thread Michael Schroeder
For DSA2 we need to truncate the hash to the size of the pubkeys Q value. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1168 -- Commit Summary -- * Support DSA2 in digest_libgcrypt.c -- File Changes -- M

Re: [Rpm-maint] [rpm-software-management/rpm] Discussion: spec tag order and side-effects (#1161)

2020-04-07 Thread Michael Schroeder
Btw, what the commit changed was that the Source/Patch arguments are no longer expanded *twice*. They used to be macro expanded when the tag was parsed and then expanded again when the files were used. This issue is not a tag ordering issue at all. -- You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Discussion: spec tag order and side-effects (#1161)

2020-04-07 Thread Michael Schroeder
My 2 cents: I don't see what macro expansion has to do with the free order of spec tags. It's should not surprise anybody that using %name does not work before the "Name:" tag is given. And how is the following different? ``` Patch0: %{foo} %define foo bar.diff ``` This has nothing to

Re: [Rpm-maint] [rpm-software-management/rpm] Sqlite backend's prefix match cannot deal with '%' characters (#1018)

2020-03-24 Thread Michael Schroeder
I learned a bit more about sqlite in another project. Turns out that using a custom match function is much slower than the LIKE version, because of sqlite's LIKE optimization: https://www.sqlite.org/optoverview.html#the_like_optimization So I think we should go back to use LIKE and escape the %

Re: [Rpm-maint] [rpm-software-management/rpm] Sqlite backend's prefix match cannot deal with '%' characters (#1018)

2020-03-24 Thread Michael Schroeder
Reopened #1018. -- 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/1018#event-3159073617___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: add database change notification API (#1124)

2020-03-24 Thread Michael Schroeder
A linux specific way would be to offer some functions around inotify(). We can also try something more generic: We could create a named pipe in /var/lib/rpm. At the start of the transaction we open the pipe O_WRONLY, at the end we simply close the fd. Some other process that wants to be

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: add database change notification API (#1124)

2020-03-19 Thread Michael Schroeder
I don't think sqlite notification hooks work for different processes. -- 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] Always open (and initialize) the entire database at once (#1119)

2020-03-17 Thread Michael Schroeder
Sorry, I haven't had time to have a closer look at this. Things are a bit chaotic here at SUSE with everything being locked down because of the corona virus. But from my glancing over the changes everything looked fine. -- You are receiving this because you are subscribed to this thread.

Re: [Rpm-maint] [rpm-software-management/rpm] Make "rpmspec -q --srpm foo.spec" say .src, not .%{arch} (#1116)

2020-03-12 Thread Michael Schroeder
What about nosrc packages? -- 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/1116#issuecomment-598149647___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] %force file list directive (#1118)

2020-03-12 Thread Michael Schroeder
It's not so easy, it needs some changes in rpm's aliasing detection code (i.e. symlinked directories) so that the rpm internals know what's going on. I'm already working on this, but the development has been stalled the last weeks due to other work needing to be done first. -- You are

Re: [Rpm-maint] [rpm-software-management/rpm] Fix prefix match searches on strings containing % on sqlite backend (#1085)

2020-02-27 Thread Michael Schroeder
mlschroe approved this pull request. -- 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/1085#pullrequestreview-365581861___

Re: [Rpm-maint] [rpm-software-management/rpm] Add a --salvagedb option to the rpmdb tool (#1042)

2020-02-26 Thread Michael Schroeder
Oh, I'm sorry. I forgot about that commit message change you requested. -- 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 prefix match searches on strings containing % on sqlite backend (#1085)

2020-02-26 Thread Michael Schroeder
Or: `SUBSTR(key,1,LENGTH('%q')) = '%q'` But it's also a bit unsafe to assume that `strlen(key) == keylen`. (OTOH the prefix iterator is currently not exposed and for rpm's usage the length matches). -- You are receiving this because you are subscribed to this thread. Reply to this email

Re: [Rpm-maint] [rpm-software-management/rpm] Fix prefix match searches on strings containing % on sqlite backend (#1085)

2020-02-26 Thread Michael Schroeder
You could use `INSTR(key, '%q') = 1` but that may be a too slow. -- 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 prefix match searches on strings containing % on sqlite backend (#1085)

2020-02-26 Thread Michael Schroeder
Do we still need that length comparison then? Also, the sqlite documentation says that for text string the length is UTF8 characters, not bytes. So this might not work correctly for non-ASCII. Oh, that's also true for the LENGTH function, it returns characters not bytes. I.e. the original code

Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-25 Thread Michael Schroeder
I must admit I liked the old implementation better as it didn't do the lua setup if it is not needed by some lua macro. I.e. it had a more lazy approach. -- 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] Speed up dependency solving by using pool ids (#1081)

2020-02-21 Thread Michael Schroeder
@mlschroe pushed 1 commit. 4c43d263ee1e01b5f3a9822e8bc24aff17cc0461 Use the transaction set as argument in rpmalCreate() -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Speed up dependency solving by using pool ids (#1081)

2020-02-21 Thread Michael Schroeder
@mlschroe pushed 1 commit. d9ffe24cd45a16a9c2ea258d40fbf2e967760d2c Use the transaction set as argument in rpmalCreate() -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Add ability to calculate filedigests using Streebog-256 and Streebog-… (#1082)

2020-02-21 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -266,6 +266,8 @@ typedef enum pgpHashAlgo_e { PGPHASHALGO_SHA384 = 9, /*!< SHA384 */ PGPHASHALGO_SHA512 = 10, /*!< SHA512 */ PGPHASHALGO_SHA224 = 11, /*!< SHA224 */ +PGPHASHALGO_GOST12_256 = 100,

Re: [Rpm-maint] [rpm-software-management/rpm] Add ability to calculate filedigests using Streebog-256 and Streebog-… (#1082)

2020-02-21 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -266,6 +266,8 @@ typedef enum pgpHashAlgo_e { PGPHASHALGO_SHA384 = 9, /*!< SHA384 */ PGPHASHALGO_SHA512 = 10, /*!< SHA512 */ PGPHASHALGO_SHA224 = 11, /*!< SHA224 */ +PGPHASHALGO_GOST12_256 = 100,

Re: [Rpm-maint] [rpm-software-management/rpm] Add ability to calculate filedigests using Streebog-256 and Streebog-… (#1082)

2020-02-21 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -266,6 +266,8 @@ typedef enum pgpHashAlgo_e { PGPHASHALGO_SHA384 = 9, /*!< SHA384 */ PGPHASHALGO_SHA512 = 10, /*!< SHA512 */ PGPHASHALGO_SHA224 = 11, /*!< SHA224 */ +PGPHASHALGO_GOST12_256 = 100,

[Rpm-maint] [rpm-software-management/rpm] Speed up dependency solving by using pool ids (#1081)

2020-02-20 Thread Michael Schroeder
This gets rid of a couple of id-str-id roundtrips and also makes the dependency hashes in rpmtsCheck() use pool ids instead of strings. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1081 -- Commit Summary -- * Add

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
@mlschroe pushed 1 commit. 4db183db61ca56d035712ca752234aa7c8e8b097 Only look at symlinks in new packages in fpLookupSubdir -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
@mlschroe pushed 1 commit. fe90d1990af3809b9f1174bbf77e458435154328 Only look at symlinks in new packages in fpLookupSubdir -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
@mlschroe pushed 1 commit. 841134ef4697842f1fb3ef4bb2f3993deb8f2a5c Only look at symlinks in new packages in fpLookupSubdir -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
Oh yes, we'll need to do the rpmfilesFpLookup() call for TR_REMOVED packages. Fixing... -- 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] Implement %{macrobody:...} built-in for retrieving the literal macro body (#1064)

2020-02-19 Thread Michael Schroeder
As it now expands the argument I think it should be handled in doFoo(). -- 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] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -109,6 +121,27 @@ static char *getMntPoint(const char *dirName, dev_t dev) return res; } +static int getRotational(const char *dirName, dev_t dev) +{ +int rotational = 1;/* Be a good pessimist, assume the worst */ +#if

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
@mlschroe pushed 1 commit. 954c491165cacf9156d2e4b0f3afaaaef9c3d529 Only look at symlinks in new packages in fpLookupSubdir -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
mlschroe commented on this pull request. > pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, 0)) != NULL) { fingerPrint *fpList; (void) rpmsqPoll(); + if (rpmteType(p) == TR_REMOVED) + continue; /* we are only interested in new packages */

Re: [Rpm-maint] [rpm-software-management/rpm] Auto-enable optimizations for non-rotational disks on Linux (#949)

2020-02-19 Thread Michael Schroeder
mlschroe commented on this pull request. > @@ -109,6 +121,27 @@ static char *getMntPoint(const char *dirName, dev_t dev) return res; } +static int getRotational(const char *dirName, dev_t dev) +{ +int rotational = 1;/* Be a good pessimist, assume the worst */ +#if

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
I've added a commit that makes the code only consider symlinks. Florian, any objections to this? -- 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] More fpLookupSubdir cleanups (#1071)

2020-02-19 Thread Michael Schroeder
@mlschroe pushed 1 commit. 1732cc787d6f508019edc7c455aa02d9b9ad78e6 Only look at symlinks in new packages in fpLookupSubdir -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-18 Thread Michael Schroeder
I didn't plan to push more commits, but now that you ask: Does it really make sense to have the symlinks of already installed packages in the `symlinks` hash? If a symlink is deleted on disk, the code will ignore it anyway (see the "Ignore already removed (by eg %pretrans) links" comment). If

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-17 Thread Michael Schroeder
Regarding your b81b4a35240f16fa8b45156b0151fab9e130a8e8 commit: fpLookupSubdir's slash handling is still somewhat broken, it tends to duplicate slashes when creating the link. The fingerprint lookup fortunately calls rpmCleanPath() with gets rid of the extra slashes again. BTW, why do the

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-17 Thread Michael Schroeder
Ok, that's what I thought. But it's somewhat brittle, that example from the mail will not work if FOO-DOC is installed before FOO as then /usr/share/FOO-1 will get created as directory and the install of FOO will fail with a RPMERR_EXIST_AS_DIR error. (I'm trying to make dir -> symlink-to-dir

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-14 Thread Michael Schroeder
Ok, I have to admit I'm not entirely sure what fpLookupSubdir is trying to fix. It was added by Florian in commits c6ccc90d7fef0f1b65e4bf5b77d5b800d4b53ffd and af3464a053ecb0b56cc5af494ea22955fb350757, unfortunately without a reference to some bug. It seems to be about having a symlink in one

Re: [Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-14 Thread Michael Schroeder
@mlschroe pushed 1 commit. 1c9343142a728dce571ee0c8ce4f6fae42354588 Reduce the number of calls to fpLookupSubdir() -- You are receiving this because you are subscribed to this thread. View it on GitHub:

[Rpm-maint] [rpm-software-management/rpm] More fpLookupSubdir cleanups (#1071)

2020-02-14 Thread Michael Schroeder
This reduces the number of calls to fpLookupSubdir() and also gets rid of a poolid-str-poolid roundtrip. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1071 -- Commit Summary -- * fpLookupSubdir: get rid of a

Re: [Rpm-maint] [rpm-software-management/rpm] Cleanup fingerprint cache creation (#1068)

2020-02-14 Thread Michael Schroeder
@mlschroe pushed 1 commit. 3252e1e25872bc7820828425e1daea51d0700b13 Remove duplicated code in fpLookupSubdir -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] fsmMkdirs: Remove dnlx array (#1069)

2020-02-13 Thread Michael Schroeder
@mlschroe pushed 1 commit. 6232c8e1e515833f3a51af2800d3ab70d82a9e05 fsmMkdirs: do not dup the last verified directory name -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] fsmMkdirs: Remove dnlx array (#1069)

2020-02-13 Thread Michael Schroeder
@mlschroe pushed 1 commit. c410531402fe2541566d16b963b1ed575cab8ea9 fsmMkdirs: Remove dnlx array -- You are receiving this because you are subscribed to this thread. View it on GitHub:

[Rpm-maint] [rpm-software-management/rpm] fsmMkdirs: Remove dnlx array (#1069)

2020-02-13 Thread Michael Schroeder
It gets only written to and nobody uses it, so be gone. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1069 -- Commit Summary -- * fsmMkdirs: Remove dnlx array -- File Changes -- M lib/fsm.c (8) -- Patch Links --

[Rpm-maint] [rpm-software-management/rpm] Cleanup fingerprint cache creation (#1068)

2020-02-13 Thread Michael Schroeder
Simplify the way the fingerprint cache is created. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1068 -- Commit Summary -- * Move fingerprint hash setting out of fpLookupSubdir() * Remove duplicated code in

Re: [Rpm-maint] [rpm-software-management/rpm] Add a --salvagedb option to the rpmdb tool (#1042)

2020-02-12 Thread Michael Schroeder
@mlschroe pushed 1 commit. dd4bb9f38fdf1d147a09ca0cdbf38ed75e409b17 Add a --salvagedb option to the rpmdb tool -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement %{body:...} built-in for retrieving the literal macro body (#1064)

2020-02-12 Thread Michael Schroeder
I'd prefer if we named this %macrobody, so that there's less chance that it clashes with somebody else's use of %body. -- 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] Add a --salvagedb option to the rpmdb tool (#1042)

2020-02-12 Thread Michael Schroeder
No, there's a (very) small chance that it picks up entries that have been deleted. It's like the .recover command of the sqlite cli: Like the ".dump" command, ".recover" attempts to convert the entire contents of a database file to text. The difference is that instead of reading data using the

Re: [Rpm-maint] [rpm-software-management/rpm] RFE: please add a way to get the unexpanded content of a rpm variable (#582)

2020-02-11 Thread Michael Schroeder
Is the argument a macro name or some generic string? I.e. is it `%{body:_builddir}` which should then return ` %{_topdir}/BUILD`? Or is it `%{noexpand:%_builddir}` which then should only do one level of expansion? I find the latter a bit weird. -- You are receiving this because you are

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

2020-02-11 Thread Michael Schroeder
mlschroe approved this pull request. -- 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#pullrequestreview-356505622___

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

2020-02-11 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

Re: [Rpm-maint] [rpm-software-management/rpm] A saner way for marco argument escaping (#1060)

2020-02-10 Thread Michael Schroeder
(Oh, and I renamed ME_NOEXPAND to ME_LITERAL for consistency) -- 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] A saner way for marco argument escaping (#1060)

2020-02-10 Thread Michael Schroeder
Ok, done. I also used RPMMACRO_LITERAL at some other places where it made sense. I tried to add it to the buildroot macro (re-)definition, but with buildroot it is pretty hopeless. rpm's rpmGenPath always expands all arguments, which leads to the buildroot getting expanded over and over again.

Re: [Rpm-maint] [rpm-software-management/rpm] A saner way for marco argument escaping (#1060)

2020-02-10 Thread Michael Schroeder
@mlschroe pushed 3 commits. 69f083fe169487a95a0b9a4896dad88dcae4331d Add a ME_LITERAL macro flag that turns off body expansion 2c5a7c08acae96ab07ae7c6bcee39616f69f852f Add rpmPushMacroFlags function to allow the definition of literal macros 9c082dc030142eb068a8320ac91f7f106736dcbb Use

Re: [Rpm-maint] [rpm-software-management/rpm] Bunch of macro fixes and cleanups (#1062)

2020-02-10 Thread Michael Schroeder
mlschroe approved this pull request. Nice! -- 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] A saner way for marco argument escaping (#1060)

2020-02-07 Thread Michael Schroeder
@mlschroe pushed 1 commit. 42b61f94e8ae14f484184984246d7ea84ae1bf20 Add rpmPushMacroFlags function to allow the definition of literal macros -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] A saner way for marco argument escaping (#1060)

2020-02-07 Thread Michael Schroeder
Another good name would be `ME_LITERAL`. We also may want to expose this by adding a rpmPushMacroLiteral() function so that this can be used in other places where we don't want expansion to happen. E.g. everywhere where we have calculated a file name or path and want to set a macro for it. --

[Rpm-maint] [rpm-software-management/rpm] A saner way for marco argument escaping (#1060)

2020-02-07 Thread Michael Schroeder
This adds a ME_NOEXPAND macro flag that turns off body expansion. This is much simpler than the weird % character doubling. Its also a bit faster because theres less calls to expandMacro(). You can view, comment on, or merge this pull request online at:

[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] 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,

[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 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 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

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for multiple, named OpenPGP signatures per package (#1050)

2020-02-05 Thread Michael Schroeder
What's the purpose of the 'name' part? Is this about supporting signatures from multiple groups? Or is this about supporting new pubkey algorithms (e.g. ed22519)? -- 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] %global expands twice (#1049)

2020-02-05 Thread Michael Schroeder
Oh wow, I knew that %global expands right away when defining the macro, but I somehow didn't expect that it expands again when the macro is used: ``` $ rpm --eval ' > %define foo > %global bar > %foo percent, %bar percent' %% percent, % percent ``` Is that documented anywhere? Anyway,

Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps: Add full multiarch deps support (#1038)

2020-02-03 Thread Michael Schroeder
mlschroe commented on this pull request. > + break; +case EM_MIPS: + elf_machine = "mips"; + break; +case EM_PPC: +case EM_PPC64: + elf_machine = "ppc"; + break; +case EM_S390: + elf_machine = "s390"; + break; +case EM_ARM: + if

[Rpm-maint] [rpm-software-management/rpm] Add a --salvagedb option to the rpmdb tool (#1042)

2020-02-03 Thread Michael Schroeder
This can be used to recover as much data as possibly from a terminally broken database. It is currently only supported for the ndb database. This method is currently hidden from the API by using a macro to select salvage mode. If it should be more exposed, we can add a rpmtsSalvageDB() method.

[Rpm-maint] [rpm-software-management/rpm] Permit ndb database queries on read-only media (#1040)

2020-02-03 Thread Michael Schroeder
See also commit a429c99e13fbe9926243f29b78df8d64222c4469 for db3. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1040 -- Commit Summary -- * Permit ndb database queries on read-only media -- File Changes -- M

Re: [Rpm-maint] [rpm-software-management/rpm] elfdeps: Add full multiarch deps support (#1038)

2020-02-03 Thread Michael Schroeder
I don't like that it doesn't output anything if neither `--biarch-deps` not `--multiarch-deps` is provided. I think it would be better to either change the option to `--no-biarch-deps` or at least default to biarch if neither option is given. -- You are receiving this because you are

Re: [Rpm-maint] [rpm-software-management/rpm] Implement automatic conversion of the database (#1012)

2020-01-29 Thread Michael Schroeder
@mlschroe pushed 5 commits. da94ee8195da2bc841e2a4606f2948d46a1109bb Drop useless %{F:..} built-in macro 85e5a70368854da0537099128530b0df69ca2216 Fix regression on v3 package handling on database rebuild d5c69756cf6cd16e7c2e8b81fba19bf81f3dd1ba Explicitly mention that the rpmio/ sub dir is

[Rpm-maint] [rpm-software-management/rpm] Buffer overflow in doFoo() (#1019)

2020-01-27 Thread Michael Schroeder
doFoo() contains this: ``` if (expand) { (void) expandThis(mb, g, gn, ); } else { buf = xmalloc(MACROBUFSIZ + fn + gn); buf[0] = '\0'; } ``` If `expand` is true (which is the default), expandThis() will allocate the buffer, rounding up the size of the

[Rpm-maint] [rpm-software-management/rpm] Sqlite backend's prefix match cannot deal with '%' characters (#1018)

2020-01-27 Thread Michael Schroeder
It should either escape the '%' chars or use a custom match function. -- 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/1018___

[Rpm-maint] [rpm-software-management/rpm] Suspicious code in (#1017)

2020-01-27 Thread Michael Schroeder
rpmdb.c's rpmdbRebuild() function contains this: ``` if (headerIsEntry(h, RPMTAG_HEADERIMAGE)) { Header nh = headerReload(headerCopy(h), RPMTAG_HEADERIMAGE); rc = rpmdbAdd(newdb, h); headerFree(nh); } else { ``` I guess that

Re: [Rpm-maint] [rpm-software-management/rpm] Implement automatic conversion of the database (#1012)

2020-01-27 Thread Michael Schroeder
It fails because of ``` macro.c: In function 'doFoo': macro.c:1211:2: error: 'sprintf' argument 3 may overlap destination object 'buf' [-Werror=restrict] 1211 | sprintf(b, "file%s.file", buf); | ^~ macro.c:1074:11: note: destination object referenced by

Re: [Rpm-maint] [rpm-software-management/rpm] Implement automatic conversion of the database (#1012)

2020-01-23 Thread Michael Schroeder
There's now a workaround for this. Instead of adding a new dbiSetNextInstance call I've opted to change the put functions to make sure that the next instance counter will be higher than the stored package. For ndb this change is trivial. The sqlite backend doesn't need changing. For lmdb/db3

Re: [Rpm-maint] [rpm-software-management/rpm] Implement automatic conversion of the database (#1012)

2020-01-23 Thread Michael Schroeder
@mlschroe pushed 1 commit. de1a21071913b20bbb98a2aadf7991ae8e048304 Implement automatic conversion of the database -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement automatic conversion of the database (#1012)

2020-01-23 Thread Michael Schroeder
That's also incorrect. It doesn't copy the "next package" counter, so adding new packages will overwrite old ones. -- 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] Implement automatic conversion of the database (#1012)

2020-01-17 Thread Michael Schroeder
Ok, fixed. I'm not happy about adding a new parameter to rpmdbRebuild(), but it seemed to be the easiest way to fix this. -- 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] Implement automatic conversion of the database (#1012)

2020-01-17 Thread Michael Schroeder
@mlschroe pushed 1 commit. 921b1adf0bcb38ec603be3ffa180794824f80cf5 Implement automatic conversion of the database -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] Implement automatic conversion of the database (#1012)

2020-01-17 Thread Michael Schroeder
Oh wait, that doesn't work with erases. The rebuildb call must not renumber the packages. -- 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] Implement automatic conversion of the database (#1012)

2020-01-16 Thread Michael Schroeder
You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1012 -- Commit Summary -- * dbi.c: try the configured backend first * Implement automatic conversion of the database -- File Changes -- M lib/backend/bdb_ro.c (1)

Re: [Rpm-maint] [rpm-software-management/rpm] 3 cleanup fixes (#359)

2020-01-15 Thread Michael Schroeder
FYI: I had to revert the ndb glue change, as it caused segfaults if just an index dbi got closed. The commit doesn't contain any information about the problem it tries to solve, do you remember why your change was necessary? -- You are receiving this because you are subscribed to this thread.

Re: [Rpm-maint] [rpm-software-management/rpm] ndb: fix ftruncate return value warning (#1009)

2020-01-15 Thread Michael Schroeder
Reopened #1009. -- 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/1009#event-2950287205___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] ndb: fix ftruncate return value warning (#1009)

2020-01-15 Thread Michael Schroeder
@mlschroe pushed 0 commits. -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/rpm-software-management/rpm/pull/1009/files/9076d958bf91502eed454283d7daeafece4c6836..471e7d8bb26f0d7be877a261812b8dd8172650d3

Re: [Rpm-maint] [rpm-software-management/rpm] ndb: fix ftruncate return value warning (#1009)

2020-01-15 Thread Michael Schroeder
Oh my. The gcc people seem to be not too happy about this, but it's hard to fix because the void cast is optimized away before the unused result check is done. See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 Anyway, fixed to something

[Rpm-maint] [rpm-software-management/rpm] ndb: fix ftruncate return value warning (#1009)

2020-01-14 Thread Michael Schroeder
Fixes #1008 You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1009 -- Commit Summary -- * ndb: fix ftruncate return value warning -- File Changes -- M lib/backend/ndb/rpmxdb.c (2) -- Patch Links --

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for reading BDB without the library (#980)

2020-01-13 Thread Michael Schroeder
Updated the pull request: - about the dbiNew() call that cannot fail: this is copied from the other backends. I currently left it untouched so that a different commit can clean up all the backends. - about using NULL: I think NULL is some leftover from the old K days and should be avoided.

Re: [Rpm-maint] [rpm-software-management/rpm] ndb: implement index regeneration if the index is out of sync (#1005)

2020-01-12 Thread Michael Schroeder
@mlschroe pushed 2 commits. 7d7f889c2f6f880810898540b710a88f8b817036 ndb: implement index regeneration if the index is out of sync 24192af913e549f852f52567d59e435ff46f3c51 Remove the experimental status from the ndb database -- You are receiving this because you are subscribed to this

[Rpm-maint] [rpm-software-management/rpm] ndb: implement index regeneration if the index is out of sync (#1005)

2020-01-10 Thread Michael Schroeder
You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1005 -- Commit Summary -- * ndb: only clear the dbenv in the rpmdb if the last reference is gone * ndb: add a rpmxdbDelAllBlobs method * ndb: implement index regeneration

Re: [Rpm-maint] [rpm-software-management/rpm] ndb: add verify method and cleanup code (#1004)

2020-01-10 Thread Michael Schroeder
I get that, but I was under the impression that ndb is still marked as experimental. (That's about to change in the near future, though.) Anyway, force pushed to multiple commits. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on

Re: [Rpm-maint] [rpm-software-management/rpm] ndb: add verify method and cleanup code (#1004)

2020-01-10 Thread Michael Schroeder
I kind of fail to see the point, but I'll do it anyways just to please you. -- 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] ndb: add verify method and cleanup code (#1004)

2020-01-09 Thread Michael Schroeder
This commit adds a verify method for ndbs Packages.db database. It also cleans up the pkgdb code a bit: * removed unused lzo compression code * added some more comments and fixed spelling mistakes * made ordered slots flag a boolean * fixed a corner case where a package id lookup could segfault

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for reading BDB without the library (#980)

2019-12-23 Thread Michael Schroeder
@mlschroe pushed 1 commit. 56736fedb0dba9abeaabff829d97c805ba63e0cb Add support for reading BDB without the library -- 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 reading BDB without the library (#980)

2019-12-23 Thread Michael Schroeder
Added a check for the hash/btree version. -- 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/980#issuecomment-568449448___

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for reading BDB without the library (#980)

2019-12-23 Thread Michael Schroeder
Db6 just added support for large data blobs and a heap database type, both are not used by rpm. I tested it with a cooker container image, and the code could read the database without problems. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or

Re: [Rpm-maint] [rpm-software-management/rpm] Add support for reading BDB without the library (#980)

2019-12-20 Thread Michael Schroeder
Updated the code. It's now much faster and also implements prefix search. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

<    1   2   3   4   5   6   7   8   >