From 29c8430a96e386aa3f12432dc6272e38462a068d Mon Sep 17 00:00:00 2001 From: Paul Sherwood Date: Sun, 3 Jul 2016 17:37:16 +0100 Subject: [PATCH] Tidyup some messages --- ybd/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ybd/utils.py b/ybd/utils.py index a0fb086..60bf69d 100644 --- a/ybd/utils.py +++ b/ybd/utils.py @@ -134,6 +134,9 @@ def hardlink_all_files(srcpath, destpath): def _process_tree(root, srcpath, destpath, actionfunc): + if os.path.lexists(destpath): + app.log('OVERLAPS', 'WARNING: overlap at', destpath, verbose=True) + file_stat = os.lstat(srcpath) mode = file_stat.st_mode @@ -151,8 +154,9 @@ def _process_tree(root, srcpath, destpath, actionfunc): print 'realpath is', realpath app.log('UTILS', 'ERROR: file operation failed', exit=True) + if not stat.S_ISDIR(dest_stat.st_mode): - raise IOError('Destination not a directory. source has %s' + raise IOError('Destination not a directory: source has %s' ' destination has %s' % (srcpath, destpath)) for entry in os.listdir(srcpath): @@ -195,8 +199,7 @@ def _process_tree(root, srcpath, destpath, actionfunc): else: # Unsupported type. - raise IOError('Cannot extract %s into staging-area. Unsupported' - ' type.' % srcpath) + raise IOError('Cannot stage %s, unsupported type' % srcpath) def copy_file_list(srcpath, destpath, filelist):