def __init__(self, iso_url, **kwargs):
Version.__init__(self, **kwargs)
if re.match(r'/', iso_url):
self.m_iso_url = "file://" + iso_url
self.m_iso_path = iso_url
else:
self.m_iso_url = iso_url
self.m_iso_path = None
# We can't determine the final ISO file name yet because the work
# directory is not known at this point, but we can precalculate the
# basename of it.
self.m_iso_basename = os.path.basename(
urllib.url2pathname(urlparse.urlparse(iso_url)[2]))
m = re.match(r"(.*)cd.*iso|NetBSD-[0-9\._A-Z]+-(.*).iso", self.m_iso_basename)
if m is None:
raise RuntimeError("cannot guess architecture from ISO name '%s'"
% self.m_iso_basename)
if m.group(1) is not None:
self.m_arch = m.group(1)
if m.group(2) is not None:
self.m_arch = m.group(2)
check_arch_supported(self.m_arch, 'iso')
评论列表
文章目录