Hmm...  This is a question to findutils maintainer.
I know I can fix the problem with the following patch, 
> -  find "$1" \( \! -type d \) -a -xdev -print0 |xargs -0 rm -f
> +  find "$1" -xdev \( \! -type d \) -a -print0 | xargs -0 -n 10 rm -f


But why does xargs bail out with this without it? :
> xargs: rm: Argument list too long

Is this intentional?


> Package: pbuilder
> Version: 0.127
> Severity: normal
> Tags: patch
> 
> 
> Coin,
> 
> "pbuilder update" did its update job properly but failed to clean build
> dir after job done :
> <quote>
>  -> new cache content wget_1.10-1_i386.deb added
>  -> new cache content setserial_2.17-41_i386.deb added
>  -> unmounting dev/pts filesystem
>  -> unmounting proc filesystem
>  -> creating base tarball [/var/cache/pbuilder/base.tgz]
>  -> cleaning the build env
>     -> removing directory /data/pbuilder//12951 and its subdirectories
> xargs: rm: Argument list too long
> </quote>
> 
> which can be reproduced by simulating clean_subdirectories :
> <quote>
> [EMAIL PROTECTED] pbuilder]# find "/data/pbuilder/12951/" \( \! -type d \) -a
> -xdev -print0 |xargs -0 rm -f
> find: warning: you have specified the -xdev option after a non-option
> argument (, but options are not positional (-xdev affects tests
> specified before it as well as those specified after it).  Please
> specify options before other arguments.
> 
> xargs: rm: Argument list too long
> </quote>
> 
> Here is a patch working in my pond :
> <quote>
> --- pbuilder-modules.orig       2005-06-11 13:22:06.549001232 +0200
> +++ pbuilder-modules    2005-06-11 13:22:25.272154880 +0200
> @@ -184,7 +184,7 @@
>        return;
>    fi
>    echo "    -> removing directory $1 and its subdirectories"
> -  find "$1" \( \! -type d \) -a -xdev -print0 |xargs -0 rm -f
> +  find "$1" -xdev \( \! -type d \) -a -print0 | xargs -0 -n 10 rm -f
>    find "$1"  -type d -xdev -depth -print0 | \
>        (xargs -0 rmdir || true)
>  }
> </quote>
> 
> -- 
> Marc Dequènes (Duck)
> [2  <application/pgp-signature (7bit)>]
> 

Reply via email to