[OE-core] [PATCH] devtool: deploy-target: Don't use find -exec

Paul Eggleton paul.eggleton at linux.intel.com
Tue May 30 21:48:02 UTC 2017


Hi Daniel,

On Wednesday, 31 May 2017 2:40:43 AM NZST Daniel Lublin wrote:
> find may be provided by busybox, which might be compiled without support
> for -exec.
> 
> Signed-off-by: Daniel Lublin <daniel at lublin.se>
> ---
>  scripts/lib/devtool/deploy.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/devtool/deploy.py b/scripts/lib/devtool/deploy.py
> index b3730ae833..af367d2985 100644
> --- a/scripts/lib/devtool/deploy.py
> +++ b/scripts/lib/devtool/deploy.py
> @@ -119,7 +119,10 @@ 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 {} /{} \;')
> +        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')
> 

Looks good, but could you please add a short comment above this just to make 
it obvious why we are doing it this way?

Thanks,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list