mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Show a trace message on copy when with --dry-run.
This commit is contained in:
parent
ca047f1e12
commit
04f447f979
@ -81,18 +81,22 @@ class buildset:
|
|||||||
self.mail_report += text
|
self.mail_report += text
|
||||||
|
|
||||||
def copy(self, src, dst):
|
def copy(self, src, dst):
|
||||||
if not os.path.isdir(path.host(src)):
|
if self.opts.dry_run():
|
||||||
raise error.general('copying tree: no source directory: %s' % (path.host(src)))
|
log.output('copy: %s => %s' % (path.host(src), path.host(dst)))
|
||||||
if not self.opts.dry_run():
|
else:
|
||||||
try:
|
if not os.path.isdir(path.host(src)):
|
||||||
files = distutils.dir_util.copy_tree(path.host(src),
|
raise error.general('copying tree: no source directory: %s' % \
|
||||||
path.host(dst))
|
(path.host(src)))
|
||||||
for f in files:
|
if not self.opts.dry_run():
|
||||||
log.output(f)
|
try:
|
||||||
except IOError, err:
|
files = distutils.dir_util.copy_tree(path.host(src),
|
||||||
raise error.general('copying tree: %s -> %s: %s' % (src, dst, str(err)))
|
path.host(dst))
|
||||||
except distutils.errors.DistutilsFileError, err:
|
for f in files:
|
||||||
raise error.general('copying tree: %s' % (str(err)))
|
log.output(f)
|
||||||
|
except IOError, err:
|
||||||
|
raise error.general('copying tree: %s -> %s: %s' % (src, dst, str(err)))
|
||||||
|
except distutils.errors.DistutilsFileError, err:
|
||||||
|
raise error.general('copying tree: %s' % (str(err)))
|
||||||
|
|
||||||
def report(self, _config, _build):
|
def report(self, _config, _build):
|
||||||
if not _build.opts.get_arg('--no-report') and _build.opts.get_arg('--mail'):
|
if not _build.opts.get_arg('--no-report') and _build.opts.get_arg('--mail'):
|
||||||
@ -141,15 +145,13 @@ class buildset:
|
|||||||
what = '%s -> %s' % \
|
what = '%s -> %s' % \
|
||||||
(os.path.relpath(path.host(src)), os.path.relpath(path.host(dst)))
|
(os.path.relpath(path.host(src)), os.path.relpath(path.host(dst)))
|
||||||
log.trace('_bset: %s: collecting: %s' % (self.bset, what))
|
log.trace('_bset: %s: collecting: %s' % (self.bset, what))
|
||||||
if not self.opts.dry_run():
|
self.copy(src, dst)
|
||||||
self.copy(src, dst)
|
|
||||||
|
|
||||||
def install(self, name, buildroot, prefix):
|
def install(self, name, buildroot, prefix):
|
||||||
dst = prefix
|
dst = prefix
|
||||||
src = path.join(buildroot, prefix)
|
src = path.join(buildroot, prefix)
|
||||||
log.notice('installing: %s -> %s' % (name, path.host(dst)))
|
log.notice('installing: %s -> %s' % (name, path.host(dst)))
|
||||||
if not self.opts.dry_run():
|
self.copy(src, dst)
|
||||||
self.copy(src, dst)
|
|
||||||
|
|
||||||
def canadian_cross(self, _build):
|
def canadian_cross(self, _build):
|
||||||
# @fixme Switch to using a private macros map.
|
# @fixme Switch to using a private macros map.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user