diff options
-rw-r--r-- | TODO | 3 | ||||
-rwxr-xr-x | client/bin/client | 7 | ||||
-rw-r--r-- | client/environment.py | 19 |
3 files changed, 27 insertions, 2 deletions
@@ -1,2 +1 @@ -* Add use flags to client -* Add env vars to client +* Remove dependency on gentoolkit diff --git a/client/bin/client b/client/bin/client index 0720466..26edcb4 100755 --- a/client/bin/client +++ b/client/bin/client @@ -2,6 +2,7 @@ from packages import Packages from useflags import UseFlags +from environment import Environment def main (): p = Packages () @@ -11,6 +12,12 @@ def main (): for x in u.getUseFlags (cpv): print x, print + e = Environment () + print e.getVar ('CFLAGS') + print e.getVar ('CXXFLAGS') + print e.getVar ('LDFLAGS') + print e.getVar ('CHOST') + print e.getVar ('FEATURES') if __name__ == "__main__": main () diff --git a/client/environment.py b/client/environment.py new file mode 100644 index 0000000..5300bef --- /dev/null +++ b/client/environment.py @@ -0,0 +1,19 @@ + +import logging +from subprocess import * + +class Environment: + + def __init__ (self): + try: + p = Popen (['emerge', '--info'], stdout=PIPE) + self.out = p.stdout.readlines () + except OSError, e: + fatal ('Cannot run emerge --info') + raise e + + def getVar (self, myvar): + for line in self.out: + if line.startswith (myvar): + return line.strip () + return '' |