From: fuzzyray Date: Wed, 28 Dec 2005 20:43:06 +0000 (-0000) Subject: Fix revdep-rebuild to automatically determine how to call find correctly X-Git-Tag: gentoolkit-0.2.4.3~244 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e3e6e2e24a868b43c24a3ec82d9cb451a75c5523;p=gentoolkit.git Fix revdep-rebuild to automatically determine how to call find correctly svn path=/; revision=269 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index ea45431..60b3602 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,6 @@ +2005-12-28 Paul Varner + * revdep-rebuild: Fix to automatically determine how to call find (Bug 111203) + 2005-12-19 Paul Varner * eclean: Add regular expression matching for exclude files (Bug 114365) diff --git a/trunk/src/revdep-rebuild/revdep-rebuild b/trunk/src/revdep-rebuild/revdep-rebuild index 649cf83..acd02b5 100755 --- a/trunk/src/revdep-rebuild/revdep-rebuild +++ b/trunk/src/revdep-rebuild/revdep-rebuild @@ -319,16 +319,26 @@ else set_trap "$LIST.1_*" - # Hack for broken versions of find. I'm using a case statement in case I have to add more - find_version=$(find --version 2>/dev/null | awk '/find/ {print $NF}') - case "$find_version" in - 4.2.25 | 4.2.27 ) + # Hack for the different versions of find. + find_results=$(find /usr/bin/revdep-rebuild -type f -perm /u+x 2>/dev/null) + if [ -z $find_results ] + then + find_results=$(find /usr/bin/revdep-rebuild -type f -perm +u+x 2>/dev/null) + if [ -z $find_results ] + then + echo -e "\n" + echo -e "${RD}Unable to determine how to use find to locate executable files${NO}" + echo -e "${RD}Open a bug at http://bugs.gentoo.org${NO}" + echo + exit 1 + else + # using -perm +u+x for find command + find $SEARCH_DIRS -type f \( -perm +u+x -o -name '*.so' -o -name '*.so.*' \) 2>/dev/null | sort | uniq >$LIST.0_files + fi + else + # using -perm /u+x for find command find $SEARCH_DIRS -type f \( -perm /u+x -o -name '*.so' -o -name '*.so.*' \) 2>/dev/null | sort | uniq >$LIST.0_files - ;; - * ) - find $SEARCH_DIRS -type f \( -perm +u+x -o -name '*.so' -o -name '*.so.*' \) 2>/dev/null | sort | uniq >$LIST.0_files - ;; - esac + fi # Remove files that match SEARCH_DIR_MASK for dir in $SEARCH_DIRS_MASK