Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 851138 - app-portage/portage-utils - repos.conf location setting is not parsed correctly
Summary: app-portage/portage-utils - repos.conf location setting is not parsed correctly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2022-06-11 05:27 UTC by onkobu
Modified: 2022-06-14 17:53 UTC (History)
1 user (show)

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


Attachments
emerge --info of host (emerge-info-host.txt,6.12 KB, text/plain)
2022-06-11 05:27 UTC, onkobu
Details
emerge --info of chroot (emerge-info-chroot.txt,6.66 KB, text/plain)
2022-06-11 05:28 UTC, onkobu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description onkobu 2022-06-11 05:27:43 UTC
Created attachment 783953 [details]
emerge --info of host

I set up a Gentoo host with repo in /var/db/repos/gentoo. Intention is to keep varying files on /var. This is configured in /etc/portage/repos.conf/gentoo.conf.

On the same host I set up an addition chroot with mainly default settings (after installation). Thus repo resides in /usr/portage. Emerge has been working for months and has no issues.

Now I tried to track dependency issues inside the chroot with q applets like quse. Sadly it reports:

qsearch: tree_open(): could not open repository at /var/db/repos/gentoo (under root /)

Other q-applets work flawlessly and report the correct results - inside the chroot and outside of it. I also double checked and re-executed env-update && . /etc/profile inside the chroot to no avail.

Somehow quse remembers the repo configuration from outside the chroot.

Using app-portage/portage-utils-0.93.3
Comment 1 onkobu 2022-06-11 05:28:10 UTC
Created attachment 783956 [details]
emerge --info of chroot
Comment 2 Fabian Groffen gentoo-dev 2022-06-12 08:11:03 UTC
it's a bit "weird" if not "impossible" for quse to "see" outside of the chroot, so do you use ROOT or something from the host to look inside the chroot?
Comment 3 onkobu 2022-06-12 14:05:25 UTC
(In reply to Fabian Groffen from comment #2)
> it's a bit "weird" if not "impossible" for quse to "see" outside of the
> chroot, …
Therefore I opened the bug.

> so do you use ROOT or something from the host to look inside the
> chroot?

1. Login via SSH to the (remote) host as regular user
2. su (and not sudo!)
3. chroot (plain, no --login, no additional commands like - su <other>)
4. quse <query> inside the chroot

I also mount proc, sys and dev from the host into the chroot. And all the other q applets work correctly and also relate to the correct portage database/ portage tree.
Comment 4 onkobu 2022-06-13 18:40:54 UTC
I also checked the binaries by calculating checksums for the same path. On the host I get sha1sum A inside the chroot another B. I also grep-ped recursively through /etc, /var/portage and /usr/portage with 'repos/gentoo' inside the chroot. In addition I checked env and output on host differs from chroot as expected. But none contains any portage related path changing.

Still inside the chroot quse assumes repository in /var/db/repos/gentoo. Could it be because of two additional crossdev environments? Crossdev (/etc/portage/repos.conf/crossdev.conf) has

[crossdev]
location = /var/db/repos/crossdev
masters = gentoo
auto-sync = no

But such a constellation works on a second machine flawlessly (crossdev under /var/… and gentoo under /usr/portage).

As soon as I create a symlink of /usr/portage to gentoo in /var/db/repos it works and shows the correct packages and their USE flags (as configured in the chroot differing from those on the host).

Finally I also checked the permissions under /etc/portage/repos.conf: all owned by root and all 644. I thought maybe it appears only as it would remember but instead it is a hard coded default because the repos.conf is not readable/ accessible.
Comment 5 Mike Gilbert gentoo-dev 2022-06-13 19:00:59 UTC
Please provide /etc/portage/repos.conf/* and /usr/share/portage/config/repos.conf from the chroot.
Comment 6 onkobu 2022-06-13 20:12:11 UTC
(In reply to Mike Gilbert from comment #5)
> Please provide /etc/portage/repos.conf/* and
> /usr/share/portage/config/repos.conf from the chroot.

The file /usr/share/portage/config/repos.conf contains

[gentoo]
location = /var/db/repos/gentoo

/etc/portage/repos.conf/gentoo looks like this (with the comment lines):

[gentoo]
#location = /var/db/repos/gentoo
location=/usr/portage
sync-type = rsync
#sync-uri = rsync://rsync.gentoo.org/gentoo-portage
sync-uri = rsync://rsync1.de.gentoo.org/gentoo-portage/

Also changing location in /usr/share/portage/config/repos.conf to the value of /etc/portage/repos.conf/gentoo and quse behaves correctly.
Comment 7 onkobu 2022-06-13 20:25:00 UTC
On the system I bootstrapped the chroot from both configs point to the same location (/usr/portage). Where bootstrapping means taking a Stage 3 archive and copying a subset of files and directories of /etc from a running host/ installation. I assume the Stage 3 provides /usr/…/repos.conf with /var while the running host has /usr/portage set.
Comment 8 Mike Gilbert gentoo-dev 2022-06-13 20:31:24 UTC
(In reply to onkobu from comment #6)
> /etc/portage/repos.conf/gentoo looks like this (with the comment lines):
> 
> [gentoo]
> #location = /var/db/repos/gentoo
> location=/usr/portage

It seems that portage-utils does not parse this location setting correctly. It expects to see a space between "location" and the equals sign.
Comment 9 Fabian Groffen gentoo-dev 2022-06-14 06:16:07 UTC
`q -o` should list which overlays/repos q found.  It indeed seems that a lack of whitespace between 'location' and '=' makes the repo to be ignored.
Comment 10 Larry the Git Cow gentoo-dev 2022-06-14 06:36:57 UTC
The bug has been referenced in the following commit(s):

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

commit 2100df5c171029d6c347650fdaf098b67df0f059
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2022-06-14 06:35:35 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2022-06-14 06:35:35 +0000

    main: ensure correct parsing of key-value pairs in ini-files
    
    Ensure the key is terminated when the '=' is adjacent to it (without
    whitespace).
    
    Bug: https://bugs.gentoo.org/851138
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Comment 11 Larry the Git Cow gentoo-dev 2022-06-14 07:15:53 UTC
The bug has been closed via the following commit(s):

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

commit ec3307e507ccfc092371f8e16ea40ff50557ca9f
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2022-06-14 07:12:19 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2022-06-14 07:15:51 +0000

    app-portage/portage-utils-0.94: version bump
    
    Closes: https://bugs.gentoo.org/851138
    Closes: https://bugs.gentoo.org/837188
    Closes: https://bugs.gentoo.org/836590
    Closes: https://bugs.gentoo.org/833942
    Closes: https://bugs.gentoo.org/807975
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 app-portage/portage-utils/Manifest                 |  1 +
 .../portage-utils/portage-utils-0.94.ebuild        | 67 ++++++++++++++++++++++
 2 files changed, 68 insertions(+)
Comment 12 onkobu 2022-06-14 17:53:53 UTC
Updated to 0.94 and works as expected now. (Also checked that /usr/share/portage/config/repos.conf contains a location that does not exist.)

THX for fixing.