From f48e5d59c68ffc0882c3b95b7d77af080c1aef9e Mon Sep 17 00:00:00 2001 From: Giancarlo Razzolini Date: Fri, 22 Jan 2021 13:34:44 -0300 Subject: Change Arch Linux site URL's Recently Arch Linux shed the www portion of its site. The links still work, but it's a 301 redirection to archlinux.org. Changed all the URL's still pointing to www.archlinux.org to avoid the unnecessary redirection, since on browsers the 301 is usually saved and respected, but command line tools line wget or python might not save this and always go through the redirect. --- archinstall/lib/mirrors.py | 4 ++-- archinstall/lib/packages.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py index e74732ec..6649ebfd 100644 --- a/archinstall/lib/mirrors.py +++ b/archinstall/lib/mirrors.py @@ -16,7 +16,7 @@ def filter_mirrors_by_region(regions, destination='/etc/pacman.d/mirrorlist', tm region_list = [] for region in regions.split(','): region_list.append(f'country={region}') - o = b''.join(sys_command((f"/usr/bin/wget 'https://www.archlinux.org/mirrorlist/?{'&'.join(region_list)}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' -O {tmp_dir}/mirrorlist"))) + o = b''.join(sys_command((f"/usr/bin/wget 'https://archlinux.org/mirrorlist/?{'&'.join(region_list)}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' -O {tmp_dir}/mirrorlist"))) o = b''.join(sys_command((f"/usr/bin/sed -i 's/#Server/Server/' {tmp_dir}/mirrorlist"))) o = b''.join(sys_command((f"/usr/bin/mv {tmp_dir}/mirrorlist {destination}"))) @@ -73,7 +73,7 @@ def re_rank_mirrors(top=10, *positionals, **kwargs): return False def list_mirrors(): - url = f"https://www.archlinux.org/mirrorlist/?protocol=https&ip_version=4&ip_version=6&use_mirror_status=on" + url = f"https://archlinux.org/mirrorlist/?protocol=https&ip_version=4&ip_version=6&use_mirror_status=on" response = urllib.request.urlopen(url) regions = {} diff --git a/archinstall/lib/packages.py b/archinstall/lib/packages.py index 03bb2154..4f6b6c61 100644 --- a/archinstall/lib/packages.py +++ b/archinstall/lib/packages.py @@ -2,8 +2,8 @@ import urllib.request, urllib.parse 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}/' +BASE_URL = 'https://archlinux.org/packages/search/json/?name={package}' +BASE_GROUP_URL = 'https://archlinux.org/groups/x86_64/{group}/' def find_group(name): ssl_context = ssl.create_default_context() -- cgit v1.2.3-70-g09d2