su9nil14 / canviz

Automatically exported from code.google.com/p/canviz
0 stars 0 forks source link

Makefile not compatible with GNU xargs #47

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I had used BSD xargs on my Mac OS X system and all was well, but if you
have GNU xargs, this problem occurs:

mkdir ./graphs/images
find /mp/share/graphviz/graphs -type f -name '*.gif' -or -name '*.jpg' -or
-name '*.png' -print0 | gxargs -0 -t -n 1 -J % cp % ./graphs/images
gxargs: invalid option -- J
Usage: gxargs [-0prtx] [--interactive] [--null] [-d|--delimiter=delim]
       [-E eof-str] [-e[eof-str]]  [--eof[=eof-str]]
       [-L max-lines] [-l[max-lines]] [--max-lines[=max-lines]]
       [-I replace-str] [-i[replace-str]] [--replace[=replace-str]]
       [-n max-args] [--max-args=max-args]
       [-s max-chars] [--max-chars=max-chars]
       [-P max-procs]  [--max-procs=max-procs] [--show-limits]
       [--verbose] [--exit] [--no-run-if-empty] [--arg-file=file]
       [--version] [--help] [command [initial-arguments]]

Report bugs to <bug-findutils@gnu.org>.
make: *** [examples-images] Error 1

Apparently the -J option is not portable.

This problem was initially reported on the discussion group by Ron Newman:

http://groups.google.com/group/canviz/browse_thread/thread/2d67f1049b84172

Original issue reported on code.google.com by ryandesi...@gmail.com on 6 Jan 2009 at 9:43

GoogleCodeExporter commented 8 years ago

Original comment by ryandesi...@gmail.com on 8 Jan 2009 at 1:49

GoogleCodeExporter commented 8 years ago
On gnu systems use -I

$ svn diff Makefile
Index: Makefile
===================================================================
--- Makefile    (revision 258)
+++ Makefile    (working copy)

@@ -75,7 +76,7 @@
 endef

 examples-images: $(EXAMPLE_GRAPH_IMAGES_DIR)
-       $(FIND) $(EXAMPLE_GRAPHS_SRC_DIR) -type f -name '*.gif' -or -name 
'*.jpg' -or
-name '*.png' -print0 | $(XARGS) -0 -t -n 1 -J % cp % 
$(EXAMPLE_GRAPH_IMAGES_DIR)
+       $(FIND) $(EXAMPLE_GRAPHS_SRC_DIR) -type f -name '*.gif' -or -name 
'*.jpg' -or
-name '*.png' -print0 | $(XARGS) -0 -t -n 1 -I % cp % 
$(EXAMPLE_GRAPH_IMAGES_DIR)

Original comment by mrk...@gmail.com on 19 Jan 2009 at 11:18

GoogleCodeExporter commented 8 years ago
Thanks, done in r259. The problem is it doesn't fix the issue for Ron, whose GNU
xargs is too old to have the -I option. I'm thinking of forgoing xargs and 
using a
for loop instead. Thoughts? Other ideas?

Original comment by ryandesi...@gmail.com on 20 Jan 2009 at 10:53

GoogleCodeExporter commented 8 years ago
Can't use just use -exec in the find command.  I don't see xargs as adding any 
value.  I too, have an old args command. 

Original comment by briane...@gmail.com on 26 Mar 2010 at 1:29