aboutsummaryrefslogtreecommitdiff
path: root/system/slackroll/1a33e8930bf7587f4c280185efaf636ee0b6a46c.patch
blob: dfd7e8ece6abd101ac1268c029f57831f0683535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 1a33e8930bf7587f4c280185efaf636ee0b6a46c Mon Sep 17 00:00:00 2001
From: Andrew Clemons <andrew.clemons@gmail.com>
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('/'):