lib.oe.path: "copyhardlinktree" should be able to copy folder containng hidden files only
PATCH 1/1 lib.oe.path: "copyhardlinktree" should be able to copy folder containng hidden files only
Note: file is "hidden" if it's name starts with dot (.)
sstate.bbclass uses "copyhardlinktree" function to install sstate cache content. Function "copyhardlinktree" uses "cp" command line which fail on copy directories with hidden files only. As a result folder containing only hidden files cannot be installed from sstate cache.
"cp" source file glob argument has been changed from
./.??* ./*
to
<source>/./
Steps for reproduce:
* Add next lines into some recipe ...
inherit deploy
do_deploy() {
touch ${DEPLOYDIR}/.hidden
}
addtask deploy* ... and try to build it
Error like next will occur:
Exception: subprocess.CalledProcessError: Command 'cp -afl --preserve=xattr ./.??* ./* /path/to/deploy/images/machine' returned non-zero exit status 1.
Subprocess output:
cp: cannot stat './*': No such file or directory
--- meta/lib/oe/path.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
meta/lib/oe/path.py +3 -9
@@ -104,17 +104,11 @@ def copyhardlinktree(src, dst): # writers try and create a directory at the same time cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst) subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) - source = '' + source = src if os.path.isdir(src): - if len(glob.glob('%s/.??*' % src)) > 0: - source = './.??* ' - source += './*' - s_dir = src - else: - source = src - s_dir = os.getcwd() + source += '/./' cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst)) - subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT) + subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) else: copytree(src, dst)
Signature · 1 line
2.17.1