Add install command & reorganize

This commit is contained in:
Valentin Niess
2020-03-30 00:34:15 +02:00
parent ca80dd8452
commit 4eb7011425
9 changed files with 60 additions and 19 deletions

View File

@@ -0,0 +1,26 @@
import os
from ..utils import deps
from ..utils.log import log
__all__ = ['execute']
def _unpack_args(args):
'''Unpack command line arguments
'''
return args.binary
def execute(*args):
'''Install the requested dependencies
'''
bindir = os.path.dirname(deps.PATCHELF)
for binary in args:
installed = getattr(deps, 'ensure_' + binary)()
words = 'has been' if installed else 'already'
log('INSTALL',
'{:} {:} installed in {:}'.format(binary, words, bindir))