Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 102436 - portage : .keep files with FEATURES="collision-protect"
Summary: portage : .keep files with FEATURES="collision-protect"
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 118356 132528 134269 140214 140218 (view as bug list)
Depends on:
Blocks: 136244
  Show dependency tree
 
Reported: 2005-08-13 15:55 UTC by Damien Thébault
Modified: 2006-07-20 14:04 UTC (History)
6 users (show)

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


Attachments
This ebuild.sh patch enable multiple .keep files (ebuild.diff,692 bytes, patch)
2005-08-14 03:05 UTC, Damien Thébault
Details | Diff
This ebuild.sh patch enable multiple .keep files (ebuild.sh.diff,684 bytes, patch)
2005-08-14 05:07 UTC, Damien Thébault
Details | Diff
This ebuild.sh patch enable multiple .keep files (ebuild.sh.diff,698 bytes, patch)
2005-08-16 03:37 UTC, Damien Thébault
Details | Diff
patch that works with binpkgs too (keepdir.patch,737 bytes, patch)
2006-05-02 13:03 UTC, Simon Stelling (RETIRED)
Details | Diff
using SLOT instead of P (portage-keepdir.patch,755 bytes, patch)
2006-05-14 08:43 UTC, Simon Stelling (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Damien Thébault 2005-08-13 15:55:22 UTC
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")
Comment 1 Damien Thébault 2005-08-14 03:05:58 UTC
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
Comment 2 Damien Thébault 2005-08-14 05:07:51 UTC
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.
Comment 3 Chris Gianelloni (RETIRED) gentoo-dev 2005-08-15 06:23:32 UTC
We don't need to be on this bug.
Comment 4 Damien Thébault 2005-08-16 03:37:49 UTC
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...
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2006-01-09 10:22:27 UTC
*** Bug 118356 has been marked as a duplicate of this bug. ***
Comment 6 Simon Stelling (RETIRED) gentoo-dev 2006-04-04 10:37:46 UTC
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
Comment 7 Jason Stubbs (RETIRED) gentoo-dev 2006-04-04 17:13:08 UTC
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.
Comment 8 Simon Stelling (RETIRED) gentoo-dev 2006-04-05 04:27:00 UTC
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
Comment 9 Simon Stelling (RETIRED) gentoo-dev 2006-05-02 13:03:55 UTC
Created attachment 86016 [details, diff]
patch that works with binpkgs too

This patch fixes the problem by renaming .keep to .keep_${CATEGORY}_${P}.
Comment 10 Damien Thébault 2006-05-02 14:55:48 UTC
(In reply to comment #9)
> 
> This patch fixes the problem by renaming .keep to .keep_${CATEGORY}_${P}.
> 

Great idea, I like it :)
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2006-05-06 23:08:15 UTC
*** Bug 132528 has been marked as a duplicate of this bug. ***
Comment 12 Simon Stelling (RETIRED) gentoo-dev 2006-05-14 08:43:29 UTC
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 ;)
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2006-05-24 16:22:30 UTC
*** Bug 134269 has been marked as a duplicate of this bug. ***
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2006-07-13 04:42:57 UTC
*** Bug 140214 has been marked as a duplicate of this bug. ***
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2006-07-13 04:45:46 UTC
*** Bug 140214 has been marked as a duplicate of this bug. ***
Comment 16 Carsten Lohrke (RETIRED) gentoo-dev 2006-07-13 05:30:50 UTC
*** Bug 140218 has been marked as a duplicate of this bug. ***
Comment 17 Mike Nerone 2006-07-14 07:59:37 UTC
Just remerged stable pmount (sys-apps/pmount-0.9.6), and it still provides /media/.keep. Stable pmount collides with stable hal.
Comment 18 Mike Nerone 2006-07-14 08:01:31 UTC
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."
Comment 19 Simon Stelling (RETIRED) gentoo-dev 2006-07-18 10:12:05 UTC
this is fixed in rev 3917
Comment 20 Zac Medico gentoo-dev 2006-07-20 14:04:18 UTC
This has been released in 2.1.1_pre3-r2.