cvsclean script

From: Date: Fri, 02 Nov 2001 13:27:55 +0000
Subject: cvsclean script
Groups: php.dev 
Request: Send a blank email to php-dev+get-69525@lists.php.net to get a copy of this message
i had a closer look at the php4/cvsclean script yesterday as i was experiencing some problems when running configure that were clearly related to left-over files from previous runs while i thought cvsclean would remove every file not under CVS control i found in php4/build/build.mk that it only removes files matching .cvsignore entries ... :( so here's a short script that would find out which files to keep by examining all CVS/Entries files instead: ---------------------------------------------------------------------- #!/bin/sh ( # list all file entries within CVS Entries files for cvsdir in find . -name CVS do cvsdir=echo $cvsdir | sed -e's/\/CVS$//' awk -F / "/[^D].*/ { if(NF>1 && \$1==\"\") print \"$cvsdir/\"\$2}" \
                                                   $cvsdir/CVS/Entries
done # list *all* files find . -type f -print | grep -v '/CVS/' | grep -v '/CVS$' # files listed only once are not CVS-managed, so we remove them # (files listed in CVS but nonexistant will also appear only # once, but trying to remove them won't harm so we do not # take action to identify them here) ) | sort | uniq -u | xargs rm -vf # remove empty directories find . -type d -a -empty | xargs rm -rvf ---------------------------------------------------------------------- i think this is cvsclean done the "RIGHT WAY"(TM) and will check it in next week if i read no serious objections -- Hartmut Holzgraefe hartmut@six.de http://www.six.de +49-711-99091-77

« previous php.dev (#69525) next »