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

Bug 155477

Summary: Traceback while running --depclean
Product: Portage Development Reporter: UncleOwen <anakin.skyw>
Component: UnclassifiedAssignee: Portage team <dev-portage>
Status: VERIFIED FIXED    
Severity: normal Keywords: InVCS, REGRESSION
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 147007    

Description UncleOwen 2006-11-17 05:39:45 UTC
When running emerge --depclean --with-bdeps=n while another emerge is running, portage produces a traceback. This does not happen when I leave out the --with-bdeps=n

I know that depcleaning while emerging something else is probably not a good idea, but portage should at least give a nice error message.

$ emerge -vp --depclean --with-bdeps=n

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

Calculating dependencies      ... done!

Traceback (most recent call last):
  File "/usr/bin/emerge", line 4665, in <module>
    retval = emerge_main()
  File "/usr/bin/emerge", line 4653, in emerge_main
    myopts, spinner)
  File "/usr/bin/emerge", line 3942, in action_depclean
    unmerge(settings, myopts, vartree, "unmerge", cleanlist, ldpath_mtimes)
  File "/usr/bin/emerge", line 2696, in unmerge
    os.path.join(settings["ROOT"], portage.VDB_PATH))
  File "/usr/lib/portage/pym/portage_locks.py", line 21, in lockdir
    return lockfile(mydir,wantnewlockfile=1)
  File "/usr/lib/portage/pym/portage_locks.py", line 53, in lockfile
    myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660)
OSError: [Errno 13] Permission denied: '/var/db/pkg.portage_lockfile'

$ emerge --info
Portage 2.1.2_rc1-r7 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.17-gentoo-r8-20060912 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8-20060912 x86_64 AMD Athlon(tm) 64 Processor 3700+
Gentoo Base System version 1.12.6
Last Sync: Fri, 17 Nov 2006 12:50:01 +0000
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.4, 2.5-r1
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=k8 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical"
FEATURES="autoconfig candy distlocks metadata-transfer parallel-fetch sandbox sfperms strict userpriv userpriv_fakeroot usersandbox"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/local"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="amd64 X aac alsa bitmap-fonts bzip2 cairo cdinstall cdr cjk cli cracklib crypt cups dbus dlloader dri dvb dvd dvdr elibc_glibc emboss encode fam firefox flac fortran gif gpm gstreamer gtk gtk2 hal iconv input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux ldap libg++ mad mikmod mp3 mpeg mplayer ncurses nls nptl nptlonly nvidia ogg opengl pam pcre perl png ppds pppd python qt3 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev unicode userland_GNU userlocales video_cards_nv video_cards_vga vorbis xine xml xorg xv zlib"
Unset:  CTARGET, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Zac Medico gentoo-dev 2006-11-17 06:08:49 UTC
I noticed this myself a couple of days ago and fixed it in svn r5053.  It only happens if the user running portage doesn't have write access to /var/db.
Comment 2 Zac Medico gentoo-dev 2006-11-17 20:54:07 UTC
This has been released in 2.1.2_rc2.
Comment 3 UncleOwen 2006-11-18 02:20:06 UTC
Thanks.