summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Jones <carpaski@gentoo.org>2003-03-02 07:01:05 +0000
committerNicholas Jones <carpaski@gentoo.org>2003-03-02 07:01:05 +0000
commit1ad7b7b6b8e0ce61bb00b526e5f632716758f104 (patch)
tree5989e3f545f22a19a090ea7b9443eb947d7bd6f0
parenttest 3 (diff)
downloadportage-cvs-1ad7b7b6b8e0ce61bb00b526e5f632716758f104.tar.gz
portage-cvs-1ad7b7b6b8e0ce61bb00b526e5f632716758f104.tar.bz2
portage-cvs-1ad7b7b6b8e0ce61bb00b526e5f632716758f104.zip
Added in match()
-rwxr-xr-xbin/portageq23
1 files changed, 22 insertions, 1 deletions
diff --git a/bin/portageq b/bin/portageq
index b720820..c2b91ab 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.1 2003/02/23 23:10:03 alain Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/portageq,v 1.2 2003/03/02 07:01:05 carpaski Exp $
import sys,portage,types,string
@@ -59,6 +59,19 @@ def best_version(argv):
sys.exit(1)
+def match(argv):
+ """<root> <category/package>
+ Returns \n seperated list of category/package-version
+ """
+ if (len(argv) < 2):
+ print "ERROR: insufficient parameters!"
+ sys.exit(2)
+ try:
+ print string.join(portage.db[argv[0]]["vartree"].dbapi.match(argv[1]),"\n")
+ except KeyError:
+ sys.exit(1)
+
+
def gentoo_mirrors(argv):
"""
Returns the mirrors set to use in the portage configuration.
@@ -101,6 +114,14 @@ def pkgdir(argv):
print portage.settings["PKGDIR"]
+def envvar(argv):
+ """<variable>
+ Returns a specific environment variable as exists prior to ebuild.sh.
+ Similar to: emerge --verbose --info | egrep '^<variable>='
+ """
+ print portage.settings[argv[0]]
+
+
#-----------------------------------------------------------------------------
#
# DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED!