From: Ruediger Meier <sweet_f_a@gmx.de>
To: util-linux@vger.kernel.org
Subject: [PATCH 02/15] build-sys: portable usage of find command
Date: Thu, 18 Feb 2016 14:12:42 +0100 [thread overview]
Message-ID: <1455801169-10470-3-git-send-email-sweet_f_a@gmx.de> (raw)
In-Reply-To: <1455801169-10470-1-git-send-email-sweet_f_a@gmx.de>
From: Ruediger Meier <ruediger.meier@ga-group.nl>
- 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 | 11 +++++++++--
tests/ts/build-sys/config | 2 +-
tests/ts/cramfs/mkfs | 2 +-
tools/checkmans.sh | 2 +-
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/tests/run.sh b/tests/run.sh
index dca9c6c..03cd9f5 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -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
diff --git a/tests/ts/build-sys/config b/tests/ts/build-sys/config
index 15b3551..bc48c50 100755
--- a/tests/ts/build-sys/config
+++ b/tests/ts/build-sys/config
@@ -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 }' | \
diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs
index 78e5c17..07f703f 100755
--- a/tests/ts/cramfs/mkfs
+++ b/tests/ts/cramfs/mkfs
@@ -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"
diff --git a/tools/checkmans.sh b/tools/checkmans.sh
index 9a13778..63da3d7 100755
--- a/tools/checkmans.sh
+++ b/tools/checkmans.sh
@@ -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
--
1.8.4.5
next prev parent reply other threads:[~2016-02-18 13:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 13:12 [PATCH 00/15] portability fixes in the mix (OSX) Ruediger Meier
2016-02-18 13:12 ` [PATCH 01/15] travis: minor cleanup Ruediger Meier
2016-02-18 13:12 ` Ruediger Meier [this message]
2016-02-18 13:12 ` [PATCH 03/15] build-sys: check linker support for version scripts Ruediger Meier
2016-02-18 13:12 ` [PATCH 04/15] build-sys: fix [g]libtoolize version for OSX Ruediger Meier
2016-02-18 13:12 ` [PATCH 05/15] tests: fix ts_option helpers Ruediger Meier
2016-02-18 13:12 ` [PATCH 06/15] lib: rename strmode() and setmode() Ruediger Meier
2016-02-18 13:12 ` [PATCH 07/15] include: provide MAP_ANONYMOUS on OSX Ruediger Meier
2016-02-18 13:21 ` Karel Zak
2016-02-18 14:10 ` Ruediger Meier
2016-02-18 14:28 ` Karel Zak
2016-02-18 15:51 ` [PATCH v2 " Ruediger Meier
2016-02-18 13:12 ` [PATCH 08/15] lib: define LOGIN_NAME_MAX fallback Ruediger Meier
2016-02-18 13:12 ` [PATCH 09/15] include: check for sys/sysmacros.h Ruediger Meier
2016-02-18 13:22 ` [PATCH 10/15] include: remove unused mntent.h Ruediger Meier
2016-02-18 13:22 ` [PATCH 11/15] lsns: use xcalloc() Ruediger Meier
2016-02-18 13:22 ` [PATCH 12/15] lib: remove unused variable Ruediger Meier
2016-02-18 13:23 ` [PATCH 13/15] lib: fix ismounted includes for FreeBSD Ruediger Meier
2016-02-18 13:23 ` [PATCH 14/15] libblkid: don't include endian.h Ruediger Meier
2016-02-18 13:23 ` [PATCH 15/15] include: fix sys/sysinfo.h Ruediger Meier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455801169-10470-3-git-send-email-sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox