From: Alec Warner Date: Tue, 21 Aug 2007 07:47:36 +0000 (-0000) Subject: Try harder to figure out what OS we are running X-Git-Tag: v2.2_pre1~871 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f7c00c611ee21949dfabf2fb2f9f1ad811b2e599;p=portage.git Try harder to figure out what OS we are running svn path=/main/trunk/; revision=7652 --- diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index e92df3627..f220a09c6 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -5136,12 +5136,19 @@ def action_info(settings, trees, myopts, myfiles): print header_title.rjust(int(header_width/2 + len(header_title)/2)) print header_width * "=" print "System uname: "+unameout - gentoo_release = portage.grabfile(os.path.join( - settings["PORTAGE_CONFIGROOT"], "etc", "gentoo-release")) - if gentoo_release: - print gentoo_release[0] - else: + + files = ('gentoo-release', 'redhat-release', 'lsb-release') + os_found = False + for f in files: + path = os.path.join(settings["ROOT"], '/etc/', f) + if os.path.exists(path): + lines = open(path).readlines() + map(writemsg, lines) + os_found = True + break + if not os_found: print "Unknown Host Operating System" + lastSync = portage.grabfile(os.path.join( settings["PORTDIR"], "metadata", "timestamp.chk")) print "Timestamp of tree:",