2018-12-08 23:20:35 -05:00
|
|
|
import lib.proc as proc
|
2018-12-06 01:31:23 -05:00
|
|
|
|
|
|
|
def get_installed():
|
2018-12-08 23:20:35 -05:00
|
|
|
return [line.split(' ')[0] for line in pacman(['-Q']).split('\n')[:-1]]
|
2018-12-06 01:31:23 -05:00
|
|
|
|
|
|
|
def install(package):
|
2018-12-08 23:20:35 -05:00
|
|
|
output = pacman(['-S', package], True)
|
2018-12-06 01:31:23 -05:00
|
|
|
|
2018-12-08 23:20:35 -05:00
|
|
|
def install_all(packages):
|
|
|
|
output = pacman(['-S'] + packages, True)
|
2018-12-06 01:31:23 -05:00
|
|
|
|
2018-12-08 23:20:35 -05:00
|
|
|
def pacman(flags, sudo = False):
|
|
|
|
cmd = ['pacman', '--noconfirm'] + flags
|
|
|
|
subproc = proc.sudo(cmd) if sudo else proc.exec(cmd)
|
|
|
|
return proc.communicate(subproc, cmd)
|