Show a trace message on copy when with --dry-run.

This commit is contained in:
Chris Johns 2013-05-13 14:47:14 +10:00
parent ca047f1e12
commit 04f447f979

View File

@ -81,8 +81,12 @@ class buildset:
self.mail_report += text
def copy(self, src, dst):
if self.opts.dry_run():
log.output('copy: %s => %s' % (path.host(src), path.host(dst)))
else:
if not os.path.isdir(path.host(src)):
raise error.general('copying tree: no source directory: %s' % (path.host(src)))
raise error.general('copying tree: no source directory: %s' % \
(path.host(src)))
if not self.opts.dry_run():
try:
files = distutils.dir_util.copy_tree(path.host(src),
@ -141,14 +145,12 @@ class buildset:
what = '%s -> %s' % \
(os.path.relpath(path.host(src)), os.path.relpath(path.host(dst)))
log.trace('_bset: %s: collecting: %s' % (self.bset, what))
if not self.opts.dry_run():
self.copy(src, dst)
def install(self, name, buildroot, prefix):
dst = prefix
src = path.join(buildroot, prefix)
log.notice('installing: %s -> %s' % (name, path.host(dst)))
if not self.opts.dry_run():
self.copy(src, dst)
def canadian_cross(self, _build):