Try harder to figure out what OS we are running
authorAlec Warner <antarus@gentoo.org>
Tue, 21 Aug 2007 07:47:36 +0000 (07:47 -0000)
committerAlec Warner <antarus@gentoo.org>
Tue, 21 Aug 2007 07:47:36 +0000 (07:47 -0000)
svn path=/main/trunk/; revision=7652

pym/emerge/__init__.py

index e92df3627a801b247df18057bf24118097e17cfc..f220a09c612277bddd87a899182be80ec7e233b5 100644 (file)
@@ -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:",