Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-11-09 21:53:10 +0100
committerGitHub <noreply@github.com>2020-11-09 21:53:10 +0100
commit9a1199333a0a00b74f884dfee1b324500d4b8060 (patch)
tree56e7a792b475f7b59eff40e88cfb42e2b8eaa402
parente43a84bb4b4a3822cdaa6c0da7efc1ee5540c65f (diff)
parentbf4fd837f4760e799633a26f50b724bc9d3d790c (diff)
Merge pull request #66 from Torxed/63-package-groups
Fixed #63
-rw-r--r--archinstall/lib/packages.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/archinstall/lib/packages.py b/archinstall/lib/packages.py
index ddf11f7f..03bb2154 100644
--- a/archinstall/lib/packages.py
+++ b/archinstall/lib/packages.py
@@ -3,6 +3,23 @@ import ssl, json
from .exceptions import *
BASE_URL = 'https://www.archlinux.org/packages/search/json/?name={package}'
+BASE_GROUP_URL = 'https://www.archlinux.org/groups/x86_64/{group}/'
+
+def find_group(name):
+ ssl_context = ssl.create_default_context()
+ ssl_context.check_hostname = False
+ ssl_context.verify_mode = ssl.CERT_NONE
+ try:
+ response = urllib.request.urlopen(BASE_GROUP_URL.format(group=name), context=ssl_context)
+ except urllib.error.HTTPError as err:
+ if err.code == 404:
+ return False
+ else:
+ raise err
+
+ # Just to be sure some code didn't slip through the exception
+ if response.code == 200:
+ return True
def find_package(name):
"""
@@ -34,7 +51,7 @@ def validate_package_list(packages :list):
"""
invalid_packages = []
for package in packages:
- if not find_package(package)['results']:
+ if not find_package(package)['results'] and not find_group(package):
invalid_packages.append(package)
if invalid_packages: