When remerging an already installed package, portage no longer unmerges the old installed instance. I had a look in /usr/lib/python-2.2/portage.py and found that the 'dblink' class gets confused about the packages dbdir while it is merged. When it tries to read the old CONTENTS file and when unmerge() is called the dbdir is set to the new instance's temporary dbdir, so no unmerge happens. This can cause problems when remerging a package with different USE flags.... Reproducible: Always Steps to Reproduce: 1. emerge a package. 2.emerge the package again. 3. Actual Results: Portage does not even try to unmerge the already installed package. Expected Results: Portage unmerges the already installed package. kira root # emerge info Portage 2.0.49-r10 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r1, 2.4.23_pre6-gss-r1) ================================================================= System uname: 2.4.23_pre6-gss-r1 i686 Pentium III (Katmai) Gentoo Base System version 1.4.3.10p1 distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-mcpu=i686 -march=pentium3 -O3 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/ kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/cvs/share/config /usr/ share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/ share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-mcpu=i686 -march=pentium3 -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs sandbox ccache digest" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/ pub/Linux/distributions/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://servus/gentoo-portage" USE="x86 apm avi crypt cups encode foomaticdb gif jpeg libg++ mad mpeg ncurses pdflib png quicktime spell truetype xml2 xmms xv zlib alsa gdbm berkdb readline arts tetex java mysql X sdl gpm pam libwww ssl perl python imlib oggvorbis qt kde opengl cdr acpi apache2 dga doc dvd gd lcms lirc maildir nptl radeon samba sse tiff xinerama xosd -oss -gnome -mikmod -nls -svga -slang -tcpd -esd -gtk -motif"
This patch works around the problem: --- /root/portage.py 2003-10-10 13:37:47.000000000 +0200 +++ /usr/lib/python2.2/site-packages/portage.py 2003-10-10 13:44:34.000000000 +0 @@ -4647,7 +4647,10 @@ lcfile.write(str(counter)) lcfile.close() # get old contents info for later unmerging + olddbdir = self.dbdir + self.dbdir = self.dbpkgdir oldcontents=self.getcontents() + self.dbdir = olddbdir # run preinst script if myebuild: # if we are merging a new ebuild, use *its* pre/postinst @@ -4702,7 +4705,10 @@ print if (oldcontents): print ">>> Safely unmerging already-installed instance.. + olddbdir = self.dbdir + self.dbdir = self.dbpkgdir self.unmerge(oldcontents,trimworld=0) + self.dbdir = olddbdir print ">>> original instance of package unmerged safely. # copy "info" files (like SLOT, CFLAGS, etc.) into the database for x in listdir(inforoot):
Aehm............ Two days after report a bug exactly this portage version is marked stable??????
I also had this issue with letting portage downgrade a package I previously had accepted ~x86 on. Portage kept both versions installed, which caused numerous file collisions. It also led to fun stuff like: !!! Invalid db entry: /var/db/pkg/media-video/ogle-0.9.1.portage_lockfile when trying to unmerge the duplicates manually. emerge info: Portage 2.0.49-r10 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-gentoo-r6) ================================================================= System uname: 2.4.20-gentoo-r6 i686 AMD Athlon(tm) XP 2000+ Gentoo Base System version 1.4.3.10p1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-mcpu=athlon-xp -O2 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-mcpu=athlon-xp -O2 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox ccache autoaddcvs" GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://gentoo.oregonstate.edu" MAKEOPTS="-j1" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 oss apm crypt foomaticdb libg++ libwww mad mikmod nls quicktime spell xmms zlib gdbm berkdb slang svga java guile sdl gpm tcpd pam esd qt kde motif mozilla 3dnow mmx aalib cdr cups fbcon maildir ncurses pda readline sasl ssl perl python postgresql xml xml2 X xv gtk gtkhtml gnome -arts truetype gif imlib jpeg pdflib png tiff avi dvd encode mpeg opengl oggvorbis"
I apparently missed this bug before marking it stable. :-/ It's fixed and out stable now.