Lines 2832-2837
Link Here
|
2832 |
unameout=commands.getstatusoutput("uname -mrp")[1] |
2832 |
unameout=commands.getstatusoutput("uname -mrp")[1] |
2833 |
print getportageversion() |
2833 |
print getportageversion() |
2834 |
print "=================================================================" |
2834 |
print "=================================================================" |
|
|
2835 |
print " System Settings" |
2836 |
print "=================================================================" |
2835 |
print "System uname: "+unameout |
2837 |
print "System uname: "+unameout |
2836 |
if os.path.exists("/etc/gentoo-release"): |
2838 |
if os.path.exists("/etc/gentoo-release"): |
2837 |
os.system("cat /etc/gentoo-release") |
2839 |
os.system("cat /etc/gentoo-release") |
Lines 2908-2913
Link Here
|
2908 |
if "cvs_id_string" in dir(module): |
2910 |
if "cvs_id_string" in dir(module): |
2909 |
print "%s: %s" % (str(x), str(module.cvs_id_string)) |
2911 |
print "%s: %s" % (str(x), str(module.cvs_id_string)) |
2910 |
|
2912 |
|
|
|
2913 |
# See if we can find any packages installed matching the strings |
2914 |
# passed on the command line |
2915 |
mypkgs = [] |
2916 |
for x in myfiles: |
2917 |
mypkgs = mypkgs + portage.db[portage.root]["vartree"].dbapi.match(x) |
2918 |
|
2919 |
# If some packages were found... |
2920 |
if mypkgs: |
2921 |
# Get our global settings (we only print stuff if it varies from |
2922 |
# the current config) |
2923 |
mydesiredvars = [ 'CHOST', 'CFLAGS', 'CXXFLAGS', 'USE' ] |
2924 |
mysettings = {} |
2925 |
for x in mydesiredvars: |
2926 |
if portage.settings.has_key(x): |
2927 |
mysettings["GLOBAL_" + x] = portage.settings[x] |
2928 |
else: |
2929 |
mysettings["GLOBAL_" + x] = None |
2930 |
|
2931 |
# Loop through each package |
2932 |
# Only print settings if they differ from global settings |
2933 |
diff_found = False |
2934 |
header_printed = False |
2935 |
for pkg in mypkgs: |
2936 |
|
2937 |
# Get the directory where the files are stored |
2938 |
prefix = os.path.join(portage.root, portage.VDB_PATH, pkg) |
2939 |
|
2940 |
# Get all package specific variables |
2941 |
for x in mydesiredvars: |
2942 |
if os.path.exists(os.path.join(prefix, x)): |
2943 |
mysettings[x] = open(os.path.join(prefix, x)).read().strip() |
2944 |
else: |
2945 |
if portage.settings.has_key(x): |
2946 |
mysettings[x] = portage.settings[x] |
2947 |
else: |
2948 |
mysettings[x] = None |
2949 |
|
2950 |
# If the package variable doesn't match the |
2951 |
# current global variable, something has changed |
2952 |
# so set diff_found so we know to print |
2953 |
if mysettings[x] != mysettings["GLOBAL_" + x]: |
2954 |
diff_found = True |
2955 |
|
2956 |
# If a difference was found, print the info for |
2957 |
# this package. |
2958 |
if diff_found: |
2959 |
|
2960 |
# If we have not yet printed the header, |
2961 |
# print it now |
2962 |
if not header_printed: |
2963 |
print "=================================================================" |
2964 |
print " Package Settings" |
2965 |
print "=================================================================" |
2966 |
header_printed = True |
2967 |
|
2968 |
# Print package info |
2969 |
print "%s was built with the following:" % pkg |
2970 |
for x in mydesiredvars: |
2971 |
if mysettings[x] != mysettings["GLOBAL_" + x]: |
2972 |
print "%s=\"%s\"" % (x, mysettings[x]) |
2973 |
print "" |
2974 |
diff_found = False |
2975 |
|
2976 |
|
2911 |
# SEARCH action |
2977 |
# SEARCH action |
2912 |
elif "search"==myaction: |
2978 |
elif "search"==myaction: |
2913 |
if not myfiles: |
2979 |
if not myfiles: |