Subject: Surprising xargs behavior on Solaris 10
To: None <tech-pkg@netbsd.org>
From: Stefan Bethke <stb@lassitu.de>
List: tech-pkg
Date: 08/31/2005 16:41:46
I ran into some trouble trying to build devel/tcllib:

===> Extracting for tcllib-1.7
===> Required installed package tcl>=8.4.7nb1: tcl-8.4.11 found
===> Patching for tcllib-1.7
=> Fixing hardcoded ftp binary
usage: rm [-fiRr] file ...
*** Error code 2

The Makefile contains this:
post-patch:
         @${FIND} ${WRKSRC} -name \*.orig | ${XARGS} ${RM}

Apparently, there are no .orig files, but on Solaris, /usr/bin/xargs  
(as well as /usr/xpg6/bin/xargs) still runs rm, just without any args?!

# uname -a
SunOS dogbert 5.10 Generic_118822-08 sun4u sparc SUNW,Sun-Fire-V210
# </dev/null xargs echo foo
foo
#

My FreeBSD system at home does the proper thing (I believe):
$ uname -a
FreeBSD diesel.lassitu.de 5.4-STABLE FreeBSD 5.4-STABLE #2: Sat Jun   
4 15:51:17 CEST 2005     root@diesel.lassitu.de:/usr/obj/usr/src/sys/ 
DIESEL  i386
$ </dev/null xargs echo
$

The fix (for me here) is obvious: add a dummy file to delete to the  
xargs line; how to properly deal with  this, I don't know.


Stefan

-- 
Stefan Bethke <stb@lassitu.de>   Fon +49 170 346 0140