diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | current-packages | 2 | ||||
-rw-r--r-- | sys-apps/portage/files/ebuild | 9 | ||||
-rw-r--r-- | sys-apps/portage/files/portage.py | 96 | ||||
-rw-r--r-- | sys-apps/portage/portage-1.2.ebuild (renamed from sys-apps/portage/portage-1.1.ebuild) | 2 |
5 files changed, 103 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog index d835ea6e4843..225593ee2777 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ date 24 Nov 2000 +upd sys-apps/portage-1.1 to 1.2 +drobbins +Portage now supports the PROVIDES variable and virtual +packages + upd media-sound/alsa-utils-0.5.9b to 0.5.9b-r1 drobbins Now includes an rc script to store/restore ALSA volume diff --git a/current-packages b/current-packages index 33e7b8ee3f3b..3621f6a82278 100644 --- a/current-packages +++ b/current-packages @@ -367,7 +367,7 @@ ./sys-apps/most/most-4.9.0-r1.ebuild ./sys-apps/net-tools/net-tools-1.57-r1.ebuild ./sys-apps/netkit-base/netkit-base-0.17-r1.ebuild -./sys-apps/portage/portage-1.1.ebuild +./sys-apps/portage/portage-1.2.ebuild ./sys-apps/procps/procps-2.0.7-r1.ebuild ./sys-apps/psmisc/psmisc-19-r1.ebuild ./sys-apps/raidtools/raidtools-0.90-r1.ebuild diff --git a/sys-apps/portage/files/ebuild b/sys-apps/portage/files/ebuild index 136e7d1e36e1..94d7620a0da6 100644 --- a/sys-apps/portage/files/ebuild +++ b/sys-apps/portage/files/ebuild @@ -19,6 +19,7 @@ source /etc/profile export PATH=/usr/lib/portage/bin:${PATH} eval `import-settings PROXY HTTP_PROXY FTP_PROXY FETCHCOMMAND PACKAGE DEBUG MAKEOPTS USE MAINTAINER CHOST CFLAGS CXXFLAGS PORTDIR DISTDIR BUILD_PREFIX PKGDIR RPMDIR PLATFORM ROOT GENTOO_MIRRORS` export DEPEND +export PROVIDES initvars() { export DESTTREE=/usr @@ -563,7 +564,13 @@ dyn_install() { prepall install -d -m0700 ${D}var/db/pkg/${CATEGORY}/${PF} cp ${STARTDIR}/${EBUILD} ${D}var/db/pkg/${CATEGORY}/${PF} - echo ">>> Completed installing into ${D}" + local x + #create provides database + for x in $PROVIDES + do + echo "$x" >> ${D}var/db/pkg/${CATEGORY}/${PF}/PROVIDES + done + echo ">>> Completed installing into ${D}" echo cd ${BUILDDIR} trap SIGINT SIGQUIT diff --git a/sys-apps/portage/files/portage.py b/sys-apps/portage/files/portage.py index 87c9a20ad069..c14119002f6e 100644 --- a/sys-apps/portage/files/portage.py +++ b/sys-apps/portage/files/portage.py @@ -72,7 +72,7 @@ categories=("app-admin", "app-arch", "app-cdr", "app-doc", "app-editors", "app-e "gnome-office","kde-apps", "kde-base", "kde-libs", "media-gfx", "media-libs", "media-sound", "media-video", "net-analyzer", "net-dialup", "net-fs", "net-ftp", "net-irc", "net-libs", "net-mail", "net-misc", "net-nds", "net-print", "net-www", "packages", "sys-apps", "sys-devel", "sys-kernel", "sys-libs", "x11-base", "x11-libs", - "x11-terms", "x11-wm") + "x11-terms", "x11-wm","virtual") def gen_archnames(): "generate archive names from URL list" @@ -227,6 +227,42 @@ def merge(mycategory,mypackage,mystart): outfile=open(contentsfile,"w") mergefiles(outfile,mystart) outfile.close() + + #begin provides/virtual package code + mypfn=root+"var/db/pkg/"+mycategory+"/"+mypackage+"/PROVIDES" + if os.path.exists(mypfn): + #this package provides some (possibly virtual) packages + mypfile=open(mypfn,"r") + myprovides=mypfile.readlines() + mypfile.close() + for x in myprovides: + #remove trailing newline + x=x[:-1] + mypsplit=string.split(x,"/") + if len(mypsplit)!=2: + print "!!! Invalid PROVIDES string:",x + sys.exit(1) + providesdir=root+"var/db/pkg/"+x + if os.path.exists(providesdir): + #if there's a non-virtual package there, we won't overwrite it + #if it's a virtual package, we'll claim it as our own + if not os.path.exists(providesdir+"/VIRTUAL"): + #non-virtual, skip it + print ">>> Existing package",x,"is non-virtual; skipping" + continue + if not os.path.exists(providesdir): + if not os.path.exists(root+"var/db/pkg/"+mypsplit[0]): + os.mkdir(root+"var/db/pkg/"+mypsplit[0]) + os.mkdir(providesdir) + #create empty contents file + mytouch=open(providesdir+"/CONTENTS","w") + mytouch.close() + #create virtual file containing name of this package + myvirtual=open(providesdir+"/VIRTUAL","w") + myvirtual.write(mycategory+"/"+mypackage+"\n") + myvirtual.close() + #end provides/virtual package code + print print ">>>",mypackage,"merged." print @@ -246,6 +282,38 @@ def unmerge(category,pkgname): except: print "Error -- could not open CONTENTS file for", pkgname+". Aborting." return + + #begin virtual/provides package code + mypname=root+"var/db/pkg/"+category+"/"+pkgname+"/PROVIDES" + if os.path.exists(mypname): + mypfile=open(mypname,"r") + myprovides=mypfile.readlines() + mypfile.close() + pos=0 + for x in myprovides: + #zap trailing newline + x=x[:-1] + if len(x)==0: + continue + #zap virtual packages + if os.path.isdir(root+"var/db/pkg/"+x): + if os.path.exists(root+"var/db/pkg/"+x+"/VIRTUAL"): + #this is a virtual package, we can zap it if it contains our package name + myvirtual=open(root+"var/db/pkg/"+x+"/VIRTUAL","r") + myvpkgname=myvirtual.readlines()[0][:-1] + if myvpkgname != (category+"/"+pkgname): + print ">>> Virtual package",x,"has been claimed by another package, skipping." + continue + zapme=os.listdir(root+"var/db/pkg/"+x) + for y in zapme: + os.unlink(root+"var/db/pkg/"+x+"/"+y) + os.rmdir(root+"var/db/pkg/"+x) + #virtual package removed + else: + print ">>>",x,"(provided by",category+"/"+pkgname+") is not a virtual package, keeping." + continue + #end virtual/provides package code + pkgfiles={} for line in contents.readlines(): mydat=string.split(line) @@ -287,15 +355,19 @@ def unmerge(category,pkgname): # in the CONTENTS file. We'll do after everything else has # completed successfully. myebuildfile=os.path.normpath(root+"var/db/pkg/"+category+"/"+pkgname+"/"+pkgname+".ebuild") - if pkgfiles.has_key(myebuildfile): - del pkgfiles[myebuildfile] - + if os.path.exists(myebuildfile): + if pkgfiles.has_key(myebuildfile): + del pkgfiles[myebuildfile] + else: + myebuildfile=None + mykeys=pkgfiles.keys() mykeys.sort() mykeys.reverse() #prerm script - pkgscript("prerm",myebuildfile) + if myebuildfile: + pkgscript("prerm",myebuildfile) for obj in mykeys: obj=os.path.normpath(obj) @@ -353,7 +425,8 @@ def unmerge(category,pkgname): print "<<< ","dev",obj #postrm script - pkgscript("postrm",myebuildfile) + if myebuildfile: + pkgscript("postrm",myebuildfile) #recursive cleanup for thing in os.listdir(root+"var/db/pkg/"+category+"/"+pkgname): os.unlink(root+"var/db/pkg/"+category+"/"+pkgname+"/"+thing) @@ -620,7 +693,7 @@ def isjustname(mypkg): def isspecific(mypkg): mysplit=string.split(mypkg,"/") - if len(mysplit)>1: + if len(mysplit)==2: if not isjustname(mysplit[1]): return 1 return 0 @@ -1151,7 +1224,14 @@ def port_insttree(): if not os.path.isdir(os.getcwd()+"/"+x): continue for y in os.listdir(os.getcwd()+"/"+x): - fullpkg=x+"/"+y + if x=="virtual": + #virtual packages don't require versions, if none is found, add a "1.0" to the end + if isjustname(y): + fullpkg=x+"/"+y+"-1.0" + else: + fullpkg=x+"/"+y + else: + fullpkg=x+"/"+y mysplit=catpkgsplit(fullpkg) mykey=x+"/"+mysplit[1] if not installeddict.has_key(mykey): diff --git a/sys-apps/portage/portage-1.1.ebuild b/sys-apps/portage/portage-1.2.ebuild index 1c92811b5d22..1e8eb02c91c9 100644 --- a/sys-apps/portage/portage-1.1.ebuild +++ b/sys-apps/portage/portage-1.2.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2000 Gentoo Technologies, Inc. Distributed under the terms # of the GNU General Public License, v2 or later Author Daniel Robbins # <drobbins@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-1.1.ebuild,v 1.1 2000/11/25 01:07:27 drobbins Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-1.2.ebuild,v 1.1 2000/11/25 06:13:56 drobbins Exp $ A="" S=${WORKDIR}/${P} |