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

Bug 89512

Summary: ebuild wont unpacka package it has unmerged
Product: Portage Development Reporter: Simon Maynard <ma2snm>
Component: UnclassifiedAssignee: Portage team <dev-portage>
Status: RESOLVED INVALID    
Severity: major    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://forums.gentoo.org/viewtopic-t-325088-highlight-.html
Whiteboard:
Package list:
Runtime testing required: ---

Description Simon Maynard 2005-04-18 04:34:04 UTC
If I unmerge something using the ebuild tool and then try to merge it again, I get an error telling me that the ebuild is no longer in /var/db/pkg. Here is some output demonstrating the problem,
Beast simon # ebuild /usr/portage/app-arch/unrar/unrar-3.4.3.ebuild unmerge
No package files given... Grabbing a set.
<<<        obj /usr/share/doc/unrar-3.4.3/readme.txt.gz
<<<        obj /usr/bin/unrar
<<<        dir /usr/share/doc/unrar-3.4.3
--- !empty dir /usr/share/doc
--- !empty dir /usr/share
--- !empty dir /usr/bin
--- !empty dir /usr
Traceback (most recent call last):
  File "/usr/bin/ebuild", line 57, in ?
    portage_util.writemsg("Could not run the required binary?\n")
NameError: name 'portage_util' is not defined
Beast simon # ebuild /usr/portage/app-arch/unrar/unrar-3.4.3.ebuild merge
Disabling noauto in features... merge disables it. (qmerge doesn't)
>>> md5 src_uri ;-) unrarsrc-3.4.3.tar.gz
/usr/lib/portage/bin/ebuild.sh: line 1686: /var/db/pkg/app-arch/unrar-3.4.3/unrar-3.4.3.ebuild: No such file or directory

!!! ERROR: app-arch/unrar-3.4.3 failed.
!!! Function , Line 1686, Exitcode 1
!!! error sourcing ebuild
!!! If you need support, post the topmost build error, NOT this status message.

If you clean out /var/tmp/portage, the problem disappears.

Reproducible: Always
Steps to Reproduce:
1.Unmerge a package using ebuild
2.Try and merge the package using ebuild
3.

Actual Results:  
Ebuild would not merge the package again without an rm -rf /var/tmp/portage/

Expected Results:  
Ebuild should merge the package succesfully

Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.4.20041102-r1, 2.6.11.5 i686)
=================================================================
System uname: 2.6.11.5 i686 AMD Athlon(tm) MP 2800+
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb 12 2005, 23:40:50)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://194.117.143.71/mirrors/gentoo"
LANG="en_GB"
LC_ALL="en_GB"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="x86 3dnow X acpi alsa apache2 apm avi bash-completion berkdb bitmap-fonts
bonobo bzlib cdr crypt cups curl divx4linux doc dvd emboss encode esd fam
foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk gtk2 gtkhtml imagemagick
imlib ipv6 java jikes joystick jpeg junit libg++ libwww mad maildir mikmod mmx
motif mozilla mp3 mpeg msn ncurses nls nocd ntpl offensive ogg oggvorbis openal
opengl oss pam pdflib perl pic png python quicktime readline samba sdl slang
spell sse ssl svga tcpd tetex tiff truetype truetype-fonts type1-fonts usb
videos vorbis xml xml2 xmms xosd xv xvid zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LINGUAS
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-04-18 05:54:27 UTC
your ebuild foo unmerge tracebacks, which scares me quite a bit.  In my copy of ebuild ( /usr/lib/portage/bin/ebuild ) there is an include portage_util that shoudl cover the traceback.  Of course this is indicative of something else wrong, since portage is trying to print an error message about not being able to run the required binary.  This portion that cannot be run could potentially be an important part of the program.  However, it could also have nothing to do with it but the traceback bugs me regardless.  Could you post your emerge info?  can you reproduce this with any other package or just unrar?

I can reproduce the "Could not run the required Binary?" message on my system but not the /var/db/pkg error.
Comment 2 Simon Maynard 2005-04-18 06:25:09 UTC
I posted my emerge --info in the first post. I just did an import portage_util into ebuild and got rid of the traceback, although the error message ("Could not run the required binary?") was still there. I then did an emerge portage and the new portage ( sys-apps/portage-2.0.51.19 ) is missing the import portage_util in /usr/lib/portage/bin/ebuild, so the traceback appears again.

I can reproduce this problem with many packages, and someone on the forums can also ( see http://forums.gentoo.org/viewtopic-t-325088-highlight-.html ). I have never had it work correctly, but during testing I am only doing it on smaller packages such as bin2iso and unrar to avoid recompiling large packages.
Comment 3 Jason Stubbs (RETIRED) gentoo-dev 2005-04-18 06:48:08 UTC
Invalid. This is correct behaviour. ebuild is not a tool for general system management. It is a tool to run individual ebuild phases. If you want to unpack an ebuild, you need to run the clean phase first.
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-04-19 20:18:35 UTC
Just a note that the missing portage_util appears to be InCVS also ;)