Subject: Re: cleaning out xsrc
To: Frederick Bruckman <fredb@immanent.net>
From: Steven M. Bellovin <smb@research.att.com>
List: current-users
Date: 03/07/2004 12:53:40
In message <Pine.NEB.4.58.0403071113460.2259@seduction.immanent.net>, Frederick
 Bruckman writes:
>On Sun, 7 Mar 2004, Andreas Kahari wrote:
>
>> On Sun, Mar 07, 2004 at 11:43:43AM -0500, Steve Bellovin wrote:
>> > In my /usr/xsrc, I have lots of .depend files and Makefiles.  Here's a
>> > partial sample from a 'cvs update':
>> >
>> > ? xc/lib/Xdmcp/.depend
>> > ? xc/lib/Xdmcp/Makefile
>> > ? xc/lib/Xdpms/.depend
>> > ? xc/lib/Xdpms/Makefile
>> >
>> > What's the right way to clean them out?  'make clean' in /usr/xsrc
>> > doesn't work:
>>
>> I'm not sure about "right", but one way to do it would be to do this:
>>
>> cd /usr/xsrc
>> sed -n 's/^\? //p' < /tmp/cvsoutput | xargs sudo rm -rf
>
>Why not simply "make cleandir"????
>
>Frederick
>
Because it doesn't do the trick -- those files still exist:

# make cleandir
make -f xmakefile clean
make: cannot open xmakefile.

make: stopped in /usr/xsrc/xfree/xc
*** Error code 2

Stop.
make: stopped in /usr/xsrc/xfree/xc
*** Error code 1 (ignored)
make: don't know how to make clean. Stop

make: stopped in /usr/xsrc/local
*** Error code 2 (ignored)
find xfree/xc contrib local -name .depend | xargs -n5 rm
find xfree/xc contrib local -name 'Makefile*' |  xargs -n5 grep -l "Makefile generated by imake" | xargs rm
rmdir xfree/xc/exports
rmdir: xfree/xc/exports: No such file or directory
*** Error code 1 (ignored)
rm -f xfree/xc/xmakefile

And yes, I could easily write a little script to delete them, or I 
could check out a fresh copy of the tree.  Both thoughts had, of 
course, occurred to me.  Note the wording of my question, this time 
with emphasis added: what's the *right* way to do it?  

		--Steve Bellovin, http://www.research.att.com/~smb