[PATCH] Shell programming: directories are ``executable'' (that is, searchable), too.
On Wed, 02 Feb 2011, Thomas Schwinge wrote: > Signed-off-by: Thomas Schwinge > --- > test/test-lib.sh |5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/test/test-lib.sh b/test/test-lib.sh > index f536172..3471ead 100755 > --- a/test/test-lib.sh > +++ b/test/test-lib.sh > @@ -815,13 +815,14 @@ EOF > } > > > +# Locate the directory containing the `notmuch' executable we are to use. > find_notmuch_path () > { > dir="$1" > > while [ -n "$dir" ]; do > bin="$dir/notmuch" > - if [ -x "$bin" ]; then > + if [ -f "$bin" -a -x "$bin" ]; then Looks good to me. Thanks. -Michal
Re: [PATCH] Shell programming: directories are ``executable'' (that is, searchable), too.
On Wed, 02 Feb 2011, Thomas Schwinge wrote: Signed-off-by: Thomas Schwinge tho...@schwinge.name --- test/test-lib.sh |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index f536172..3471ead 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -815,13 +815,14 @@ EOF } +# Locate the directory containing the `notmuch' executable we are to use. find_notmuch_path () { dir=$1 while [ -n $dir ]; do bin=$dir/notmuch - if [ -x $bin ]; then + if [ -f $bin -a -x $bin ]; then Looks good to me. Thanks. -Michal ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] Shell programming: directories are ``executable'' (that is, searchable), too.
Signed-off-by: Thomas Schwinge tho...@schwinge.name --- test/test-lib.sh |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index f536172..3471ead 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -815,13 +815,14 @@ EOF } +# Locate the directory containing the `notmuch' executable we are to use. find_notmuch_path () { dir=$1 while [ -n $dir ]; do bin=$dir/notmuch - if [ -x $bin ]; then + if [ -f $bin -a -x $bin ]; then echo $dir return fi @@ -858,7 +859,7 @@ then make_valgrind_symlink () { # handle only executables - test -x $1 || return + test -f $1 -a -x $1 || return base=$(basename $1) symlink_target=$TEST_DIRECTORY/../$base -- 1.7.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] Shell programming: directories are ``executable'' (that is, searchable), too.
Signed-off-by: Thomas Schwinge --- test/test-lib.sh |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index f536172..3471ead 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -815,13 +815,14 @@ EOF } +# Locate the directory containing the `notmuch' executable we are to use. find_notmuch_path () { dir="$1" while [ -n "$dir" ]; do bin="$dir/notmuch" - if [ -x "$bin" ]; then + if [ -f "$bin" -a -x "$bin" ]; then echo "$dir" return fi @@ -858,7 +859,7 @@ then make_valgrind_symlink () { # handle only executables - test -x "$1" || return + test -f "$1" -a -x "$1" || return base=$(basename "$1") symlink_target=$TEST_DIRECTORY/../$base -- 1.7.1