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

Bug 332719

Summary: "emerge --depclean" removes packages that "emerge -uND world" pulls back in
Product: Gentoo Linux Reporter: xo0ox <xo0ox>
Component: [OLD] JavaAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: mgorny
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 335925    
Attachments: "emerge -dcp" and "emerge -uNDdp world" stdin and stdout 4 files

Description xo0ox 2010-08-14 11:54:19 UTC
"emerge --depclean" removes 3 packages which have dependencies
from other packages. "equery d" shows the packages and after a
"depclean" emerge -uNDav re-emerge them.

root@hostname # emerge --pretend --depclean 

 * Depclean may break link level dependencies.  Thus, it is
 * recommended to use a tool such as `revdep-rebuild` (from
 * app-portage/gentoolkit) in order to detect such breakage.
 * 
 * Always study the list of packages to be cleaned for any obvious
 * mistakes. Packages that are part of the world set will always
 * be kept.  They can be manually added to this set with
 * `emerge --noreplace <atom>`.  Packages that are listed in
 * package.provided (see portage(5)) will be removed by
 * depclean, even if they are part of the world set.
 * 
 * As a safety measure, depclean will not remove any packages
 * unless *all* required dependencies have been resolved.  As a
 * consequence, it is often necessary to run `emerge --update
 * --newuse --deep world` prior to depclean.

Calculating dependencies... done!

>>> These are the packages that would be unmerged:

 dev-java/ibm-jdk-bin
    selected: 1.5.0.11_p1 
   protected: none 
     omitted: none 

 virtual/libstdc++
    selected: 3.3 
   protected: none 
     omitted: none 

 sys-libs/libstdc++-v3
    selected: 3.3.6 
   protected: none 
     omitted: none 

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Packages installed:   1134
Packages in world:    263
Packages in system:   50
Required packages:    1131
Number to remove:     3



root@hostname # for i in dev-java/ibm-jdk-bin virtual/libstdc++ sys-libs/libstdc++-v3;do equery depends $i;done
[ Searching for packages depending on dev-java/ibm-jdk-bin... ]
virtual/jdk-1.5.0 (=dev-java/ibm-jdk-bin-1.5.0*)
virtual/jdk-1.6.0 (=dev-java/ibm-jdk-bin-1.6.0*)
[ Searching for packages depending on virtual/libstdc++... ]
dev-java/ibm-jdk-bin-1.5.0.11_p1 (=virtual/libstdc++-3.3)
dev-java/sun-jre-bin-1.6.0.20 (x86? =virtual/libstdc++-3.3)
[ Searching for packages depending on sys-libs/libstdc++-v3... ]
virtual/libstdc++-3.3 (=sys-libs/libstdc++-v3-3.3*)


Reproducible: Always




Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.4.3, glibc-2.11.2-r0, 2.6.33.4 x86_64)
=================================================================
System uname: Linux-2.6.33.4-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-1.12.13
Timestamp of tree: Sat, 14 Aug 2010 10:15:01 +0000
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
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 -pipe -march=core2"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://trumpetti.atm.tut.fi/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="-O"
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="/usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="3dnow X X509 a52 aac aalib acl acpi aim alsa amd64 apache2 apm audiofile bash-completion berkdb bidi bluetooth bmp branding bzip2 cairo calendar cddb cdinstall cdparanoia cdr cli consolekit cracklib crypt cups cxx dbus directfb dts dvd dvdr dvdread emboss encode exif expat fam ffmpeg firefox flac fortran ftp gdbm gif glitz gnutls gphoto2 gpm gtk hal hald iconv icq imagemagick imlib ipv6 jabber java javascript jpeg jpeg2k kerberos lame lcms libcaca libnotify lm_sensors mad matroska mcal mikmod mjpeg mmap mmx mng modules mp2 mp3 mp4 mpeg mplayer msn mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp oscar oss pam pango pcre pdf perl png posix ppds pppd pulseaudio python qt3support qt4 quicktim quicktime rdesktop readline reflection scanner sdl session sox spell spl sse sse2 ssl startup-notification svg sysfs tcpd theora tiff truetype unicode usb v4l v4l2 vcd videos vim vim-syntax vorbis wmf x264 xcb xine xml xorg xscreensaver xulrunner xv xvid" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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" ELIBC="glibc" FOO2ZJS_DEVICES="hp2600n" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia vesa" 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, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-08-16 02:45:27 UTC
I guess it all depends on what `equery depends virtual/jdk' tells you.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-08-27 16:55:37 UTC
(In reply to comment #1)
> I guess it all depends on what `equery depends virtual/jdk' tells you.

