From 1a33e8930bf7587f4c280185efaf636ee0b6a46c Mon Sep 17 00:00:00 2001 From: Andrew Clemons Date: Tue, 18 Jul 2017 08:14:51 +1200 Subject: [PATCH] Add support for slackwarearm --- slackroll | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/slackroll b/slackroll index 21b6ad2..ad7eeb1 100755 --- a/slackroll +++ b/slackroll @@ -67,7 +67,7 @@ slackroll_filelist_pkg_str = 2 slackroll_source_indicator = '/source/' slackroll_pasture_indicator = '/pasture/' slackroll_patch_indicator = '/patches/' -slackroll_main_indicator = re.compile(r'/slackware(?:64)?/') +slackroll_main_indicator = re.compile(r'/slackware(?:64|arm)?/') slackroll_extra_indicator = '/extra/' slackroll_prioritized_pkgs = ['glibc-solibs', 'sed', 'pkgtools'] slackroll_kernel_pkg_indicator = 'kernel' @@ -113,8 +113,9 @@ slackroll_transient_states = [slackroll_state_new, slackroll_state_outdated, sla slackroll_all_states = [x for x in xrange(len(slackroll_state_strings))] slackroll_socket_timeout = 120 -slackroll_mirror_version_re = re.compile(r'/slackware(64|)-([^/]+)/') slackroll_default_primary_site_url = 'http://ftp.slackware.com/pub/slackware/slackware%s-%s/' +slackroll_arm_primary_site_url = 'http://ftp.arm.slackware.com/slackwarearm/slackware%s-%s/' +slackroll_mirror_version_re = re.compile(r'/slackware(64|arm|)-([^/]+)/') slackroll_locale_envvars = ['LANG', 'LC_CTYPE', 'LC_NUMERIC', 'LC_TIME', 'LC_COLLATE', 'LC_MONETARY', 'LC_MESSAGES', 'LC_ALL', 'LC_PAPER', 'LC_NAME', 'LC_ADDRESS', 'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION'] slackroll_locale_mainvar = 'LANG' @@ -605,7 +606,15 @@ def get_mirror(): # From the 'mirror' file def get_primary_mirror(): # From the 'pmirror' file or default value if is_readable_file(slackroll_primary_mirror_filename): return get_mirror_from_file(slackroll_primary_mirror_filename) - return slackroll_default_primary_site_url % get_mirror_version_components(get_mirror()) + + arch, version = get_mirror_version_components(get_mirror()) + + return get_default_primary_mirror(arch, version) + +def get_default_primary_mirror(arch, version): + if arch == 'arm': + return slackroll_arm_primary_site_url % (arch, version) + return slackroll_default_primary_site_url % (arch, version) def set_mirror(mirror): # Writes the mirror name to the 'mirror' file if not mirror.endswith('/'):