From: Zhang Qiang Date: Wed, 14 Dec 2011 02:46:45 +0000 (+0800) Subject: Show user all the availabe archs if choice more than one. X-Git-Tag: 0.3~15^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6404fe2284ad15880100d45d1b2c0e097135fc1d;p=platform%2Fupstream%2Fmic.git Show user all the availabe archs if choice more than one. --- diff --git a/mic/conf.py b/mic/conf.py index 751a18a..c7e65e6 100644 --- a/mic/conf.py +++ b/mic/conf.py @@ -146,18 +146,18 @@ class ConfigMgr(object): self.create['repomd'] = misc.get_metadata_from_repos(ksrepos, self.create['cachedir']) msger.raw(" DONE") - target_archlist = misc.get_arch(self.create['repomd']) + target_archlist, archlist = misc.get_arch(self.create['repomd']) if self.create['arch']: - if self.create['arch'] not in target_archlist: + if self.create['arch'] not in archlist: raise errors.ConfigError("Invalid arch %s for repository. Valid arches: %s"\ - % (self.create['arch'], ', '.join(target_archlist))) + % (self.create['arch'], ', '.join(archlist))) else: if len(target_archlist) == 1: self.create['arch'] = str(target_archlist[0]) msger.info("\nUse detected arch %s." % target_archlist[0]) else: - raise errors.ConfigError("Please specify a valid arch, " - "your choise can be: %s" % ', '.join(target_archlist)) + raise errors.ConfigError("Please specify a valid arch, "\ + "your choise can be: %s" % ', '.join(archlist)) kickstart.resolve_groups(self.create, self.create['repomd']) diff --git a/mic/utils/misc.py b/mic/utils/misc.py index 785b136..49859bc 100644 --- a/mic/utils/misc.py +++ b/mic/utils/misc.py @@ -373,7 +373,7 @@ def get_arch(repometadata): if need_append: uniq_arch.append(archlist[i]) - return uniq_arch + return uniq_arch, archlist def get_package(pkg, repometadata, arch = None): ver = ""