Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 76838 Details for
Bug 118663
portpeek: Displays user unmasked ebuilds and installable options from the portage tree
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
portpeek script to query against user unmasked packages
portpeek (text/plain), 4.47 KB, created by
Mike Pagano
on 2006-01-11 07:14:44 UTC
(
hide
)
Description:
portpeek script to query against user unmasked packages
Filename:
MIME Type:
Creator:
Mike Pagano
Created:
2006-01-11 07:14:44 UTC
Size:
4.47 KB
patch
obsolete
>#!/usr/bin/python ># ># Copyright 2006 Mike Pagano ># Distributed under the terms of the GNU General Public License v2 ># ># $Header$ ># Author: Mike Pagano <mpagano@gmail.com> ># ># Portions written ripped from ># - equery, by Karl Trygve Kalleberg <karltk@gentoo.org> ># - gentoolkit.py, by Karl Trygve Kalleberg <karltk@gentoo.org> ># > >__author__ = "Michael Pagano" >__email__ = "mpagano@gmail.com" >__version__ = "0.0.1" >__productname__ = "portpeek" >__description__ = "Displays user unmasked ebuilds and installable options from the portage tree" > >import sys,portage,output > >sys.path.insert(0, "/usr/lib/gentoolkit/pym") > >import gentoolkit >import portage_const >from portage_const import USER_CONFIG_PATH > >porttree = portage.db[portage.root]["porttree"] >settings = portage.config(clone=portage.settings) > > >def printUsage(): > # Print full usage information for this tool to the console. > print output.white("Usage: ") + output.turquoise(__productname__) + output.yellow(" <global-opts> ") > print "where " + output.yellow("<global-opts>") + " is one of" > print output.yellow(" -k, --keyword") + " - show matches from portage.keyword only" > print output.yellow(" -u, --unmask") + " - show matched from portage.unmask only" > print output.yellow(" -m, --mask") + " - show matches from portage.mask only" > print output.yellow(" -a, --all") + " - show all matches" > print output.yellow(" -V, --version") + " - display version info" > >def get_keywords(x,var): > mytree = porttree > r = mytree.dbapi.aux_get(x._cpv,[var]) > return r[0] > >def get_info(filename): > pkgs = None > try: > fd = open(filename) > for line in fd.readlines(): > line = line.strip(); > if len(line) <= 0: > continue > elif line[0] == "#": > continue > fields = line.split(" ") > if len(fields) > 0: > pkgs = gentoolkit.find_packages(fields[0], True) > if pkgs != None: > for x in pkgs: > if not x.is_installed(): > continue > else: > keywords = "%s" % (get_keywords(x,"KEYWORDS").split()) > print output.green("Installed: ") + \ > output.turquoise(x.get_cpv()) + \ > output.yellow(" Keywords " + keywords) > all_pkgs = gentoolkit.sort_package_list(gentoolkit.find_packages((x.get_category() + \ > "/" + x.get_name()), True)) > for y in all_pkgs: > if not y.is_installed(): > pkgmask = _get_mask_status(y) > if ((x.compare_version(y)) < 0): > keywords = "%s" % (y.get_env_var("KEYWORDS").split()) > if pkgmask > 4: > print output.red("Available: " + y.get_cpv() + " Keywords: " + keywords) > else: > print output.fuscia("Available: " + y.get_cpv() + " Keywords: " + keywords) > print > x = "" > except IOError: > print output.red("Could not find file " + filename) > >def parseArgs(args): > > # parse arguments > for i in xrange(len(args)): > x = args[i] > if 0: > pass > elif x in ["-h", "--help"]: > return "showhelp" > elif x in ["-V", "--version"]: > printVersion() > sys.exit(0) > elif x in ["-k", "--keyword"]: > return "keyword" > elif x in ["-u", "--unmask"]: > return "unmask" > elif x in ["-m", "--mask"]: > return "mask" > elif x in ["-a", "--all"]: > return "all" > else: > break > ># blatantly stolen from equery >def _get_mask_status(pkg): > pkgmask = 0 > > if pkg.is_masked(): > pkgmask = pkgmask + 3 > keywords = pkg.get_env_var("KEYWORDS").split() > if "~" + gentoolkit.settings["ARCH"] in keywords: > pkgmask = pkgmask + 1 > elif "-*" in keywords or "-" + gentoolkit.settings["ARCH"] in keywords: > pkgmask = pkgmask + 2 > > return pkgmask > >#print version info >def printVersion(): > """Print the version of this tool to the console.""" > print __productname__ + "(" + __version__ + ") - " + \ > __description__ > print "Author(s): " + __author__ > ># main >if __name__ == "__main__": > > command = parseArgs(sys.argv[1:]) > > if command is None: > printUsage() > sys.exit(-1) > elif command == "keyword": > print output.darkyellow("\npackage.keywords:") > get_info(USER_CONFIG_PATH + "/package.keywords") > elif command == "unmask": > print output.darkyellow("\npackage.unmask:") > get_info(USER_CONFIG_PATH + "/package.unmask") > elif command == "mask": > print output.darkyellow("\npackage.mask:") > get_info(USER_CONFIG_PATH + "/package.mask") > elif command == "all": > print output.darkyellow("\npackage.keywords:") > get_info(USER_CONFIG_PATH + "/package.keywords") > print output.darkyellow("package.unmask:") > get_info(USER_CONFIG_PATH + "/package.unmask") > print output.darkyellow("package.mask:") > get_info(USER_CONFIG_PATH + "/package.mask") >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 118663
:
76838
|
78685
|
78686
|
78738
|
78767
|
78815
|
78878
|
78901
|
79021
|
79036
|
79136
|
79754
|
81530
|
81560
|
81723
|
81724
|
82395
|
83105
|
84039
|
84040
|
84150
|
85121
|
85124
|
85140
|
90362
|
93910
|
97097
|
97267
|
98730
|
98897
|
104441
|
106480
|
106576
|
106580
|
107478
|
108038
|
110877
|
126796