if FEATURES="collision-protect", portage checks if files aren't used by another package when installing them on the real system. But it checks .keep files too. These files can be created by multiple ebuilds (with keepdir), but collision-protect doesn't allow it. For example, the quake3 mod ebuilds are creating a keepfile in /opt/quake3/q3a-homedir The first ebuild is able to create the file, but not the others. Reproducible: Always Steps to Reproduce: 1. 2. 3. Actual Results: Can't emerge more than one package using the same keepdir Expected Results: Install many packages sharing the same keepdir. I don't know how these file are removed currently, but this should be a problem if we always use ".keep". Maybe we should use ".keep" followed by the first number available (".keep1", ".keep2", etc... the first might be juste ".keep")
Created attachment 65902 [details, diff] This ebuild.sh patch enable multiple .keep files This patch modify the "keepdir" function in ebuild.sh (portage-2.0.51.22-r2) so that the first file is called ".keep", the next ".keep1", ".keep2" and so on... If ".keepN" is deleted (and ".keepN-1" and ".keepN+1" are still there, the next ".keep" file will be ".keepN". If ".keep" is deleted, the next ".keep" file will be ".keep". I forgot "ebuild --info" last time, so here it is : Portage 2.0.51.22-r2 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r1, 2.6.12-mm1 i686) ================================================================= System uname: 2.6.12-mm1 i686 AMD Athlon(tm) MP 2400+ Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [disabled] dev-lang/python: 2.3.5, 2.4.1-r1 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-mtune=athlon-mp -march=athlon-mp -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-mtune=athlon-mp -march=athlon-mp -O2 -pipe -fomit-frame-pointer -finline-functions -fvisibility-inlines-hidden" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig collision-protect distlocks sandbox sfperms" GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/" LANG="fr_FR@euro" LC_ALL="fr_FR@euro" LDFLAGS="-Wl,-O1 -Wl,-z,now" LINGUAS="fr" MAKEOPTS="-j 3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /usr/local/portage-php" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowex X aalib acpi alsa apm avi berkdb bitmap-fonts cairo cdr crypt cups curl dbus dga directfb dvd dvdr dvdread eds emboss encode esd fbcon ffmpeg flac foomaticdb gcj gd gdbm ggi gif glut gnome gnomedb gpm gstreamer gtk gtk2 hal imagemagick imap imlib ipv6 java jpeg junit ldap libcaca libg++ libwww linguas_fr lm_sensors logitech-mouse mad matroska mikmod mmx mmx2 mng motif mozilla mp3 mpeg mysql ncurses network nls nptl nvidia ogg oggvorbis opengl pam pdflib perl pic pie plotutils png python quicktime rdesktop readline real rtc samba sasl sdl slang smp speex spell sqlite sse sse2 ssl svg svga tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts usb v4l v4l2 vorbis win32codecs xine xinerama xml xml2 xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET
Created attachment 65909 [details, diff] This ebuild.sh patch enable multiple .keep files The previous patch was watching in ${D} for existing ".keep" files, but those are only on the real filesystem.
We don't need to be on this bug.
Created attachment 66066 [details, diff] This ebuild.sh patch enable multiple .keep files The previous patch didn't use "${ROOT}". This one do. I tried with some packages and this patch seems to do the job...
*** Bug 118356 has been marked as a duplicate of this bug. ***
Comment on attachment 66066 [details, diff] This ebuild.sh patch enable multiple .keep files you don't have to resort to different file names: portage updates the mtime of the existing .keep file when merging another package that needs the same keepdir. so you shouldn't patch keepdir but the collision-protect code to simply ignore it
pkg-a and pkg-b both create /foo/.keep. `emerge pkg-a pkg-b`. `emerge -C pkg-b`. /foo/.keep and /foo are both now gone even though pkg-a wants it to be there. I believe that was the purpose of renaming the .keep files.
err, yes, sorry. i was only having the 'emerge pkg-a pkg-b; emerge -C pkg-a' case in mind. problem is that the patch won't work well with binpkgs, so we'll have to find another way
Created attachment 86016 [details, diff] patch that works with binpkgs too This patch fixes the problem by renaming .keep to .keep_${CATEGORY}_${P}.
(In reply to comment #9) > > This patch fixes the problem by renaming .keep to .keep_${CATEGORY}_${P}. > Great idea, I like it :)
*** Bug 132528 has been marked as a duplicate of this bug. ***
Created attachment 86751 [details, diff] using SLOT instead of P actually, the keep file doesn't have to include the version, only the slot, which has the advantage of not shouting out that you're using a vulnerable version of the package ;)
*** Bug 134269 has been marked as a duplicate of this bug. ***
*** Bug 140214 has been marked as a duplicate of this bug. ***
*** Bug 140218 has been marked as a duplicate of this bug. ***
Just remerged stable pmount (sys-apps/pmount-0.9.6), and it still provides /media/.keep. Stable pmount collides with stable hal.
Sorry...to be clear, the reason I mention it is that one of the dupes (bug #132528) claims "You need to re-emerge pmount, or get rid of the .keep file yourself, pmount does not provide it any longer."
this is fixed in rev 3917
This has been released in 2.1.1_pre3-r2.