Warn if /proc is not mounted. (trunk r15097)
authorZac Medico <zmedico@gentoo.org>
Thu, 17 Dec 2009 03:21:42 +0000 (03:21 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 17 Dec 2009 03:21:42 +0000 (03:21 -0000)
svn path=/main/branches/2.1.7/; revision=15102

pym/_emerge/main.py

index baf0a797b2938bf0753bbf90545b675aedbdd476..b19c96a776f5a9fc7c9fb2f3239c59e80ce9740c 100644 (file)
@@ -988,6 +988,16 @@ def profile_check(trees, myaction):
                return 1
        return os.EX_OK
 
+def check_procfs():
+       procfs_path = '/proc'
+       if platform.system() not in ("Linux",) or \
+               os.path.ismount(procfs_path):
+               return os.EX_OK
+       msg = "It sees that %s is not mounted. You have been warned." % procfs_path
+       writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
+               level=logging.ERROR, noiselevel=-1)
+       return 1
+
 def emerge_main():
        global portage  # NFC why this is necessary now - genone
        portage._disable_legacy_globals()
@@ -1051,6 +1061,7 @@ def emerge_main():
                #repo_name_check(trees)
                repo_name_duplicate_check(trees)
                config_protect_check(trees)
+       check_procfs()
 
        for mytrees in trees.values():
                mydb = mytrees["porttree"].dbapi