Repomaker: Check out wrong output archs
authorEd Bartosh <eduard.bartosh@intel.com>
Mon, 23 Sep 2013 12:40:53 +0000 (15:40 +0300)
committerGerrit Code Review <gerrit2@otctools.jf.intel.com>
Tue, 24 Sep 2013 02:53:47 +0000 (19:53 -0700)
Check if architectures, provided to repomaker are valid ones, i.e. they
don't need to be mapped. For example, in current code i586 and i686
architectures are mapped to ia32, so both of them are not valid output
directories and repomaker throws exception if they're found in the list
of output architectures.

Change-Id: I4bee1f172f73550784e8153eaadad2b5a4626550
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
common/repomaker.py

index ee7534d..51377de 100644 (file)
@@ -144,6 +144,11 @@ class RepoMaker(object):
         if not os.path.exists(in_dir):
             raise RepoMakerError("Directory %s doesn't exist" % in_dir)
 
+        wrong_archs = set(archs).intersection(set(ARCH_MAP))
+        if wrong_archs:
+            raise RepoMakerError("Wrong output architecture(s) specified: %s" \
+                                 % ", ".join(wrong_archs))
+
         repo_dir = os.path.join(self.outdir, "repos", name)
         if name not in self.repos:
             self.repos[name] = {'archs': set(archs)}