From 50c501d0c2cd6711b05146d7addc88bd9ae6e7ac Mon Sep 17 00:00:00 2001 From: JF Ding Date: Mon, 12 Sep 2011 09:12:17 -0700 Subject: [PATCH] remove arch key from default mic.conf --- distfiles/mic.conf | 1 - mic/creator.py | 4 ++++ mic/imager/baseimager.py | 18 +++++++----------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/distfiles/mic.conf b/distfiles/mic.conf index cedd270..a592d5e 100644 --- a/distfiles/mic.conf +++ b/distfiles/mic.conf @@ -7,7 +7,6 @@ tmpdir= /var/tmp/mic cachedir= /var/tmp/mic/cache outdir= . pkgmgr = zypp -arch = i586 ; proxy = http://proxy.yourcompany.com:8080/ ; no_proxy = localhost,127.0.0.0/8,.yourcompany.com diff --git a/mic/creator.py b/mic/creator.py index b25547b..3251902 100644 --- a/mic/creator.py +++ b/mic/creator.py @@ -62,6 +62,7 @@ class Creator(cmdln.Cmdln): optparser.add_option('', '--local-pkgs-path', type='string', dest='local_pkgs_path', default=None, help='Path for local pkgs(rpms) to be installed') optparser.add_option('', '--logfile', type='string', dest='logfile', default=None, help='Path of logfile') optparser.add_option('', '--release', type='string', dest='release', default=None, help='Generate release package') + optparser.add_option('-A', '--arch', type='string', dest='arch', default=None, help='Specify repo architecture') return optparser def preoptparse(self, argv): @@ -116,6 +117,9 @@ class Creator(cmdln.Cmdln): if self.options.release: self.configmgr.create['release'] = self.options.release + if self.options.arch is not None: + self.configmgr.create['arch'] = self.options.arch + if self.options.logfile: msger.set_interactive(False) msger.set_logfile(self.options.logfile) diff --git a/mic/imager/baseimager.py b/mic/imager/baseimager.py index 623de8e..57f53be 100644 --- a/mic/imager/baseimager.py +++ b/mic/imager/baseimager.py @@ -74,7 +74,7 @@ class BaseImageCreator(object): self.destdir = createopts['outdir'] - self.arch = createopts['arch'] + target_arch = createopts['arch'] self._local_pkgs_path = createopts['local_pkgs_path'] else: @@ -83,7 +83,7 @@ class BaseImageCreator(object): self.tmpdir = "/var/tmp/mic" self.cachedir = "/var/tmp/mic/cache" self.destdir = "." - self.arch = "noarch" + target_arch = "noarch" self._local_pkgs_path = None self.__builddir = None @@ -128,15 +128,11 @@ class BaseImageCreator(object): self._dep_checks.append("mkfs.btrfs") break - # make sure arch available - if not self.arch: - raise CreatorError("Architecture for creator is not available") - if self.arch.startswith("arm"): - if not self.set_target_arch(self.arch): - raise CreatorError("Architecture %s is not support" % self.arch) + if target_arch.startswith("arm"): + if not self.set_target_arch(target_arch): + raise CreatorError('arch "%s" can not be supported' % target_arch) else: self.target_arch = None - print self.arch, self.target_arch # make sure the specified tmpdir and cachedir exist if not os.path.exists(self.tmpdir): @@ -162,8 +158,8 @@ class BaseImageCreator(object): vdso_fh.close() if (int)(vdso_value) == 1: msger.warning("vdso is enabled on your host, which might cause problems with arm emulations.\n" - "\tYou can disable vdso with following command before starting image build:\n" - "\techo 0 | sudo tee /proc/sys/vm/vdso_enabled") + "\tYou can disable vdso with following command before starting image build:\n" + "\techo 0 | sudo tee /proc/sys/vm/vdso_enabled") return True -- 2.7.4