On Nov 23, 2009, at 3:03 AM, Stefan Sperling wrote: > On Mon, Nov 23, 2009 at 12:44:32AM -0600, Peter Samuelson wrote: >> >> [Martin Furter] >>> --- Makefile.in (revision 883010) >>> +++ Makefile.in (working copy) >>> @@ -369,8 +369,8 @@ >>> rm -f $(CLEAN_FILES) >>> find $(CTYPES_PYTHON_SRC_DIR) $(SWIG_PY_SRC_DIR) $(SWIG_PY_DIR) \ >>> $(abs_srcdir)/build -name "*.pyc" -exec rm {} ';' >>> - find $(abs_srcdir)/subversion/tests/ -mindepth 2 -maxdepth 3 \ >>> - -name "*.pyc" -exec rm {} ';' >>> + rm -f $(abs_srcdir)/subversion/tests/*/*.pyc >>> + rm -f $(abs_srcdir)/subversion/tests/*/*/*.pyc >> >> That may be more portable, or again, maybe not. It could fail on some >> Unixes due to limitations on command line length, particularly if >> $(abs_srcdir) is itself a long path. Probably better: >> >> cd $(abs_srcdir)/subversion/tests; rm -f */*.pyc >> cd $(abs_srcdir)/subversion/tests; rm -f */*/*.pyc >> >> Or even: >> >> cd $(abs_srcdir)/subversion/tests; echo */*.pyc | xargs rm -f >> cd $(abs_srcdir)/subversion/tests; echo */*/*.pyc | xargs rm -f > > Why are we trying to dynamically get the list of .pyc files in Makefile.in? > Why not just pre-compute the .pyc list and pass it to rm -f during > make fast-clean? Let's just put the list into build-outputs.mk. > The TEST_PROGRAMS variable probably already contains the list of .py > files corresponding to the .pyc files we want to remove. > It could be very simple to make gen-make.py add the corresponding > .pyc files to the CLEAN_FILES variable. > > Speaking of which, rm -f $(CLEAN_FILES) could also end up being too > long on certain types of UNIX. So maybe put .pycs into a different list. > Or if we can find out the minimum length supported by systems still in > use today, we split up CLEAN_FILES accordingly, and run > rm -f $(CLEAN_FILES1); rm -rf $(CLEAN_FILES2); ... etc.
Or just use xargs(1). -Hyrum