Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 37587 Details for
Bug 60657
Enhancement to equery to allow scanning for packages with changed USE flags.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Implement changed USE flag scanning in equery
equery_changeduse.patch (text/plain), 3.22 KB, created by
Peter Jensen
on 2004-08-17 04:58:41 UTC
(
hide
)
Description:
Implement changed USE flag scanning in equery
Filename:
MIME Type:
Creator:
Peter Jensen
Created:
2004-08-17 04:58:41 UTC
Size:
3.22 KB
patch
obsolete
>--- equery.old 2004-04-14 15:27:10.000000000 +0200 >+++ equery 2004-08-17 13:29:09.000000000 +0200 >@@ -75,6 +75,112 @@ > pass > > >+class CmdDisplayChangedUSEs(Command): >+ """List all packages that have had their USE flags changed""" >+ def __init__(self): >+ self.default_opts = { >+ "rawoutput": 0 >+ } >+ >+ def parseArgs(self, args): >+ opts = self.default_opts >+ need_help = 0 >+ for i in args: >+ if i in ["-r", "--rawoutput"]: >+ opts["rawoutput"] = 1 >+ if i in ["-h", "--help"]: >+ need_help = 1 >+ if need_help: >+ print self.longHelp() >+ sys.exit(-1) >+ return opts >+ >+ def perform(self, args): >+ opts = self.parseArgs(args) >+ raw = opts["rawoutput"] >+ output = [] >+ if not raw: >+ print "Fetching list of installed packages ..." >+ matches = gentoolkit.find_all_installed_packages() >+ if not raw: >+ print "Comparing USE flags ..." >+ print >+ num = len(matches) >+ current = 0 >+ nrchars = 0 >+ for p in matches: >+ bestver = "=" + p.get_cpv() >+ # Don't continue if the package no longer exists in portage >+ if not gentoolkit.find_packages(bestver): >+ continue >+ useflags = gentoolkit.settings["USE"].split() >+ iuse = p.get_env_var("IUSE") >+ if iuse: >+ usevar = iuse.split() >+ else: >+ usevar = [] >+ used = p.get_use_vars().split() >+ list = [] >+ for u in usevar: >+ inuse = 0 >+ inused = 0 >+ if u in useflags: >+ inuse = 1 >+ if u in used: >+ inused = 1 >+ list.append((inuse, inused, u)) >+ doprint = 0 >+ uselist = [] >+ if list: >+ for inuse, inused, u in list: >+ if inuse != inused: >+ # These USE flags shouldn't be set by users anyway. >+ if u not in ["bootstrap", "build", "livecd", "selinux"]: >+ doprint = 1 >+ if inuse: >+ uselist.append(red("+" + u)) >+ else: >+ uselist.append(blue("-" + u)) >+ current += 1 >+ if doprint: >+ if raw: >+ print bestver >+ output.append((bestver, uselist)) >+ s = str(len(matches) - current) + " packages to go (" + str(len(output)) + " candidates found)" >+ if not raw: >+ sys.stdout.write(nrchars * "\b \b" + s) >+ sys.stdout.flush() >+ nrchars = len(s) >+ if not raw: >+ sys.stdout.write(nrchars * "\b \b") >+ sys.stdout.flush() >+ print "Done!" >+ print >+ if len(output): >+ print "These are the packages with changed USE flags:" >+ print >+ for pkg, uselist in output: >+ print " " + darkgreen(pkg[1:]) + " ", >+ for u in uselist: >+ print u, >+ print >+ else: >+ print "All packages are compiled with the current USE flags. Exiting ..." >+ print >+ >+ def shortHelp(self): >+ return yellow("<local-opts>") + " - list packages that have had their USE flags changed" >+ >+ def longHelp(self): >+ return "List all packages that have had their USE flags changed\n" + \ >+ "\n" + \ >+ "Syntax:\n" + \ >+ " " + green("changeduse") + yellow(" <local-opts>\n") + \ >+ "\n" + \ >+ yellow("<local-opts>") + " is either of:\n" + \ >+ " " + yellow("-r, --rawoutput") + " - output raw depend atoms\n" >+ >+ > class CmdListFiles(Command): > """List files owned by a particular package""" > def __init__(self): >@@ -850,6 +956,7 @@ > > > Known_commands = { >+ "changeduse": CmdDisplayChangedUSEs(), > "list": CmdListPackages(), > "files": CmdListFiles(), > "belongs": CmdListBelongs(),
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60657
: 37587