| 135 | FEXPPA_REGEX = r".*\/fex-emu\/fex\/ubuntu$" |
| 136 | |
| 137 | def GetPPAStatus(): |
| 138 | global _PPAInstalled |
| 139 | |
| 140 | if _PPAInstalled == None: |
| 141 | _PPAInstalled = False |
| 142 | |
| 143 | CacheResults = subprocess.check_output(['apt-cache', 'policy']).decode("utf-8") |
| 144 | |
| 145 | for Line in CacheResults.split("\n"): |
| 146 | if "http" in Line: |
| 147 | Line = Line.strip() |
| 148 | LineSplit = Line.split(" ") |
| 149 | |
| 150 | # 'status' 'URL' 'series' 'arch' 'type' |
| 151 | if re.match(FEXPPA_REGEX, LineSplit[1]): |
| 152 | _PPAInstalled = True |
| 153 | break |
| 154 | |
| 155 | return _PPAInstalled |
| 156 | |
| 157 | def InstallPPA(): |
| 158 | print ("Installing PPA: ppa:fex-emu/fex") |