summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-04-12 22:31:49 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-04-12 22:31:49 +0000
commitda93ce92f6368cacf93b2fb0fafa85be5aff1cf9 (patch)
treeabf2dae5ad7cbfa50aaf32197f2db5c35941c95c /install
parent9d2e38a72fba2c3b7ebff41c5157d781906a7b18 (diff)
downloadlive-da93ce92f6368cacf93b2fb0fafa85be5aff1cf9.tar.gz
Check Dyson arch in repository
Diffstat (limited to 'install')
-rwxr-xr-xinstall18
1 files changed, 15 insertions, 3 deletions
diff --git a/install b/install
index de715bc..06d328a 100755
--- a/install
+++ b/install
@@ -51,6 +51,10 @@ rootdir = None
# Version to install:
codename = 'bok'
+# Arch to install:
+# XXX Use dpkg-architecture when we support more ;-)
+archname = 'illumos-amd64'
+
# Dyson mirrors:
mirror = None
mirrors = [
@@ -471,11 +475,19 @@ def valid_mirror(mirror):
text='Checking APT mirror: ' + mirror)
try:
o = urlopen('{mirror}/dists/{codename}/Release'.format(
- mirror=mirror, codename=codename), timeout=10)
+ mirror=mirror, codename=codename), timeout=15)
+ have_code_name = False
+ have_arch = False
+ re_arch = re.compile(r'^Architectures:.+\b{archname}\b.*$'.format(archname=archname))
+ re_code = re.compile(r'^Codename: +\b{codename}\b.*$'.format(codename=codename))
for line in o.read(400).split('\n'):
- if line.strip() == 'Codename: ' + codename:
+ if re_code.match(line):
+ have_code_name = True
+ if re_arch.match(line):
+ have_arch = True
+ if have_code_name and have_arch:
return True
- raise URLError('Not an APT repository')
+ raise URLError('Not a valid Dyson APT repository')
except HTTPError as e:
ButtonChoiceWindow(screen,
title='Error',