summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordavidovski <git@davidovski.xyz>2021-11-10 09:55:58 +0000
committerdavidovski <git@davidovski.xyz>2021-11-10 09:55:58 +0000
commit1e84d95edd19519f5d8cedf82b376bb376178bef (patch)
tree1910c87b1441cbe0dfdbcec0050000fd23f5bc0e /src
parentaf2cb89427e3d8144bed7eca05269a455f22fd03 (diff)
added the package not found for install
Diffstat (limited to 'src')
-rw-r--r--src/verbs/install.py37
-rw-r--r--src/xi.py3
2 files changed, 38 insertions, 2 deletions
diff --git a/src/verbs/install.py b/src/verbs/install.py
new file mode 100644
index 0000000..686178e
--- /dev/null
+++ b/src/verbs/install.py
@@ -0,0 +1,37 @@
+import os
+import util
+import colors
+import time
+
+def install(args, options, config):
+ for query in args:
+ sources = config["sources"]
+ repos = config["repos"]
+
+ v = options["v"]
+
+ packages_dir = config["dir"]["packages"]
+
+ sources = []
+ checksum = None
+ requested_repo = None
+
+ for repo in repos:
+ repo_dir = os.path.join(packages_dir, repo)
+ files = os.listdir(repo_dir)
+
+ if query in files:
+ requested_repo = repo
+ with open(os.path.join(repo_dir, query)) as file:
+ checksum = file.read().split("=")[-1]
+ sources = file.read().split("=")[-1].split()
+ break
+ if checksum is not None:
+ print(query)
+ print(checksum)
+ print(sources)
+ print(requested_repo)
+ else:
+ print(colors.RED + "Package not found")
+ print(colors.RESET, end="")
+
diff --git a/src/xi.py b/src/xi.py
index 0b11c56..d00c2df 100644
--- a/src/xi.py
+++ b/src/xi.py
@@ -2,11 +2,10 @@ import options
import config
from verbs.sync import sync
+from verbs.install import install
def search():
pass
-def install():
- pass
def remove():
pass