From 9ccb5ef5c45e6febe636ded3ada7d3d518bdfa5a Mon Sep 17 00:00:00 2001 From: B Stack Date: Sat, 6 Jul 2019 22:11:04 -0400 Subject: apt: add install --- ssp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/ssp b/ssp index 0cf11a9..b669e9f 100755 --- a/ssp +++ b/ssp @@ -143,8 +143,27 @@ def install_(action, pkg_mgr, args, repos, assume): # if regex.match(str(line)): # print(line.decode('UTF-8','backslashreplace')) elif pkg_mgr == "apt": - eprint("install_ for " + pkg_mgr + "not yet implemented.") - sys.exit(1) + # because apt does not have a --disablerepo mechanism, we will only allow arguments that are listed from this repo. + command_array=["apt-get","install"] + final_list=[] + allowed_list = list_("list", pkg_mgr, args, repos) + for item in args: + if item in allowed_list: + final_list.append(item) + else: + # a package that is not in the specially-approved repo, so... + print("Package not found:",item) + #print(final_list) + for item in final_list: + command_array.append(item) + #print(command_array) + try: + __completedprocess = subprocess.run(command_array) + except subprocess.CalledProcessError as e: + #print(str(e.output)) + pass + if __completedprocess.stdout is not None: + print(__completedprocess.stdout) # wrap around yum remove [*], def remove_(pkg_mgr, args, repos, assume): -- cgit