aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Jones <carpaski@gentoo.org>2003-07-02 03:23:36 +0000
committerNicholas Jones <carpaski@gentoo.org>2003-07-02 03:23:36 +0000
commita492930afb95653eeb09e277cac74d27309c9ac2 (patch)
treef33a4b1d5c51cb082036307c04d9460b78a564ea
parentmanpage for perl-module eclass (diff)
downloadportage-cvs-a492930afb95653eeb09e277cac74d27309c9ac2.tar.gz
portage-cvs-a492930afb95653eeb09e277cac74d27309c9ac2.tar.bz2
portage-cvs-a492930afb95653eeb09e277cac74d27309c9ac2.zip
portage-2.0.48-r3
Fixed for the tuple-traceback and mutliple overlay support
-rw-r--r--ChangeLog73
-rwxr-xr-xbin/ebuild.sh7
-rwxr-xr-xbin/emerge4
-rw-r--r--pym/portage.py110
4 files changed, 117 insertions, 77 deletions
diff --git a/ChangeLog b/ChangeLog
index 171e1b8..59d1357 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,33 +1,50 @@
# ChangeLog for Portage; the Gentoo Linux ports system
# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Id: ChangeLog,v 1.459 2003/06/30 06:43:38 carpaski Exp $
+# $Id: ChangeLog,v 1.460 2003/07/02 03:23:35 carpaski Exp $
+
+*portage-2.0.48-r2 (29 Jun 2003): Fixes and Multiple Overlays
+
+ 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Fixed the
+ commands for tar.
+
+ 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Mode the chdir
+ to fix the spanky bugs down to post_emerge to fix the "can't merge an
+ ebuild file with an absolute path" bug.
+
+ 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added function
+ suffix_array(array,suffix) which takes an array and adds suffix to the end
+ of each element. Added 'cd / ;' into the getstatusoutput() calls to ldconfig.
+ Added a check so that portage doesn't try to add files/dir from a non-cvs
+ directory. Added 'manifest' target to ebuild/portage to only adjust the
+ manifest. Added Multiple overlay support -- Should be fairly thorough --
+ needs more debug though. Fixed portdbapi::new_protect_filename().
*portage-2.0.48-r2 (29 Jun 2003): Cleanups and Fixes (testing)
29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Lots of
- consistency cleanups. Added more files to the var/db data for future
- use. Added more die conditions to failure points. Fixed/Hacked a fix
- into the inherit-not-dieing problem. Set TMPDIR and TMP globally. Added
- notice for multiple inheritance. Fixed inheritance problem with multiple
- inheritance clobbering previous list of eclasses. Basic support for
- multiple overlays added to ebuild.sh.
-
- 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> emerge: SRC_URI fix for
- 'rm /etc/*' problem. Spanky bug: chdir to / to avoid problems when merging
- from inside a builddir that gets deleted.
-
- 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Added notice
- for symlinks in cfg_prot setups.
-
- 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> repoman: complain if
- FEATURES=cvs not set.
-
- 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added in
- a work around for the 'USE=+useflag' users. Added support for nouserpriv
- via RESTRICT. Fix the bug with ROOTs with no previous file causing a TB
- from counter_tick(). Make symlinks follow config_protect just like normal
- files.
-
+ consistency cleanups. Added more files to the var/db data for future
+ use. Added more die conditions to failure points. Fixed/Hacked a fix
+ into the inherit-not-dieing problem. Set TMPDIR and TMP globally. Added
+ notice for multiple inheritance. Fixed inheritance problem with multiple
+ inheritance clobbering previous list of eclasses. Basic support for
+ multiple overlays added to ebuild.sh.
+
+ 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> emerge: SRC_URI fix for
+ 'rm /etc/*' problem. Spanky bug: chdir to / to avoid problems when merging
+ from inside a builddir that gets deleted.
+
+ 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Added notice
+ for symlinks in cfg_prot setups.
+
+ 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> repoman: complain if
+ FEATURES=cvs not set.
+
+ 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added in
+ a work around for the 'USE=+useflag' users. Added support for nouserpriv
+ via RESTRICT. Fix the bug with ROOTs with no previous file causing a TB
+ from counter_tick(). Make symlinks follow config_protect just like normal
+ files.
+
10 Jun 2003; Daniel Robbins <drobbins@gentoo.org> ebuild.sh, portage.py,
various commands in bin/, cnf/make.conf.mac, cnf/make.globals.mac:
Added preliminary Mac OS X/BSD support.
@@ -49,17 +66,17 @@
to a couple of rare bugs. Added some quoting to $S. Removed the DISTCC
hosts variable. Moved build-info's creation around so that it actually
works for non-portage-compiled merges.
-
+
29 May 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Quick fix for
the files-dir-not-added lack of notification. Added in a fix for a possible
security problem with the repoman commit messages and symlink-attacks.
-
+
29 May 2003; Nicholas Jones <carpaski@gentoo.org> cnf/*: Added in a diff
from 'Danny' that contained a SYNC cleanup and expanded explanation. :)
-
+
29 May 2003; Nicholas Jones <carpaski@gentoo.org> output.py: Fixed the
TitleBar and unset TERM issues.
-
+
29 May 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added new
functions to aid in determining virtuals. cpv_all() added to dbapi -- it
displays all versions instead of just package names -- cp_all() now calls
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d21ccde..b369363 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.132 2003/06/30 06:43:38 carpaski Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.133 2003/07/02 03:23:36 carpaski Exp $
if [ "$*" != "depend" ] && [ "$*" != "clean" ]; then
if [ -f ${T}/successful ]; then
@@ -277,7 +277,7 @@ unpack() {
tar ${tarvars} -xzf ${DISTDIR}/${x} || die "$myfail"
;;
tbz2)
- bzip2 -dc ${DISTDIR}/${x} | tar ${tarvars} -xf ${DISTDIR}/${x} || die "$myfail"
+ bzip2 -dc ${DISTDIR}/${x} | tar ${tarvars} -xf - || die "$myfail"
;;
ZIP|zip)
unzip -qo ${DISTDIR}/${x} || die "$myfail"
@@ -291,7 +291,7 @@ unpack() {
;;
bz2)
if [ "${y}" == "tar" ]; then
- bzip2 -dc ${DISTDIR}/${x} | tar ${tarvars} -xf ${DISTDIR}/${x} || die "$myfail"
+ bzip2 -dc ${DISTDIR}/${x} | tar ${tarvars} -xf - || die "$myfail"
else
bzip2 -dc ${DISTDIR}/${x} > ${x%.*} || die "$myfail"
fi
@@ -931,6 +931,7 @@ inherit() {
if [ -e "$olocation" ]; then
location="${olocation}"
debug-print " eclass exists: ${location}"
+ break
fi
done
fi
diff --git a/bin/emerge b/bin/emerge
index 7e84964..ff01699 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1,11 +1,10 @@
#!/usr/bin/env python2.2
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.214 2003/06/30 06:43:38 carpaski Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.215 2003/07/02 03:23:36 carpaski Exp $
import os
os.environ["PORTAGE_CALLER"]="emerge"
-os.chdir("/")
import sys,portage,emergehelp,xpak,string,re,commands,time,threading,shutil,traceback,atexit
from stat import *
@@ -1458,6 +1457,7 @@ def unmerge(unmerge_action, unmerge_files):
def post_emerge(retval=0):
auxpat=re.compile('^([^-]*)(-\d+)?\.info(-\d+)?(\.gz)?')
+ os.chdir("/")
global myopts
print
if "--pretend" in myopts:
diff --git a/pym/portage.py b/pym/portage.py
index cfda9b6..c115653 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1,7 +1,7 @@
# portage.py -- core Portage functionality
# Copyright 1998-2003 Daniel Robbins, Gentoo Technologies, Inc.
# Distributed under the GNU Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.325 2003/06/30 06:43:38 carpaski Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.326 2003/07/02 03:23:36 carpaski Exp $
VERSION="2.0.48_pre6"
@@ -93,6 +93,19 @@ def abssymlink(symlink):
mylink=mydir+"/"+mylink
return os.path.normpath(mylink)
+def suffix_array(array,suffix,doblanks=1):
+ """Appends a given suffix to each element in an Array/List/Tuple.
+ Returns a List."""
+ if type(array) not in [types.ListType, types.TupleType]:
+ raise TypeError, "List or Tuple expected. Got %s" % type(array)
+ newarray=[]
+ for x in array:
+ if x or doblanks:
+ newarray.append(x + suffix)
+ else:
+ newarray.append(x)
+ return newarray
+
dircache={}
def listdir(mypath,recursive=0,filesonly=0,ignorecvs=0,ignorelist=[],EmptyOnError=0):
"""List directory contents, using cache.
@@ -493,9 +506,9 @@ def env_update(makelinks=1):
# we can safely create links.
print ">>> Regenerating "+root+"etc/ld.so.cache..."
if makelinks:
- getstatusoutput("/sbin/ldconfig -r "+root)
+ getstatusoutput("cd / ; /sbin/ldconfig -r "+root)
else:
- getstatusoutput("/sbin/ldconfig -X -r "+root)
+ getstatusoutput("cd / ; /sbin/ldconfig -X -r "+root)
del specials["LDPATH"]
penvnotice ="# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n"
@@ -1262,9 +1275,10 @@ def digestgen(myarchives,overwrite=1,manifestonly=0):
os.makedirs(settings["FILESDIR"])
mycvstree=cvstree.getentries(pbasedir, recursive=1)
- if ("cvs" in features) and not cvstree.isadded(mycvstree,"files"):
- print ">>> Auto-adding files/ dir to CVS..."
- spawn("cd "+pbasedir+"; cvs add files",free=1)
+ if ("cvs" in features) and os.path.exists(pbasedir+"/CVS"):
+ if not cvstree.isadded(mycvstree,"files"):
+ print ">>> Auto-adding files/ dir to CVS..."
+ spawn("cd "+pbasedir+"; cvs add files",free=1)
if (not overwrite) and os.path.exists(digestfn):
return 1
@@ -1317,7 +1331,7 @@ def digestgen(myarchives,overwrite=1,manifestonly=0):
except Exception,e:
print e
- if "cvs" in features:
+ if "cvs" in features and os.path.exists(pbasedir+"/CVS"):
mycvstree=cvstree.getentries(pbasedir, recursive=1)
myunaddedfiles=""
if not manifestonly and not cvstree.isadded(mycvstree,digestfn):
@@ -1479,7 +1493,7 @@ def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0):
if mydo not in ["help","clean","prerm","postrm","preinst","postinst",
"config","touch","setup","depend","fetch","digest",
"unpack","compile","install","rpm","qmerge","merge",
- "package","unmerge"]:
+ "package","unmerge", "manifest"]:
print "!!! Please specify a valid command."
return 1
if not os.path.exists(myebuild):
@@ -1552,7 +1566,7 @@ def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0):
return myso[0]
# Build directory creation isn't required for any of these.
- if mydo not in ["digest"]:
+ if mydo not in ["digest","manifest"]:
try:
if ("nouserpriv" not in string.split(settings["RESTRICT"])):
if ("userpriv" in features) and (portage_uid and portage_gid):
@@ -1707,6 +1721,8 @@ def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0):
elif mydo=="digest":
#since we are calling "digest" directly, recreate the digest even if it already exists
return (not digestgen(checkme,overwrite=1))
+ if mydo=="manifest":
+ return (not digestgen(checkme,overwrite=1,manifestonly=1))
if not digestcheck(checkme, ("strict" in features)):
return 1
@@ -3250,7 +3266,8 @@ def eclass(myeclass=None,mycpv=None,mymtime=None):
if not mtimedb.has_key("starttime") or (mtimedb["starttime"]!=starttime):
mtimedb["starttime"]=starttime
# Update the cache
- for x in [settings["PORTDIR"]+"/eclass", settings["PORTDIR_OVERLAY"]+"/eclass"]:
+ ec_overlays = suffix_array(string.split(settings["PORTDIR_OVERLAY"]), "/eclass")
+ for x in [settings["PORTDIR"]+"/eclass"]+ec_overlays:
if x and os.path.exists(x):
dirlist = listdir(x)
for y in dirlist:
@@ -3326,8 +3343,8 @@ class portdbapi(dbapi):
#if the portdbapi is "frozen", then we assume that we can cache everything (that no updates to it are happening)
self.xcache={}
self.frozen=0
- #oroot="overlay root"
- self.oroot=None
+ #overlays="overlay roots"
+ self.overlays=[]
def finddigest(self,mycpv):
try:
@@ -3355,8 +3372,7 @@ class portdbapi(dbapi):
sys.exit(1)
psplit=pkgsplit(mysplit[1])
- if self.oroot:
- myloc=self.oroot+"/"+mysplit[0]+"/"+psplit[0]+"/"+mysplit[1]+".ebuild"
+ for myloc in suffix_array(self.overlays, "/"+mysplit[0]+"/"+psplit[0]+"/"+mysplit[1]+".ebuild"):
if os.access(myloc, os.R_OK):
return myloc,1
@@ -3581,10 +3597,10 @@ class portdbapi(dbapi):
if not cps:
#invalid cat/pkg-v
return 0
- if self.oroot:
- if os.path.exists(self.oroot+"/"+cps[0]+"/"+cps[1]+"/"+cps2[1]+".ebuild") or os.path.exists(self.oroot+"/"+cps[0]+"/"+cps[1]+"/"+cps2[1]+".ebuild"):
+ for o_cpv in suffix_array(self.overlays,"/"+cps[0]+"/"+cps[1]+"/"+cps2[1]+".ebuild"):
+ if os.path.exists(o_cpv):
return 1
- elif os.path.exists(self.root+"/"+cps[0]+"/"+cps[1]+"/"+cps2[1]+".ebuild"):
+ if os.path.exists(self.root+"/"+cps[0]+"/"+cps[1]+"/"+cps2[1]+".ebuild"):
return 1
return 0
@@ -3596,10 +3612,8 @@ class portdbapi(dbapi):
if y=="CVS":
continue
biglist.append(x+"/"+y)
- if self.oroot:
- for y in listdir(self.oroot+"/"+x,EmptyOnError=1):
- if y=="CVS":
- continue
+ for oroot in self.overlays:
+ for y in listdir(oroot+"/"+x,EmptyOnError=1,ignorecvs=1):
mykey=x+"/"+y
if not mykey in biglist:
biglist.append(mykey)
@@ -3610,8 +3624,8 @@ class portdbapi(dbapi):
for x in listdir(self.root+"/"+mycp,EmptyOnError=1):
if x[-7:]==".ebuild":
returnme.append(x[:-7])
- if self.oroot:
- for x in listdir(self.oroot+"/"+mycp,EmptyOnError=1):
+ for oroot in self.overlays:
+ for x in listdir(oroot+"/"+mycp,EmptyOnError=1,ignorecvs=1):
if x[-7:]==".ebuild":
mye=x[:-7]
if not mye in returnme:
@@ -3626,14 +3640,12 @@ class portdbapi(dbapi):
for x in list:
if x[-7:]==".ebuild":
returnme.append(mysplit[0]+"/"+x[:-7])
- if self.oroot:
- list=listdir(self.oroot+"/"+mycp,EmptyOnError=1)
- if list:
- for x in list:
- if x[-7:]==".ebuild":
- mycp=mysplit[0]+"/"+x[:-7]
- if not mycp in returnme:
- returnme.append(mycp)
+ for oroot in self.overlays:
+ for x in listdir(oroot+"/"+mycp,EmptyOnError=1,ignorecvs=1):
+ if x[-7:]==".ebuild":
+ mycp=mysplit[0]+"/"+x[:-7]
+ if not mycp in returnme:
+ returnme.append(mycp)
return returnme
def freeze(self):
@@ -4398,13 +4410,17 @@ class dblink:
continue
prot_num = prot_num + 1
+ new_pfile = os.path.normpath(real_dirname+"/._cfg"+string.zfill(prot_num,4)+"_"+real_filename)
+ old_pfile = os.path.normpath(real_dirname+"/"+last_pfile)
if last_pfile and newmd5:
if perform_md5(real_dirname+"/"+last_pfile) == newmd5:
- return os.path.normpath(real_dirname+"/"+last_pfile)
+ return old_pfile
else:
- return os.path.normpath(real_dirname+"/._cfg"+string.zfill(prot_num,4)+"_"+real_filename)
-
- return (real_dirname+"/._cfg"+string.zfill(prot_num,4)+"_"+real_filename, real_dirname+"/"+last_pfile)
+ return new_pfile
+ elif newmd5:
+ return new_pfile
+ else:
+ return (new_pfile, old_pfile)
def mergeme(self,srcroot,destroot,outfile,secondhand,stufftomerge,cfgfiledict,thismtime):
srcroot=os.path.normpath("///"+srcroot)+"/"
@@ -4459,9 +4475,9 @@ class dblink:
if self.isprotected(mydest):
# Use md5 of the target in ${D} if it exists...
if os.path.exists(os.path.normpath(srcroot+myabsto)):
- mydest = self.new_protect_filename(myrealdest, perform_md5(srcroot+myabsto))[0]
+ mydest = self.new_protect_filename(myrealdest, perform_md5(srcroot+myabsto))
else:
- mydest = self.new_protect_filename(myrealdest, perform_md5(myabsto))[0]
+ mydest = self.new_protect_filename(myrealdest, perform_md5(myabsto))
# if secondhand==None it means we're operating in "force" mode and should not create a second hand.
if (secondhand!=None) and (not os.path.exists(myrealto)):
@@ -4965,13 +4981,19 @@ if (secpass==2) and (not os.environ.has_key("SANDBOX_ACTIVE")):
#the new standardized db names:
portdb=portdbapi()
-if settings["PORTDIR_OVERLAY"]:
- if os.path.isdir(settings["PORTDIR_OVERLAY"]):
- portdb.oroot=settings["PORTDIR_OVERLAY"]
- else:
- sys.stderr.write("!!! PORTDIR_OVERLAY points to "+settings["PORTDIR_OVERLAY"]+"\n")
- sys.stderr.write("!!! which isn't a directory... Exiting.\n")
- sys.exit(1)
+overlays = string.split(settings["PORTDIR_OVERLAY"])
+if overlays:
+ portdb.overlays = overlays[:]
+ for ov in overlays:
+ if not os.path.isdir(ov):
+ sys.stderr.write(red("!!! Invalid PORTDIR_OVERLAY entry removed: "+ov+"\n"))
+ portdb.overlays.remove(ov)
+ os.environ["PORTDIR_OVERLAY"] = string.join(portdb.overlays)
+ settings["PORTDIR_OVERLAY"] = string.join(portdb.overlays)
+else:
+ portdb.overlays = []
+del overlays
+
#continue setting up other trees
db["/"]["porttree"]=portagetree("/",virts)