Browse Source

Clifford Wolf:


			
			
				rocklinux
			
			
		
Clifford Wolf 21 years ago
parent
commit
568673232c
1 changed files with 6 additions and 21 deletions
  1. +6
    -21
      scripts/xfind.sh

+ 6
- 21
scripts/xfind.sh

@ -2,26 +2,11 @@
# Subversion has really big ".svn" subdirs. This has much better performance
# than the "find ... ! -path '*/.svn*' ! -path '*/CVS*' ..." used earlier
# in various places.
# in various places. Never use this with -depth! Instead pipe the output thru
# "tac" or "sort -r".
tmp1=`mktemp` tmp2=`mktemp`
while [ "$#" -gt 0 ]
do
[ -z "${1##[-(\!]*}" ] && break
echo $1 >> $tmp1
shift
done
while ! cmp -s $tmp1 $tmp2
do
cat $tmp1 > $tmp2
find $( cat $tmp2 ) -maxdepth 1 -type d \
! -name 'CVS' ! -name '.svn' | sort -u > $tmp1
done
find $( cat $tmp2 ) -mindepth 1 -maxdepth 1 \
! -name 'CVS' ! -name '.svn' "$@"
rm -f $tmp1 $tmp2
dirs=""; while [ -n "${1##[-\(]*}" ]; do dirs="$dirs $1"; shift; done
if [ $# -eq 0 ]; then set -- -print; fi;
action=") -print"; if [ "${*#-print}" != "$*" ]; then action=""; fi
find $dirs '(' -path '*/.svn' -o -path '*/CVS' ')' -prune -o ${action:+\(} "$@" $action

Loading…
Cancel
Save