]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: portable usage of find command
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 17 Feb 2016 12:03:11 +0000 (13:03 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 18 Feb 2016 11:53:47 +0000 (12:53 +0100)
 - use dot instead of skipping search-path
 - avoid -perm /a+x
 - avoid -path

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/run.sh
tests/ts/build-sys/config
tests/ts/cramfs/mkfs
tools/checkmans.sh

index dca9c6c54e8461492b996b0fde8177f297d56959..03cd9f5c248fe4ce07632723cd9ef9d9aa201723 100755 (executable)
@@ -34,6 +34,13 @@ function num_cpus()
        fi
 }
 
+function find_test_scripts()
+{
+       local searchdir="$1"
+       find "$searchdir" -type f -regex ".*/[^\.~]*" \
+               \( -perm -u=x -o -perm -g=x -o -perm -o=x \)
+}
+
 while [ -n "$1" ]; do
        case "$1" in
        --force)
@@ -117,7 +124,7 @@ if [ -n "$SUBTESTS" ]; then
        # selected tests only
        for s in $SUBTESTS; do
                if [ -d "$top_srcdir/tests/ts/$s" ]; then
-                       comps+=( $(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*") )
+                       comps+=( $(find_test_scripts "$top_srcdir/tests/ts/$s") ) || exit 1
                else
                        echo "Unknown test component '$s'"
                        exit 1
@@ -129,7 +136,7 @@ else
                exit 1
        fi
 
-       comps=( $(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*") )
+       comps=( $(find_test_scripts "$top_srcdir/tests/ts") ) || exit 1
 fi
 
 if [ -n "$EXCLUDETESTS" ]; then
index 15b355103f805421409a66c337324f8e48ec503d..bc48c509d07995eaaf4903700d54b9deee549461 100755 (executable)
@@ -32,7 +32,7 @@ for conf in $config_gen_dir/config-gen.d/*.conf; do
        ./configure $opts &> /dev/null
        make -j &> /dev/null
 
-       bins=$(find . -type f -perm /a+x | sort)
+       bins=$(find . -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) | sort)
        for b in $bins; do
                libs=$(readelf --dynamic $b 2> /dev/null   | \
                        awk '/NEEDED/ { print $5 }' | \
index 78e5c176451b343e68efe6b52629ece5f439e11b..07f703f67b6f8c7593732e8bb284c3a42b1c76bc 100755 (executable)
@@ -66,7 +66,7 @@ fi
 ts_cd "$IMAGE_SRC"
 
 ts_log "list checksums from original data"
-find -type f -exec md5sum {} \; | sort >> $TS_OUTPUT
+find -type f -exec md5sum {} \; | sort >> $TS_OUTPUT
 echo >> $TS_OUTPUT
 
 ts_log "create cramfs image"
index 9a137780ca5135780ca11a757643a156c0bbc010..63da3d73e5cf218d23d1e8b77d5bb05d38affb4a 100755 (executable)
@@ -70,7 +70,7 @@ remove_repeats()
 cd $(git rev-parse --show-toplevel)
 
 for I in $(
-       find -path './autom4te.cache' -prune -o -path './.libs' -prune -o -name '*[[:alpha:]].[1-8]' -print
+       find . -type f -name '*[[:alpha:]].[1-8]' |grep -v "autom4te.cache\|\.libs/"
 ); do
        MAN_FILE=${I##*/}
        MAN_LIST[${MAN_FILE%%.[0-9]}]=1