diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-04-12 22:31:49 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-04-12 22:31:49 +0000 |
commit | da93ce92f6368cacf93b2fb0fafa85be5aff1cf9 (patch) | |
tree | abf2dae5ad7cbfa50aaf32197f2db5c35941c95c /install | |
parent | 9d2e38a72fba2c3b7ebff41c5157d781906a7b18 (diff) | |
download | live-da93ce92f6368cacf93b2fb0fafa85be5aff1cf9.tar.gz |
Check Dyson arch in repository
Diffstat (limited to 'install')
-rwxr-xr-x | install | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -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', |