Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 9091 Details for
Bug 17027
Checking compilation options for installed packages using emerge
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The patch to emerge v1.197 and not to the old version
emerge.diff (text/plain), 3.28 KB, created by
Daniel Armyr
on 2003-03-07 09:51:28 UTC
(
hide
)
Description:
The patch to emerge v1.197 and not to the old version
Filename:
MIME Type:
Creator:
Daniel Armyr
Created:
2003-03-07 09:51:28 UTC
Size:
3.28 KB
patch
obsolete
>19c19,20 >< "regen", "rsync", "search", "sync", "system", "unmerge", "world" >--- >> "regen", "rsync", "search", "sync", "system", "unmerge", "world", >> "diff" #Add diff to list of actions >218c219 >< if ("--pretend" in myopts) or (myaction=="search"): >--- >> if ("--pretend" in myopts) or (myaction in ["search", "diff"] ): #Do not require root to see diffs >1651a1653,1737 >> #INSERTED >> #Prints a list of packages, showing differences in compile-time options to the settings that would be used if >> #recompiled now. If an argument is supplied, it only displays packages of which the argument is a substring. >> #The location of the vardbtree is hardcoded because it is in the vardbiapi. >> #TODO: allow regular expressions as search arguments. >> elif "diff"==myaction: >> #If we were supplied with a search string >> if ( myfiles ): >> print "Scaning for packagenames including \"" + myfiles[0] + "\"." >> else: >> print "Scanning all packages." >> print >> >> #Set root for vardb >> myRoot = portage.root + "var/db/pkg/" >> #Get a list of the options currenty used to compile. >> currCFlags = portage.settings["CFLAGS"].split( " " ) >> >> #Scan through all categories >> try: >> categories = portage.listdir ( myRoot ) >> except OSError: >> print "Error opening catalogue " + myRoot + "." >> sys.exit(-1) >> >> categories.sort() >> for y in categories: >> #Scan through all packages, listing their flags >> try: >> pkgList = portage.listdir ( myRoot + y ) >> except OSError: >> pkgList = [] #In case there is a file in the /var/db/pkg/ >> pkgList.sort() >> for x in pkgList: >> #Check if this file satisfies search criteria >> #TODO: replace string.find by regular expression equiv. >> if ( not myfiles or string.find ( y + "/" + x, myfiles[0] ) >=0 ): >> #Print name of package >> print green("*") + y + "/" + x + ": " >> #Get info about package >> try: >> myCFlagsFile = open ( myRoot + y + "/" + x + "/CFLAGS", "r" ) >> except (IOError,OSError): >> print red( "Error opening CFLAGS file" ) >> print >> continue #Skip this package and go on to next one. >> >> #Read in file, stripping last char, which is a '\n' >> myCFlagsData = string.rstrip ( myCFlagsFile.readline() ) >> #Split data into separate options >> myCFlags = myCFlagsData.split( " " ) >> #Make a list of settings this package does not have >> myCFlagsLacking = "" >> for z in currCFlags: >> if ( not z in myCFlags ): >> myCFlagsLacking += ( z + " " ) >> >> #Make a list of settings this package has in excess >> myCFlagsExtra = "" >> for z in myCFlags: >> if ( not z in currCFlags ): >> myCFlagsExtra += ( z + " " ) >> >> #If settings match >> if ( not myCFlagsLacking and not myCFlagsExtra ): >> print blue("Up to date") >> >> #If there are differences >> else: >> #Print options >> print red("Lacks: ") + myCFlagsLacking >> print red("Excess: ") + myCFlagsExtra >> #Done displaying this package >> print >> #Close cflags file >> myCFlagsFile.close() >> #else: >> #Package does not match criteria. Do not show. >> #print y + "/" + x + " " + str( string.find( myfiles[0], y + "/" + x ) ) >> #End processing file. If no match then nothing done >> #End scanning packages >> #End scanning categories >> >> #/INSERTED >>
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 17027
:
9090
| 9091