[Zope-CVS] CVS: Zope - stupid_clean:1.2

Florent Guillaume fg@nuxeo.com
Tue, 23 Jul 2002 07:15:55 -0400


Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv10928

Modified Files:
	stupid_clean 
Log Message:
Corrected 'find' GNUism, and use more idiomatic syntax for the clean.

Note that we'll fail on filenames with spaces or quotes in them.


=== Zope/stupid_clean 1.1 => 1.2 ===
 # "python setup.py clean" doesn't work with a --inplace build, so use
 # this instead (copied from the Zope3 tree).
 
-files=`find -name \*.o -o -name \*.so -o -name \*.py[co] -o -name core\*`
-if [ ! -z "$files" ] ; then
-    rm $files
-fi
-
+# XXX Note! this won't work for filenames that have spaces in them!
+#     Unfortunately find -print0 and xargs -0 don't exist on
+#     some platforms (Solaris for instance) so we can't use them...
 
+find . -name '*.o' -o -name '*.so' -o -name '*.py[co]' \
+    -o -name 'core*' | xargs rm -f