I noticed that portage in some cases fails to record files belonging to a package this is openrc merge-usr profile and sys-apps/util-linux-2.39.3-r3 mih ~ # ls -la /sbin/agetty -rwxr-xr-x 1 root root 60696 Mar 11 09:15 /sbin/agetty mih ~ # ls -la /usr/bin/agetty -rwxr-xr-x 1 root root 60696 Mar 11 09:15 /usr/bin/agetty mih ~ # equery b /sbin/agetty * Searching for /sbin/agetty ... sys-apps/util-linux-2.39.3-r3 (/sbin/agetty) mih ~ # equery b /usr/bin/agetty * Searching for /usr/bin/agetty ... util-linux installs same agetty under /sbin/ and /usr/bin/ and the one under /usr/bin/ is not recorded as part of a package. Not sure if this is portage issue or maybe util-linux. Reproducible: Always mih ~ # emerge --info Portage 3.0.63 (python 3.11.8-final-0, default/linux/amd64/23.0/hardened, gcc-13, glibc-2.39-r2, 6.7.9-gentoo-dist-hardened x86_64) ================================================================= System uname: Linux-6.7.9-gentoo-dist-hardened-x86_64-AMD_Ryzen_5_2600_Six-Core_Processor-with-glibc2.39 KiB Mem: 16296944 total, 879160 free KiB Swap: 33554428 total, 33554172 free Timestamp of repository gentoo: Mon, 11 Mar 2024 07:33:56 +0000 Head commit of repository gentoo: 6a7072b01369a101bb54abb4b1eaed63a196e190 sh bash 5.2_p26 ld GNU ld (Gentoo 2.42 p3) 2.42.0 app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.2_p26::gentoo dev-build/autoconf: 2.72-r1::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.28.3::gentoo dev-build/libtool: 2.4.7-r2::gentoo dev-build/make: 4.4.1-r1::gentoo dev-build/meson: 1.3.2::gentoo dev-lang/perl: 5.38.2-r2::gentoo dev-lang/python: 3.11.8_p1::gentoo sys-apps/baselayout: 2.14-r2::gentoo sys-apps/openrc: 0.53::gentoo sys-apps/sandbox: 2.38::gentoo sys-devel/binutils: 2.42-r1::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/gcc: 13.2.1_p20240210::gentoo sys-devel/gcc-config: 2.11::gentoo sys-kernel/linux-headers: 6.7::gentoo (virtual/os-headers) sys-libs/glibc: 2.39-r2::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo.git priority: -1000 volatile: False sync-git-clone-extra-opts: -b stable -c remote.origin.prune=true -c gc.pruneExpire=now -c gc.worktreePruneExpire=now -c gc.reflogExpire=now -c gc.reflogExpireUnreachable=now -c gc.rerereresolved=0 -c gc.rerereunresolved=0 sync-git-verify-commit-signature: true local location: /var/db/repos/local masters: gentoo volatile: False Binary Repositories: gentoobinhost priority: 1 sync-uri: https://gentoo.mirror.garr.it/releases/amd64/binpackages/23.0/x86-64_hardened ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.3/ext-active/ /etc/php/cgi-php8.3/ext-active/ /etc/php/cli-php8.3/ext-active/ /etc/php/fpm-php8.3/ext-active/ /etc/php/phpdbg-php8.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d" CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" DISTDIR="/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=native -O2 -pipe -fomit-frame-pointer -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing" GENTOO_MIRRORS="https://gentoo.mirror.garr.it/ https://mirror.init7.net/gentoo/ https://mirror.netcologne.de/gentoo/ https://mirror.leaseweb.com/gentoo/" LANG="sl_SI.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs" LEX="flex" LINGUAS="en sl" MAKEOPTS="-j12 -l12" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="acl acpi amd64 apache2 avif bzip2 caps cet change-password cli client crypt curl dhcp dist-kernel doh dovecot-sasl dracut eap exif expat extraengine fontconfig ftp gd gdbm glib gmp grub gssapi gzip hardened http2 iconv icu idn intl iptables ipv6 jpeg kerberos lcms libtirpc lm-sensors lto lz4 lzma lzo managesieve modules-compress mp3 multilib mysql mysqli ncurses nls nping nvenc nvidia-gpu openmp openssl pam pci pcntl pcre pdo perl pic pie png qt6 rar readline rpc samba seccomp server sieve slang smtp soap sockets socks5 spell sqlite ssh ssl ssp suexec test-rust threads tiff tracepath truetype udev unicode urandom usb vhosts webp webui x264 x265 xattr xml xmlreader xmlwriter xslt xtpax xvid xz zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias authn_dbd authn_socache authz_dbd cache_socache dbd http2 proxy proxy_html proxy_http proxy_http2 proxy_wstunnel xml2enc" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en sl" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-4" LUA_TARGETS="lua5-4" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-3" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="nvidia" XTABLES_ADDONS="geoip" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
As you are using a merge-usr profile, /sbin is just a symlink to usr/bin. util-linux just installs agetty to /sbin to make sure its in the root filesystem and to be compatible with split-usr as well it should stay like that. But because your /sbin is just a symlink your agetty binary will end up in /usr/bin portage will just record the original path because the sandbox where it is installed does not know anything about split-usr/merge-usr, it just creates its directories and installs files into them. portage just records the original path which is sufficient for proper installation and deinstallation and its transparent regarding split-usr/merge-usr In bug #926219 we have some difficulties with that, but I dont think portage is no really to blame here
Oh yes, thats true that is only symlink but i think in case of merge-usr and symlinks portage should "know" this and return an answer... or maybe this is more like app-portage/portage-utils (qfile) & app-portage/gentoolkit (equery) issue... because i guess they are the ones parsing CONTENTS files...