]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: deploy-target: Don't use find -exec
authorDaniel Lublin <daniel@lublin.se>
Wed, 31 May 2017 06:02:20 +0000 (08:02 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 3 Jun 2017 22:43:27 +0000 (23:43 +0100)
find may be provided by busybox, which might be compiled without support
for -exec.

Signed-off-by: Daniel Lublin <daniel@lublin.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/devtool/deploy.py

index b3730ae833733667e169109579b214a198793b26..d181135a9d204a5446a58b4c8b28c841422f2531 100644 (file)
@@ -119,7 +119,11 @@ def _prepare_remote_script(deploy, verbose=False, dryrun=False, undeployall=Fals
         # Put any preserved files back
         lines.append('if [ -d $preservedir ] ; then')
         lines.append('    cd $preservedir')
-        lines.append('    find . -type f -exec mv {} /{} \;')
+        # find from busybox might not have -exec, so we don't use that
+        lines.append('    find . -type f | while read file')
+        lines.append('    do')
+        lines.append('        mv $file /$file')
+        lines.append('    done')
         lines.append('    cd /')
         lines.append('    rm -rf $preservedir')
         lines.append('fi')