summaryrefslogtreecommitdiff
path: root/portato/helper.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-02-13 14:00:54 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-02-13 14:00:54 +0100
commitc26f4f8a6923f5a83858a90ac928d986000fb1c5 (patch)
treec973787a6293484b0b01362dd3aced47cc0d4280 /portato/helper.py
parentbac4fa07e289f56503a0962a034edc16d26dafb9 (diff)
downloadportato-c26f4f8a6923f5a83858a90ac928d986000fb1c5.tar.gz
portato-c26f4f8a6923f5a83858a90ac928d986000fb1c5.tar.bz2
portato-c26f4f8a6923f5a83858a90ac928d986000fb1c5.zip
Additional sabayon message for missing portage tree
Diffstat (limited to 'portato/helper.py')
-rw-r--r--portato/helper.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/portato/helper.py b/portato/helper.py
index 1ae6264..d3fc70b 100644
--- a/portato/helper.py
+++ b/portato/helper.py
@@ -13,7 +13,7 @@
"""
Some nice functions used in the program.
"""
-from __future__ import absolute_import
+from __future__ import absolute_import, with_statement
import os, signal, logging, grp
@@ -43,6 +43,18 @@ def send_signal_to_group (sig):
pgid = os.getpgrp()
os.killpg(pgid, sig)
+def get_runsystem ():
+ # check for sabayon first, as sabayon also has the gentoo release
+ for sp in ("/etc/sabayon-release", "/etc/sabayon-edition"):
+ if os.path.exists(sp):
+ with open(sp) as r:
+ return ("Sabayon", r.readline().strip())
+
+ if os.path.exists("/etc/gentoo-release"):
+ return ("Gentoo", "")
+
+ else: return ("Unknown", "")
+
def paren_reduce(mystr):
"""
Take a string and convert all paren enclosed entities into sublists, optionally