Subject: Re: cleaning out xsrc
To: Steven M. Bellovin <smb@research.att.com>
From: Frederick Bruckman <fredb@immanent.net>
List: current-users
Date: 03/07/2004 12:10:56
On Sun, 7 Mar 2004, Steven M. Bellovin wrote:

> 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)

Harmless...

> 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

Ah, that would have done it, except the files you're wanting to delete
are from the (now unused) XFree86 *3* tree.

> 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?

Try

  make cleandir USE_XF86_4=no

If "cvs" catches anything after that, you can safely delete it, and if
it reappears on a build and doesn't get cleaned, it's a bug.

Frederick