aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-04-24 12:49:01 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-04-24 12:49:01 +0000
commitb64f23246a01214b148080078c08804d66a341df (patch)
treef241b41735b3fa6f2755788dc41b122e5aff37f5
parentforward port fix for bug 77794 (diff)
downloadportage-cvs-b64f23246a01214b148080078c08804d66a341df.tar.gz
portage-cvs-b64f23246a01214b148080078c08804d66a341df.tar.bz2
portage-cvs-b64f23246a01214b148080078c08804d66a341df.zip
Removed support for --inject and --upgradeonly as well as the now unused
digraph class.
-rw-r--r--ChangeLog6
-rwxr-xr-xbin/emerge93
-rw-r--r--pym/portage.py92
3 files changed, 12 insertions, 179 deletions
diff --git a/ChangeLog b/ChangeLog
index d7ef73e..ced4d9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,16 @@
# ChangeLog for Portage; the Gentoo Linux ports system
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Id: ChangeLog,v 1.951 2005/04/23 14:05:28 genone Exp $
+# $Id: ChangeLog,v 1.952 2005/04/24 12:49:01 jstubbs Exp $
MAJOR CHANGES in 2.0.51:
1. /var/cache/edb/virtuals is no longer used at all. It's calculated now.
2. /var/cache/edb/world is now /var/lib/portage/world.
3. /etc/portage/profile/virtuals is _USER_ configs only.
+ 24 Apr 2005; Jason Stubbs <jstubbs@gentoo.org> bin/emerge pym/portage.py:
+ Removed support for --inject and --upgradeonly as well as the now unused
+ digraph class.
+
23 Apr 2005; Marius Mauch <genone@gentoo.org> pym/ebuild.py:
forward port fix for bug 77794.
diff --git a/bin/emerge b/bin/emerge
index 8994920..f3d1341 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1,7 +1,7 @@
#!/usr/bin/python -O
# Copyright 1999-2004 Gentoo Foundation
# 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.378 2005/04/08 01:19:55 genone Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.379 2005/04/24 12:49:01 jstubbs Exp $
import os,sys
os.environ["PORTAGE_CALLER"]="emerge"
@@ -163,7 +163,7 @@ options=[
"--searchdesc", "--selective",
"--skipfirst",
"--tree",
-"--update", "--upgradeonly",
+"--update",
"--usepkg", "--usepkgonly",
"--verbose", "--version"
]
@@ -178,7 +178,6 @@ shortmapping={
"f":"--fetchonly", "F":"--fetch-all-uri",
"g":"--getbinpkg", "G":"--getbinpkgonly",
"h":"--help",
-"i":"--inject",
"k":"--usepkg", "K":"--usepkgonly",
"l":"--changelog",
"n":"--noreplace", "N":"--newuse",
@@ -187,7 +186,7 @@ shortmapping={
"q":"--quiet",
"s":"--search", "S":"--searchdesc",
't':"--tree",
-"u":"--update", "U":"--upgradeonly",
+"u":"--update",
"v":"--verbose", "V":"--version"
}
@@ -285,7 +284,7 @@ if "moo" in myfiles:
(__)\ )\/\
||----w |
|| ||
-
+
"""
if (myaction in ["world", "system"]) and myfiles:
@@ -338,17 +337,6 @@ if ("--getbinpkg" in myopts) and not ("--usepkg" in myopts):
if ("--usepkgonly" in myopts) and not ("--usepkg" in myopts):
myopts.append("--usepkg")
-# Print deprecation warning for -U
-if ("--upgradeonly" in myopts):
- print
- print red("*** Warning: --upgradeonly is a deprecated option in portage-"+portage.VERSION)
- print red("*** and will likely be removed in a future version.")
- print
- # Also allow -U to apply --update/-u
- if not ("--update" in myopts):
- print ">>> --upgradeonly implies --update... adding --update to options."
- myopts.append("--update")
-
# Also allow -l to apply --pretend/-p, but if already in --ask mode
if ("--changelog" in myopts) and not (("--pretend" in myopts) or ("--ask" in myopts)):
print ">>> --changelog implies --pretend... adding --pretend to options."
@@ -387,16 +375,6 @@ if portage.settings["CLEAN_DELAY"]:
if portage.settings["EMERGE_WARNING_DELAY"]:
EMERGE_WARNING_DELAY = int("0"+portage.settings["EMERGE_WARNING_DELAY"])
-if "inject" == myaction:
- print
- print red("*** --inject has been deprecated.")
- print red("*** If you manage a piece of software yourself, add it's name and")
- print red("*** version (eg foo/bar-1.0) to /etc/portage/profile/package.provided.")
- print red("*** If you want to prevent portage from upgrading a package, add it to")
- print red("*** /etc/portage/package.mask prepending it with '>' (eg >foo/bar-1.0)")
- print red("*** For more information on fine-grained portage control, please see")
- print red("*** the portage man page.")
- print
def emergelog(mystr,short_msg=None):
if "notitles" not in portage.features:
@@ -1127,19 +1105,6 @@ class depgraph:
# We're true here unless we are missing binaries.
return (not missing,myfavorites)
- def is_newer_ver_installed(self,myroot,pkg,pkgver):
- "if there is a version of pkg installed newer than pkgver, return it"
- vardbapi=portage.db[myroot]["vartree"].dbapi
-
- matches=portage.db[myroot]["vartree"].dbapi.match(pkg)
- if matches:
- myslot=portage.db["/"]["porttree"].getslot(pkgver)
- for match in matches:
- if portage_versions.pkgcmp(portage_versions.catpkgsplit(pkgver)[1:], portage_versions.catpkgsplit(match)[1:]) < 0:
- curslot=portage.db[myroot]["vartree"].getslot(match)
- if curslot == myslot:
- return match
-
def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None):
"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure"
if "--debug" in myopts:
@@ -1262,22 +1227,6 @@ class depgraph:
else:
myeb_pkg = None
- if "--upgradeonly" in myopts:
- # Check that there isn't a newer version of this package already installed
- cand = None
- try:
- # XXX: This can throw an exception if the ebuild doesn't exist
- if myeb:
- cand=self.is_newer_ver_installed(myroot,x,myeb)
- elif myeb_pkg:
- cand=self.is_newer_ver_installed(myroot,x,myeb_pkg)
- except SystemExit, e:
- raise # Needed else can't exit
- except Exception, e:
- print "Warning: "+str(e)
- if cand:
- myeb=cand
-
if myeb:
myk=["ebuild",myroot,myeb]
elif myeb_pkg:
@@ -1360,11 +1309,6 @@ class depgraph:
#this is an unavailable world entry; just continue
continue
- if "--upgradeonly" in myopts:
- cand=self.is_newer_ver_installed(portage.root,mydep,myeb)
- if cand:
- myeb=cand
-
#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS
#if mydep2[0]=="!":, etc.
binpkguseflags = None
@@ -3299,35 +3243,6 @@ elif "search"==myaction:
print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment )
sys.exit(1)
searchinstance.output()
-elif "inject"==myaction:
- if not myfiles:
- print "emerge: please specify at least one cat/pkg-ver to inject."
- sys.exit(1)
- if "--pretend" in myopts:
- print "emerge: the \"inject\" action does not support \"--pretend.\""
- sys.exit(1)
- for x in myfiles:
- if x[0] in [">","<","=","!"]:
- print "!!! '"+x+"' is an invalid specification."
- print "!!! Must be 'category/package-version' with no other symbols."
- print
- continue
- mycps=portage_versions.catpkgsplit(x)
- if (not mycps) or (mycps[0]=="null"):
- print "!!!",x,"is not a specific cat/pkg-version, skipping..."
- continue
- if portage.db["/"]["vartree"].exists_specific(x):
- print "!!! Not injecting",x+"; Package already exists."
- else:
- if "--ask" in myopts:
- if userquery("Do you want to inject the package %s?" % x)=="No":
- print
- print "Quitting."
- print
- sys.exit(0)
- portage.db["/"]["vartree"].dbapi.cpv_inject(x)
- print ">>> Injected",x+"."
- emergelog(" === inject: "+x)
elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction:
if 1==unmerge(myaction, myfiles):
post_emerge()
diff --git a/pym/portage.py b/pym/portage.py
index 0c166d8..68c9122 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -2,10 +2,10 @@
# portage.py -- core Portage functionality
# Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.586 2005/04/12 22:37:12 vapier Exp $
-cvs_id_string="$Id: portage.py,v 1.586 2005/04/12 22:37:12 vapier Exp $"[5:-2]
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.587 2005/04/24 12:49:01 jstubbs Exp $
+cvs_id_string="$Id: portage.py,v 1.587 2005/04/24 12:49:01 jstubbs Exp $"[5:-2]
-VERSION="$Revision: 1.586 $"[11:-2] + "-cvs"
+VERSION="$Revision: 1.587 $"[11:-2] + "-cvs"
# ===========================================================================
# START OF IMPORTS -- START OF IMPORTS -- START OF IMPORTS -- START OF IMPORT
@@ -232,92 +232,6 @@ def tokenize(mystring):
return None
return newtokens
-#beautiful directed graph object
-
-class digraph:
- """
- beautiful directed graph object
- """
-
- def __init__(self):
- self.dict={}
- #okeys = keys, in order they were added (to optimize firstzero() ordering)
- self.okeys=[]
-
- def addnode(self,mykey,myparent):
- dico = self.dict
- if mykey not in dico:
- self.okeys.append(mykey)
- if myparent==None:
- dico[mykey]=[0,[]]
- else:
- dico[mykey]=[0,[myparent]]
- dico[myparent][0] += 1
- return
- if myparent and (not myparent in dico[mykey][1]):
- dico[mykey][1].append(myparent)
- dico[myparent][0] += 1
-
- def delnode(self,mykey):
- dico = self.dict
- if mykey not in dico:
- return
- for parent in dico[mykey][1]:
- dico[parent][0] -= 1
- del dico[mykey]
- self.okeys.remove(mykey)
-
- def allnodes(self):
- "returns all nodes in the dictionary"
- return self.dict.keys()
-
- def firstzero(self):
- "returns first node with zero references, or NULL if no such node exists"
- for x in self.okeys:
- if self.dict[x][0]==0:
- return x
- return None
-
- def depth(self, mykey):
- depth=0
- dico = self.dict
- while dico[mykey][1]:
- depth=depth+1
- mykey=dico[mykey][1][0]
- return depth
-
- def allzeros(self):
- "returns all nodes with zero references, or NULL if no such node exists"
- zerolist = []
- dico = self.dict
- for node in dico:
- mys = node.split()
- if mys[0] != "blocks" and dico[node][0]==0:
- zerolist.append( node )
- return zerolist
-
- def hasallzeros(self):
- "returns 0/1, Are all nodes zeros? 1 : 0"
- dico = self.dict
- for node in dico:
- if dico[node][0]!=0:
- return 0
- return 1
-
- def empty(self):
- if self.dict:
- return 0
- return 1
-
- def hasnode(self,mynode):
- return mynode in self.dict
-
- def copy(self):
- mygraph=digraph()
- for x in self.dict:
- mygraph.dict[x] = [ self.dict[x][0], self.dict[x][1][:] ]
- mygraph.okeys=self.okeys[:]
- return mygraph
def elog_process(cpv, mysettings):
mylogfiles = listdir(mysettings["T"]+"/logging/")