summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-07-06 22:11:04 -0400
committerB Stack <bgstack15@gmail.com>2019-07-06 22:11:04 -0400
commit9ccb5ef5c45e6febe636ded3ada7d3d518bdfa5a (patch)
tree58290394adc3d172b4dbb5eb45078321b654009e
parentadd apt: list, list available, list installed (diff)
downloadssp-master.tar.gz
ssp-master.tar.bz2
ssp-master.zip
apt: add installHEADmaster
-rwxr-xr-xssp23
1 files 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):
bgstack15