mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
[arch] feature -> AUR: rebuild-detector integration
This commit is contained in:
24
bauh/gems/arch/rebuild_detector.py
Normal file
24
bauh/gems/arch/rebuild_detector.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from typing import Set
|
||||
|
||||
from bauh.commons import system
|
||||
|
||||
|
||||
def is_installed() -> bool:
|
||||
return system.execute(cmd='which checkrebuild', output=False)[0] == 0
|
||||
|
||||
|
||||
def list_required_rebuild() -> Set[str]:
|
||||
code, output = system.execute(cmd='checkrebuild')
|
||||
|
||||
required = set()
|
||||
if code == 0 and output:
|
||||
for line in output.split('\n'):
|
||||
line_strip = line.strip()
|
||||
|
||||
if line_strip:
|
||||
line_split = line_strip.split('\t')
|
||||
|
||||
if len(line_split) > 1:
|
||||
required.add(line_split[1])
|
||||
|
||||
return required
|
||||
Reference in New Issue
Block a user