Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 352984

Summary: sys-apps/portage-2.1.9.25 : slotted RDEPEND behavior is no longer preserving two versions
Product: Portage Development Reporter: Robert Forsman <gentoo>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: darkside, serkan
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Robert Forsman 2011-01-27 19:48:11 UTC
I want to maintain two gentoo-sources trees.  I want to have the tree corresponding to the kernel I am running.  I also want to have whatever the latest tree is in case I have time to actually configure, install, and test a new kernel (which is almost never).

I want emerge -uvDN world to install the latest gentoo-sources each time.  I want emerge --depclean to preserve the version corresponding to my current kernel.  I also want it to preserve the latest version.  I want it to uninstall any other kernels.

I was accomplishing this using an ebuild that looks like this:

DESCRIPTION="which kernels should be installed on amarna"

SLOT="0"

KEYWORDS="x86"

RDEPEND="
=sys-kernel/gentoo-sources-2.6.29-r5
sys-kernel/gentoo-sources
!>sys-fs/udev-164
"


That used to work as I described and wanted.

I recently was upgrading packages and discovered that depclean wants to remove the most recent gentoo-sources (at least it preserves the kernel source for what I am currently running).


amarna gentoo-sources # equery depends gentoo-sources
[ Searching for packages depending on gentoo-sources... ]
bob/kernel-amarna-1.1 (sys-kernel/gentoo-sources)
                      (=sys-kernel/gentoo-sources-2.6.29-r5)


amarna gentoo-sources # emerge -p --depclean
...
>>> These are the packages that would be unmerged:

 sys-kernel/gentoo-sources
    selected: 2.6.36-r5 
   protected: none 
     omitted: 2.6.29-r5 

All selected packages: sys-kernel/gentoo-sources-2.6.36-r5
...


I installed a dummy ebuild for 2.6.29 (which has been removed from portage), but that didn't solve the problem.


How do I construct an ebuild to express this desire to preserve two versions of a slotted ebuild and discard the others?




amarna gentoo-sources # emerge --info
Portage 2.1.9.25 (default/linux/x86/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.29-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.29-gentoo-r5-i686-AMD_Athlon-tm-_Processor_LE-1640-with-gentoo-1.12.14
Timestamp of tree: Mon, 24 Jan 2011 19:00:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 3.1.2-r4
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r2, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i486-pc-linux-gnu"
CFLAGS="-O2 -mtune=i686 -pipe"
CHOST="i486-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mtune=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/thoth/portage"
SYNC="rsync://alexandria/gentoo-portage"
USE="X acl berkdb bzip2 cli cracklib crypt cxx dbus device-mapper dri encode faac faad fortran gdbm gpm iconv ipv6 mng modules mp3 mudflap ncurses nls nptl nptlonly openmp pam pcre perl png pnm pppd python quicktime readline session ssl svg sysfs tcpd theora unicode vorbis x264 x86 xorg xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="ati vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2011-01-27 20:04:32 UTC
Why don't you just add the SLOT you want to your world file? That way depclean won't remove the SLOTed version because you have stated that you EXPLICITLY want it.

emerge --noreplace gentoo-sources:2.6.29-r5
Comment 2 Sebastian Luther (few) 2011-01-27 20:48:27 UTC
You could change your ebuild to 

RDEPEND="
=sys-kernel/gentoo-sources-2.6.29-r5
>=sys-kernel/gentoo-sources-2.6.30
!>sys-fs/udev-164
"
Comment 3 Zac Medico gentoo-dev 2011-01-27 20:58:58 UTC
I guess the behavior change comes from bug 285767, in this commit:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=51140af8783fae99ff2b2f5ca5f45bcfeb689b91

The new behavior should be preferable to the old, so I agree with the suggestion in comment #2.
Comment 4 Robert Forsman 2011-01-27 22:52:24 UTC
(In reply to comment #1)
> Why don't you just add the SLOT you want to your world file? That way depclean
> won't remove the SLOTed version because you have stated that you EXPLICITLY
> want it.

Well, I don't think they had that syntax when I first figured out this method using ebuilds.  

Also, I suspect that if I had gentoo-sources and gentoo-sources:2.6.29-r5 in /var/lib/portage/world then it would never unmerge the stale gentoo-sources.  I haven't studied the enhancements to the world file that might make it possible to express "only the most recent of this slotted build".  

Perhaps my old syntax working the way I wanted was just a historical accident.

I can see why the fix referenced in comment #3 would affect me, and agree that its behavior is probably preferrable.

The solution in comment #2 would work, assuming there is a more recent version of gentoo-sources.  There's just an awkward phase where I transition to the latest kernel.  What would the ebuild look like (since there wouldn't be anything more recent, the atom would lead to a failure?)
Comment 5 Zac Medico gentoo-dev 2011-01-28 00:18:37 UTC
(In reply to comment #4)
> Also, I suspect that if I had gentoo-sources and gentoo-sources:2.6.29-r5 in
> /var/lib/portage/world then it would never unmerge the stale gentoo-sources.  I
> haven't studied the enhancements to the world file that might make it possible
> to express "only the most recent of this slotted build".  

It should work, since world atoms are not greedy. That's why we have (unsolved) bug 198200, since some people want to keep "stale gentoo-sources" and don't want to manage it via non-greedy atoms in the world file.