zypp: simplify arch setting for zypp backend
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 20 Sep 2011 09:12:37 +0000 (17:12 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Tue, 20 Sep 2011 09:12:37 +0000 (17:12 +0800)
Using Arch class to create Arch for different architecture

plugins/backend/zypppkgmgr.py

index dff4d5216afdd4674412b1923477256cd359e50c..37295252b1746ffc929be655e7a8b44f964893e1 100644 (file)
@@ -417,14 +417,7 @@ class Zypp(BackendPlugin):
 
             arch_map = {}
             try:
-                if self.creator.target_arch == "armv7l":
-                    arch_map["armv7l"] = zypp.Arch_armv7l()
-                elif self.creator.target_arch == "armv7nhl":
-                    arch_map["armv7nhl"] = zypp.Arch_armv7nhl()
-                elif self.creator.target_arch == "armv7hl":
-                    arch_map["armv7hl"] = zypp.Arch_armv7hl()
-                elif self.creator.target_arch == "armv5tel":
-                    arch_map["armv5tel"] = zypp.Arch_armv5tel()
+                arch_map[self.creator.target_arch] = zypp.Arch(self.creator.target_arch)
             except AttributeError:
                 msger.error('libzypp/python-zypp in host system cannot support arch %s, please'
                             ' update it to enhanced version which can be found in repo.meego.com/tools'\