From 0313176c9fe35fcca0f53b99ce1e636af0bc9e4e Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 10 Nov 2021 12:18:03 +0000 Subject: added unsafe option --- src/verbs/install.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/verbs') diff --git a/src/verbs/install.py b/src/verbs/install.py index 703a7ee..5883c51 100644 --- a/src/verbs/install.py +++ b/src/verbs/install.py @@ -33,7 +33,9 @@ def retrieve_package_info(sources, checksum, package_name, return info else: if verbose: - print(colors.RED + f"Checksum verification failed for {package_name} in {source}" + colors.RESET) + print(colors.RED + + f"Checksum verification failed for {package_name} in {source}" + + colors.RESET) if verbose: print(colors.RED + f"No matching hashes found" + colors.RESET) return {} @@ -53,18 +55,25 @@ def install(args, options, config): repos = config["repos"] v = options["v"] + unsafe = options["u"] packages_dir = config["dir"]["packages"] for query in args: # FIRST CHECK IF ALREADY INSTALLED - checksum, listed_sources, repo = find_package(query, repos, packages_dir) if checksum is not None: - repo_sources = {source: util.add_path(url, repo) for source, url in sources.items() if source in listed_sources} - - info = retrieve_package_info(repo_sources, checksum, query, verbose=v) + repo_sources = { + source: util.add_path(url, repo) + for source, url in sources.items() + if source in listed_sources + } + + info = retrieve_package_info( + repo_sources, checksum, query, + verbose=v, skip_verification=unsafe + ) print(info) else: -- cgit v1.2.1