diff options
-rwxr-xr-x | ssp | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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): |