Fix revdep-rebuild to automatically determine how to call find correctly
authorfuzzyray <fuzzyray@gentoo.org>
Wed, 28 Dec 2005 20:43:06 +0000 (20:43 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Wed, 28 Dec 2005 20:43:06 +0000 (20:43 -0000)
svn path=/; revision=269

trunk/ChangeLog
trunk/src/revdep-rebuild/revdep-rebuild

index ea45431ce50762bb14acb691b56becbeb2ae5589..60b36020e96aa2afd273a6fa25670fd53197cefb 100644 (file)
@@ -1,3 +1,6 @@
+2005-12-28 Paul Varner <fuzzyray@gentoo.org>
+       * revdep-rebuild: Fix to automatically determine how to call find (Bug 111203)
+
 2005-12-19 Paul Varner <fuzzyray@gentoo.org>
        * eclean: Add regular expression matching for exclude files (Bug 114365)
 
index 649cf83a6c8037ba76c8ec62447ad0e7f10eabde..acd02b5fe6e319bc0a1c089a72887cd2eaa5af6e 100755 (executable)
@@ -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