Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 791571 - app-portage/portage-utils-0.91: qsearch: Cache file for '<package>' has unknown key INHERIT
Summary: app-portage/portage-utils-0.91: qsearch: Cache file for '<package>' has unkno...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-23 03:23 UTC by Andrey
Modified: 2021-07-06 07:03 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
no-unknown-key-warning.patch (no-unknown-key-warning.patch,188 bytes, patch)
2021-05-23 05:49 UTC, Ionen Wolkens
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2021-05-23 03:23:38 UTC
qsearch shows "Cache file for '<package>' has unknown key INHERIT" warning for every displayed package.

(qsearch -q suppresses the warning though)

Reproducible: Always

Steps to Reproduce:
1. Run `qsearch baselayout` (or pretty much any other package
Actual Results:  
Getting "Cache file for '<package>' has unknown key INHERIT" warning for every displayed package:
```
qsearch: Cache file for 'sys-apps/baselayout-9999' has unknown key INHERIT
sys-apps/baselayout: Filesystem baselayout and init scripts
qsearch: Cache file for 'sys-apps/baselayout-java-0.1.0-r1' has unknown key INHERIT
sys-apps/baselayout-java: Baselayout for Java
qsearch: Cache file for 'sys-apps/baselayout-prefix-2.6-r3' has unknown key INHERIT
sys-apps/baselayout-prefix: Filesystem baselayout and init scripts
```

However, some packages (without inherited eclasses?) don't product such a warning:
```
$ qsearch linux-sources
virtual/linux-sources: Virtual for Linux kernel sources
```

Expected Results:  
No warning is shown.

I started seeing this problem after I switched from using rsync (rsync://rsync.gentoo.org/gentoo-portage) for Gentoo portage tree updates to "git-mirror" method (https://anongit.gentoo.org/git/repo/sync/gentoo.git).

I think I also moved the repo from old-style /usr/portage to new-style /var/db/repos/gentoo/ location at the same time.


portage-utils-0.90, 0.91, and 9999 (commit 13402fbd8c51f7feedcc85f2f0815768ec45ee7a) show the same behavior.
Comment 1 Andrey 2021-05-23 03:55:39 UTC
(In reply to Andrey Hippo from comment #0)
> qsearch shows "Cache file for '<package>' has unknown key INHERIT" warning
> for every displayed package.
> 
> (qsearch -q suppresses the warning though)
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Run `qsearch baselayout` (or pretty much any other package
> Actual Results:  
> Getting "Cache file for '<package>' has unknown key INHERIT" warning for
> every displayed package:
> ```
> qsearch: Cache file for 'sys-apps/baselayout-9999' has unknown key INHERIT
> sys-apps/baselayout: Filesystem baselayout and init scripts
> qsearch: Cache file for 'sys-apps/baselayout-java-0.1.0-r1' has unknown key
> INHERIT
> sys-apps/baselayout-java: Baselayout for Java
> qsearch: Cache file for 'sys-apps/baselayout-prefix-2.6-r3' has unknown key
> INHERIT
> sys-apps/baselayout-prefix: Filesystem baselayout and init scripts
> ```
> 
> However, some packages (without inherited eclasses?) don't product such a
> warning:
> ```
> $ qsearch linux-sources
> virtual/linux-sources: Virtual for Linux kernel sources
> ```
> 
> Expected Results:  
> No warning is shown.
> 
> I started seeing this problem after I switched from using rsync
> (rsync://rsync.gentoo.org/gentoo-portage) for Gentoo portage tree updates to
> "git-mirror" method (https://anongit.gentoo.org/git/repo/sync/gentoo.git).


Indeed, comparing metadata from an rsync mirror and git-mirror repo shows the extra INHERIT key, that qsearch is complaining about:
```
$ diff -u rsync/metadata/md5-cache/sys-apps/baselayout-9999 /var/db/repos/gentoo/metadata/md5-cache/sys-apps/baselayout-9999
--- rsync/metadata/md5-cache/sys-apps/baselayout-9999     2021-05-12 23:39:37.000000000 +0300
+++ /var/db/repos/gentoo/metadata/md5-cache/sys-apps/baselayout-9999    2021-05-22 00:00:36.609371175 +0300
@@ -3,9 +3,10 @@
 DESCRIPTION=Filesystem baselayout and init scripts
 EAPI=7
 HOMEPAGE=https://wiki.gentoo.org/wiki/No_homepage
+INHERIT=multilib prefix git-r3
 IUSE=build kernel_FreeBSD kernel_linux +split-usr
 LICENSE=GPL-2
 PROPERTIES=live
 SLOT=0
-_eclasses_=git-r3      b8e8c92aa5fe8df7187e466138eb4e52        multilib        d410501a125f99ffb560b0c523cd3d1e     prefix   de7d8e2b10085ed5ff09ad70e4753e5c        toolchain-funcs 24921b57d6561d87cbef4916a296ada4
+_eclasses_=multilib    d410501a125f99ffb560b0c523cd3d1e        toolchain-funcs 24921b57d6561d87cbef4916a296ada4     prefix   de7d8e2b10085ed5ff09ad70e4753e5c        git-r3  b8e8c92aa5fe8df7187e466138eb4e52
 _md5_=2febc33447ac0d3307b93c4a9a2178e2
```
Comment 2 Andrey 2021-05-23 04:12:36 UTC
Removing /var/db/repos/gentoo/metadata/md5-cache/sys-apps/baselayout-9999 and running `egencache --repo=gentoo --update sys-apps/baselayout` produces the same file as seen on the rsync mirror.

So, I wonder if it's really a bug with https://gitweb.gentoo.org/repo/sync/gentoo.git/ tooling rather than with qsearch.


```
diff --git a/metadata/md5-cache/sys-apps/baselayout-9999 b/metadata/md5-cache/sys-apps/baselayout-9999
index 2c0ea5ec7b72..53c08ac70500 100644
--- a/metadata/md5-cache/sys-apps/baselayout-9999
+++ b/metadata/md5-cache/sys-apps/baselayout-9999
@@ -3,10 +3,9 @@ DEFINED_PHASES=install postinst preinst prepare setup unpack
 DESCRIPTION=Filesystem baselayout and init scripts
 EAPI=7
 HOMEPAGE=https://wiki.gentoo.org/wiki/No_homepage
-INHERIT=multilib prefix git-r3
 IUSE=build kernel_FreeBSD kernel_linux +split-usr
 LICENSE=GPL-2
 PROPERTIES=live
 SLOT=0
-_eclasses_=multilib    d410501a125f99ffb560b0c523cd3d1e        toolchain-funcs 24921b57d6561d87cbef4916a296ada4
        prefix  de7d8e2b10085ed5ff09ad70e4753e5c        git-r3  b8e8c92aa5fe8df7187e466138eb4e52
+_eclasses_=git-r3      b8e8c92aa5fe8df7187e466138eb4e52        multilib        d410501a125f99ffb560b0c523cd3d1e
        prefix  de7d8e2b10085ed5ff09ad70e4753e5c        toolchain-funcs 24921b57d6561d87cbef4916a296ada4
 _md5_=2febc33447ac0d3307b93c4a9a2178e2
```
Comment 3 Ionen Wolkens gentoo-dev 2021-05-23 05:49:29 UTC
Created attachment 710370 [details, diff]
no-unknown-key-warning.patch

(In reply to Andrey from comment #2)
> Removing /var/db/repos/gentoo/metadata/md5-cache/sys-apps/baselayout-9999
> and running `egencache --repo=gentoo --update sys-apps/baselayout` produces
> the same file as seen on the rsync mirror.
> 
> So, I wonder if it's really a bug with
> https://gitweb.gentoo.org/repo/sync/gentoo.git/ tooling rather than with
> qsearch.
It's not, INHERIT key is new in pkgcore and shows up if using `pmaint regen` instead of egencache.

Arguably not the right fix but, if just want to silence it, attached patch should work meanwhile.
Comment 4 Fabian Groffen gentoo-dev 2021-05-23 08:47:32 UTC
The reason it does this is because it finds "garbage".  Question is indeed whether it should bother about it in the first place.
Comment 5 Larry the Git Cow gentoo-dev 2021-05-23 10:54:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6e42f76862860f19674fe1f87d9a7087acfa742e

commit 6e42f76862860f19674fe1f87d9a7087acfa742e
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-05-23 10:54:00 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-05-23 10:54:00 +0000

    libq/tree: silence warning about unknown keys in md5 cache format
    
    Bug: https://bugs.gentoo.org/791571
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 libq/tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 6 Andrey 2021-05-24 02:21:20 UTC
(In reply to Larry the Git Cow from comment #5)
> commit 6e42f76862860f19674fe1f87d9a7087acfa742e
> Author:     Fabian Groffen <grobian@gentoo.org>
> AuthorDate: 2021-05-23 10:54:00 +0000
> Commit:     Fabian Groffen <grobian@gentoo.org>
> CommitDate: 2021-05-23 10:54:00 +0000
> 
>     libq/tree: silence warning about unknown keys in md5 cache format
>


Rebuilding portage-utils-9999 to include 6e42f76862860f19674fe1f87d9a7087acfa742e fixes the issue:
```
$ qsearch baselayout
sys-apps/baselayout: Filesystem baselayout and init scripts
sys-apps/baselayout-java: Baselayout for Java
sys-apps/baselayout-prefix: Filesystem baselayout and init scripts
```

Thank you for the quick fix!
Comment 7 Andrey 2021-05-24 02:27:54 UTC
(In reply to Ionen Wolkens from comment #3)
> > So, I wonder if it's really a bug with
> > https://gitweb.gentoo.org/repo/sync/gentoo.git/ tooling rather than with
> > qsearch.
> It's not, INHERIT key is new in pkgcore and shows up if using `pmaint regen`
> instead of egencache.

Oh, ok, good to know.
It's a little unexpected that metadata for the main git sync repo is generated with an experimental (according to the wiki) package manager rather than the official package manager.


Anyway, I'm happy with the fix that Fabian put in.
Comment 8 Larry the Git Cow gentoo-dev 2021-07-06 07:03:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65b5ac4b8140f7ff1ab5c27af5c690288ec1419b

commit 65b5ac4b8140f7ff1ab5c27af5c690288ec1419b
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-07-06 07:03:02 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-07-06 07:03:15 +0000

    app-portage/portage-utils-0.92: version bump + cleanup
    
    Closes: https://bugs.gentoo.org/792273
    Closes: https://bugs.gentoo.org/791571
    Closes: https://bugs.gentoo.org/787089
    Closes: https://bugs.gentoo.org/769929
    Closes: https://bugs.gentoo.org/757540
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 app-portage/portage-utils/Manifest                 |  3 +-
 .../portage-utils/portage-utils-0.90.1.ebuild      | 67 ----------------------
 ...utils-0.91.ebuild => portage-utils-0.92.ebuild} |  0
 3 files changed, 1 insertion(+), 69 deletions(-)