diff --git a/src/bin/lorax b/src/bin/lorax index eaf2d511..4962e713 100644 --- a/src/bin/lorax +++ b/src/bin/lorax @@ -74,6 +74,8 @@ def main(args): # lorax settings settings = OptionGroup(parser, "lorax settings") + settings.add_option("--pedantic", help="don't ignore copy errors", + action="store_true", default=False) settings.add_option("-c", "--cleanup", help="clean up on exit", action="store_true", default=False) @@ -123,6 +125,8 @@ def main(args): config.encoding = opts.encoding config.debug = opts.debug + config.pedantic = opts.pedantic + # run lorax params = {"installtree": installtree, "outputdir": opts.outputdir, diff --git a/src/pylorax/base.py b/src/pylorax/base.py index 54f472f6..10c5582f 100644 --- a/src/pylorax/base.py +++ b/src/pylorax/base.py @@ -130,7 +130,8 @@ class BaseImageClass(BaseLoraxClass): if dstdir: makedirs_(os.path.join(self.dsttree, dstdir)) - dcopy_(fname, dstdir, self.srctree, self.dsttree) + dcopy_(fname, dstdir, self.srctree, self.dsttree, + ignore_errors=not self.conf.pedantic) def rename(self, fname, target): fname = os.path.join(self.dsttree, fname) diff --git a/src/pylorax/config.py b/src/pylorax/config.py index 4c155ea9..136088ad 100644 --- a/src/pylorax/config.py +++ b/src/pylorax/config.py @@ -30,7 +30,9 @@ class LoraxConfig(object): # output settings self.colors = True self.encoding = "utf-8" - self.debug = False + self.debug = True + + self.pedantic = False self.confdir = "/etc/lorax" self.datadir = "/usr/share/lorax" diff --git a/src/pylorax/images.py b/src/pylorax/images.py index a8fdf3a4..3c2a72b4 100644 --- a/src/pylorax/images.py +++ b/src/pylorax/images.py @@ -806,12 +806,14 @@ class Install(BaseImageClass): def move_bins(self): # move bin to usr/bin scopy_(src_root=self.srctree, src_path="bin/*", - dst_root=self.srctree, dst_path="usr/bin") + dst_root=self.srctree, dst_path="usr/bin", + ignore_errors=not self.conf.pedantic) remove_(os.path.join(self.srctree, "bin")) # move sbin to /usr/sbin scopy_(src_root=self.srctree, src_path="sbin/*", - dst_root=self.srctree, dst_path="usr/sbin") + dst_root=self.srctree, dst_path="usr/sbin", + ignore_errors=not self.conf.pedantic) remove_(os.path.join(self.srctree, "sbin")) # fix broken links