summaryrefslogtreecommitdiff
path: root/src/verbs/install.py
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2021-11-21 22:38:31 +0000
committerdavidovski <david@davidovski.xyz>2021-11-21 22:38:31 +0000
commitc918fe37aef11dc5e1c7cf90535c02d3224c0d9d (patch)
tree2fd09f6a972f9ec53327fe16a812f23a09d59345 /src/verbs/install.py
parentce02c1f3549544486a82d71c4510a19fcbbf1f21 (diff)
fixed path adding issues
Diffstat (limited to 'src/verbs/install.py')
-rw-r--r--src/verbs/install.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/verbs/install.py b/src/verbs/install.py
index 34974a0..6871f2e 100644
--- a/src/verbs/install.py
+++ b/src/verbs/install.py
@@ -72,7 +72,6 @@ def retrieve_package_info(sources, checksum, package_name, config,
cache_dir=config["dir"]["cache"]
# TODO we may potentially do this a few times while resolving deps, might want to cache things here
- # TODO actually use the ping times we made earlier to decide which source to pick
for source in get_best_source(sources_list=sources_list):
url = sources[source]
@@ -98,10 +97,7 @@ def retrieve_package(sources, package_info, package_name, config,
sources_list=config["dir"]["sources"]
cache_dir=config["dir"]["cache"]
keychain_dir=config["dir"]["keychain"]
-
- # TODO actually use the ping times we made earlier to decide which source to pick
- # TODO actually save tar file, and add loading bar
-
+
checksum = package_info["CHECKSUM"]
for source in get_best_source(sources_list=sources_list):
@@ -189,7 +185,7 @@ def find_all_dependencies(package_names, options, config):
deps = resolve_dependencies(info)
for dep in deps:
if not dep in all_deps:
- if is_installed(dep, config):
+ if is_installed(dep, config, options["r"]):
print(colors.YELLOW + f"Package {query} has already been installed")
else:
to_check.append(dep)
@@ -208,11 +204,20 @@ def find_all_dependencies(package_names, options, config):
all_deps.reverse()
return all_deps
-def is_installed(package_name, config):
- # TODO only check that the requested checksum is installed.. if not then its a new update or something
- # TODO actually find out if its installed
+def is_installed(package_name, config, root="/"):
+ installed_dir = util.add_path(root, config["dir"]["installed"])
+ if os.path.exists(installed_dir):
+ files = os.listdir(installed_dir)
+ return package_name in files
return False
+def install_package(package_path, package_info, config, root="/"):
+ # untar and move into root
+ # then add entry in the config["dir"]["installed"]
+
+ pass
+
+
def install(args, options, config):
sources = config["sources"]
repos = config["repos"]