projg2 / eselect-repository

An eselect module to manage repos.conf (i.e. layman replacement)
20 stars 8 forks source link

Pre-create overlay location #30

Closed duxsco closed 1 week ago

duxsco commented 1 week ago

Hi @mgorny,

pre-create the overlay's location with portage ownership to avoid having the sync done by root, please:

❯ ls -la /var/db/repos/
total 0
drwxr-xr-x 1 root    root      20 16. Okt 07:41 ./
drwxr-xr-x 1 root    root      40 16. Okt 08:13 ../
drwxr-xr-x 1 portage portage 3526 15. Okt 18:15 gentoo/
drwxr-xr-x 1 portage portage 2816 16. Okt 07:42 guru/

❯ eselect repository enable science
Adding science to /etc/portage/repos.conf/eselect-repo.conf ...
1 repositories enabled

❯ emaint -r science sync
>>> Syncing repository 'science' into '/var/db/repos/science'...
/usr/bin/git clone --depth 1 https://github.com/gentoo-mirror/science.git .
Cloning into '.'...
remote: Enumerating objects: 3342, done.
remote: Counting objects: 100% (3342/3342), done.
remote: Compressing objects: 100% (3007/3007), done.
remote: Total 3342 (delta 785), reused 1852 (delta 286), pack-reused 0 (from 0)
Receiving objects: 100% (3342/3342), 1.21 MiB | 567.00 KiB/s, done.
Resolving deltas: 100% (785/785), done.
=== Sync completed for science

Performing Global Updates
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
  s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
  p='update /etc/portage/package.*'
/var/db/repos/science/profiles/updates/1Q-2011......
/var/db/repos/science/profiles/updates/1Q-2012.
/var/db/repos/science/profiles/updates/1Q-2014.
/var/db/repos/science/profiles/updates/1Q-2016..
/var/db/repos/science/profiles/updates/1Q-2021.........
/var/db/repos/science/profiles/updates/1Q-2022.
/var/db/repos/science/profiles/updates/2Q-2011.....
/var/db/repos/science/profiles/updates/2Q-2014..
/var/db/repos/science/profiles/updates/2Q-2021.
/var/db/repos/science/profiles/updates/2Q-2024..
/var/db/repos/science/profiles/updates/3Q-2009........................
/var/db/repos/science/profiles/updates/4Q-2013.
/var/db/repos/science/profiles/updates/4Q-2015.
/var/db/repos/science/profiles/updates/4Q-2020..
/var/db/repos/science/profiles/updates/4Q-2021.
/var/db/repos/science/profiles/updates/4Q-2022.

 * IMPORTANT: 1 news items need reading for repository 'science'.
 * IMPORTANT: 17 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

Action: sync for repo: science, returned code = 0

As the sync has been done by root, /var/db/repos/science is owned by root:

❯ ls -la /var/db/repos/
total 0
drwxr-xr-x 1 root    root      34 16. Okt 08:16 ./
drwxr-xr-x 1 root    root      40 16. Okt 08:16 ../
drwxr-xr-x 1 portage portage 3526 15. Okt 18:15 gentoo/
drwxr-xr-x 1 portage portage 2816 16. Okt 07:42 guru/
drwxr-xr-x 1 root    root     690 16. Okt 08:16 science/

And, ps shows that git is executed by root:

❯ ps au
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root        1250  0.0  0.0   5876  2176 tty1     Ss+  07:03   0:00 /sbin/agetty -o -p -- \u --noclear - linux
david       9033  0.0  0.0   7940  4224 pts/0    Ss   08:26   0:00 -bash
david       9041  0.0  0.0   7816  4224 pts/1    Ss   08:26   0:00 -bash
root        9053  0.0  0.0  15120  6272 pts/0    S+   08:27   0:00 sudo -i emaint -r science sync
root        9055  0.0  0.0  15120  2288 pts/2    Ss   08:27   0:00 sudo -i emaint -r science sync
root        9056 16.0  0.4  47648 38760 pts/2    S+   08:27   0:00 /usr/bin/python3.12 /usr/lib/python-exec/python3.12/
root        9057  8.1  0.5  53600 40552 pts/2    S+   08:27   0:00 /usr/bin/python3.12 /usr/lib/python-exec/python3.12/
root        9058  0.0  0.0  10180  4608 pts/2    S+   08:27   0:00 /usr/bin/git clone --depth 1 https://github.com/gent
root        9059  0.0  0.0  10180  3968 pts/2    S+   08:27   0:00 /usr/libexec/git-core/git remote-https origin https:
root        9060  1.6  0.1  19124 11392 pts/2    S+   08:27   0:00 /usr/libexec/git-core/git-remote-https origin https:
david       9061  100  0.0  11156  4480 pts/1    R+   08:27   0:00 ps au
duxsco commented 1 week ago

My emerge --info:

❯ emerge --info
Portage 3.0.65 (python 3.12.6-final-0, default/linux/amd64/23.0/hardened/systemd, gcc-13, glibc-2.39-r6, 6.6.56-gentoo-dist x86_64)
=================================================================
System uname: Linux-6.6.56-gentoo-dist-x86_64-Intel-R-_Core-TM-_i5-10300H_CPU_@_2.50GHz-with-glibc2.39
KiB Mem:     8107328 total,   6406496 free
KiB Swap:    2080764 total,   2080764 free
Timestamp of repository gentoo: Wed, 16 Oct 2024 00:45:00 +0000
Head commit of repository gentoo: f8df448dd841fd7b1930b9533efbc68272d361a4
sh bash 5.2_p37
ld GNU ld (Gentoo 2.42 p6) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.71-r7::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.30.2::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.1::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.6_p4::gentoo
dev-lang/rust-bin:         1.80.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-apps/systemd:          255.11::gentoo
sys-devel/binutils:        2.42-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             13.3.1_p20240614::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts:
    sync-rsync-verify-metamanifest: yes

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64_hardened

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--noconfmem --with-bdeps=y --complete-graph=y"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch 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="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="de"
MAKEOPTS="-j3 -l4"
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 amd64 bzip2 caps cet crypt dist-kernel fish-completion gdbm hardened iconv ipv6 libtirpc multilib ncurses nls openmp pam pcre pic pie readline seccomp ssl ssp systemd test-rust udev unicode vim-syntax xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gcc_12" 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" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 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" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, 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
duxsco commented 1 week ago

Related bugs: https://bugs.gentoo.org/941605

duxsco commented 1 week ago

My emerge --info:

To avoid confusion I want to point out that I deleted only the GURU overlay conf. That's why it isn't listed by emerge --info, but shown by ls -la /var/db/repos/ I suppose.

mgorny commented 1 week ago

Why should eselect-repository be working around bugs in Portage?

duxsco commented 1 week ago

Valid point. I close the issue.