summaryrefslogtreecommitdiff
path: root/src/backend/getBinhost.py
blob: befa1f3aaf84936b79b8c94856f93023c7b2d006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/python3

import subprocess

def start():
    isBinhost = []
    portageExec = subprocess.Popen(['emerge', '--info', '--verbose'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stderr = portageExec.communicate()

    for portageOutput in stdout.decode('ascii').splitlines():
        if "PORTAGE_BINHOST" in portageOutput:
            isBinhost = portageOutput.rstrip().split("=")[1].strip('\"')

    return isBinhost