That was a kind of question. Could you answer it and reopen, please?
Comment 3 xo0ox 2010-08-27 17:40:59 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > I guess it all depends on what `equery depends virtual/jdk' tells you.
> 
> That was a kind of question. Could you answer it and reopen, please?
> 

Sorry, that i misunderstood it. Here is the output.

# equery depends virtual/jdk
[ Searching for packages depending on virtual/jdk... ]
dev-java/ant-core-1.7.1-r4 (>=virtual/jdk-1.4)
dev-java/antlr-2.7.7 (>=virtual/jdk-1.3)
dev-java/bcprov-1.40 (>=virtual/jdk-1.5)
dev-java/commons-cli-1.2 (>=virtual/jdk-1.4)
dev-java/gjdoc-0.7.9-r2 (>=virtual/jdk-1.4)
dev-java/json-simple-20080420 (>=virtual/jdk-1.4)
dev-java/log4j-1.2.15-r2 (>=virtual/jdk-1.4)
dev-java/swt-3.5.2 (>=virtual/jdk-1.4)
dev-libs/protobuf-2.3.0-r1 (java? >=virtual/jdk-1.5)
dev-libs/soprano-2.4.4 (java? >=virtual/jdk-1.6.0)
dev-vcs/subversion-1.6.11 (java? >=virtual/jdk-1.5)
media-libs/libpano13-2.9.14 (java? >=virtual/jdk-1.3)
media-libs/pdflib-7.0.2_p8 (java? >=virtual/jdk-1.4)
net-dns/libidn-1.19 (java? >=virtual/jdk-1.4)
net-libs/xulrunner-1.9.2.8-r1 (java? >=virtual/jdk-1.4)
net-p2p/vuze-4.3.1.4-r2 (>=virtual/jdk-1.5)
sys-libs/db-4.7.25_p4 (java? >=virtual/jdk-1.5)
sys-libs/db-4.8.30 (java? >=virtual/jdk-1.5)
virtual/jre-1.5.0 (=virtual/jdk-1.5.0*)
virtual/jre-1.6.0 (=virtual/jdk-1.6.0*)
www-client/firefox-3.6.8-r1 (java? >=virtual/jdk-1.4)
Comment 4 Maciej Mrozowski gentoo-dev 2010-08-31 15:28:36 UTC
equery depends doesn't seem to be affected by USE flags. It just dumps dependencies as they're specified in ebuilds. Portage however (--depclean) takes USE flags into consideration.
I guess this bug can be treated either as:
- feature request for equery
- invalid/wontfix, if equery is to list dependencies as they are specified and not as they are installed
Comment 5 xo0ox 2010-09-06 20:15:46 UTC
Portage deletes and installs these three packages every time i run "emerge --depclean" and "emerge -uND world". equery is not the problem.
Comment 6 Zac Medico gentoo-dev 2010-09-06 20:23:11 UTC
(In reply to comment #5)
> Portage deletes and installs these three packages every time i run "emerge
> --depclean" and "emerge -uND world". equery is not the problem.

Why didn't you mention that earlier? Please post the output of both commands with both --pretend and --debug options enabled.
Comment 7 xo0ox 2010-09-07 20:47:11 UTC
> Why didn't you mention that earlier? Please post the output of both commands
> with both --pretend and --debug options enabled.

Sorry, i thought this clear after my first post.


I will add the following files to this bugreport:

With the 3 mentioned packages installed (before depclean):
emerge-dcp emerge-uNDdp_world

Without them (after a depclean):
emerge-dcp2 emerge-uNDdp_world2
Comment 8 xo0ox 2010-09-07 20:52:22 UTC
Created attachment 246398 [details]
"emerge -dcp" and "emerge -uNDdp world" stdin and stdout 4 files
Comment 9 Zac Medico gentoo-dev 2010-09-08 02:12:10 UTC
--depclean shows this:

Candidates: virtual/jdk-1.5.0: ['=dev-java/sun-jdk-1.5.0*']

while the update command shows this:

Candidates: virtual/jdk-1.5.0: ['=dev-java/ibm-jdk-bin-1.5.0*']

I guess you have sun-jdk-1.5.0 masked somehow, maybe by license. Please post the output of this command:

  emerge -pv '=dev-java/sun-jdk-1.5.0*'
Comment 10 xo0ox 2010-09-08 15:52:24 UTC
> Please post the output of this command:
> 
>   emerge -pv '=dev-java/sun-jdk-1.5.0*'


# emerge -pv '=dev-java/sun-jdk-1.5.0*'

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy "=dev-java/sun-jdk-1.5.0*" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-java/sun-jdk-1.5.0.22-r1 (masked by: package.mask)
/usr/portage/profiles/package.mask:
# Vlastimil Babka <caster@gentoo.org> (30 Jun 2010)
# Masked for removal due to EOL and security, bug #292001.
# Do this to avoid pulling other 1.5 JDK:
#   emerge -av --depclean sun-jdk:1.5 jdk:1.5 jre:1.5



For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.



Additional:
grep -v "^#" /etc/portage/*|grep java
/etc/portage/package.use:app-emulation/emul-linux-x86-java X alsa nsplugin
/etc/portage/package.use:dev-java/sun-jre-bin X alsa nsplugin
/etc/portage/package.use:www-client/firefox javascript java mozdevelop
Comment 11 Zac Medico gentoo-dev 2010-09-08 17:09:43 UTC
The masked sun-jdk package is supposed to be rejected in this part of depgraph._dep_check_composite_db._visible():

		if pkg.installed and not pkg.visible:
			return False

I'll have to do some debugging to find out why this case isn't handled correctly. On a side, not, it seems like the above pkg.visible check should be wrapped with self._pkg_visibility_check().
Comment 13 xo0ox 2010-09-08 20:26:38 UTC
> This is fixed in git:

I installed the git version and now portage works as expected.
Thank you for this fix!

Comment 14 Zac Medico gentoo-dev 2010-09-08 22:24:11 UTC
Thanks for testing. This is fixed in 2.1.9.2 and 2.2_rc78.
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-19 09:02:38 UTC
*** Bug 338000 has been marked as a duplicate of this bug. ***