diff options
author | 2003-03-26 17:36:29 +0000 | |
---|---|---|
committer | 2003-03-26 17:36:29 +0000 | |
commit | b019e1b1e1db8dc4838f5b0a3d3846e938918f4f (patch) | |
tree | edba4f614a577f2703f330bf24ec936ce6c0264a | |
parent | repoman commit intelligence upgrade. (diff) | |
download | portage-cvs-b019e1b1e1db8dc4838f5b0a3d3846e938918f4f.tar.gz portage-cvs-b019e1b1e1db8dc4838f5b0a3d3846e938918f4f.tar.bz2 portage-cvs-b019e1b1e1db8dc4838f5b0a3d3846e938918f4f.zip |
Added mass_best_version to portageq.
-rw-r--r-- | ChangeLog | 5 | ||||
-rwxr-xr-x | bin/portageq | 19 |
2 files changed, 21 insertions, 3 deletions
@@ -1,6 +1,9 @@ # ChangeLog for Portage; the Gentoo Linux ports system # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/ChangeLog,v 1.441 2003/03/22 23:41:18 carpaski Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/ChangeLog,v 1.442 2003/03/26 17:36:29 alain Exp $ + + 26 Mar 2003; Alain Penders <alain@gentoo.org> portageq: added + mass_best_version method to help GUIs resolve best versions. *portage-2.0.47-r11 (22 Mar 2003): Fixes & Security -- Winding up 2.0 series. diff --git a/bin/portageq b/bin/portageq index 81d3c6e..3836369 100755 --- a/bin/portageq +++ b/bin/portageq @@ -1,7 +1,7 @@ #!/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/portageq,v 1.5 2003/03/03 21:35:54 alain Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/portageq,v 1.6 2003/03/26 17:36:29 alain Exp $ import sys,portage,types,string @@ -59,6 +59,21 @@ def best_version(argv): sys.exit(1) +def mass_best_version(argv): + """<root> [<category/package>]+ + Returns category/package-version (without .ebuild). + """ + if (len(argv) < 2): + print "ERROR: insufficient parameters!" + sys.exit(2) + try: + for pack in argv[1:]: + mylist=portage.db[argv[0]]["vartree"].dbapi.match(pack) + print pack+":"+portage.best(mylist) + except KeyError: + sys.exit(1) + + def match(argv): """<root> <category/package> Returns \n seperated list of category/package-version @@ -135,7 +150,7 @@ def envvar(argv): # def usage(): - rev="$Revision: 1.5 $" + rev="$Revision: 1.6 $" ver=string.split(rev, ' ')[1] print ">>> Portage information query tool -- version "+ver print ">>> Usage: portageq <command> [<option> ...]" |