#!/bin/bash
find -name .cvsignore -exec rm {} \;
-cvs up -I'!' | grep -v .cvsignore | awk '{print $NF}' | grep -v cleanup >& cvsup
-rm -vrf $(<cvsup) `find -name '*~' -o -name '*.o' -o -name '.#*'`
+cvs up -C | \
+ grep -v .cvsignore | \
+ egrep -v '^(U|P|\?|\()' | \
+ awk '{print $NF}' | \
+ grep -v cleanup >& cvsup
+cat cvsup | xargs rm -vrf
+find '(' -name '*~' -o -name '*.o' -o '.#*' ')' -print0 | xargs -0 rm -vf
cvs up > /dev/null
rm -f cvsup