From: Martin Schwenke Date: Tue, 12 Jul 2016 01:57:55 +0000 (+1000) Subject: ctdb-scripts: Avoid shellcheck warning SC2039 (test -nt operator) X-Git-Tag: tdb-1.3.10~261 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e96c1227908257a9371c11dda99ca3d0fa07208d;p=thirdparty%2Fsamba.git ctdb-scripts: Avoid shellcheck warning SC2039 (test -nt operator) SC2039: In POSIX sh, -nt is not supported. This script is specific to the Linux NFS implementation. The -nt operator is well supported in Linux shells (e.g. dash, bash, ksh). The alternatives (e.g. using stat(1)) would result in less readable code. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout index 9424d9a96cf..9b72446b44e 100755 --- a/ctdb/config/nfs-linux-kernel-callout +++ b/ctdb/config/nfs-linux-kernel-callout @@ -184,6 +184,8 @@ nfs_check_thread_count () nfs_monitor_list_shares () { _cache_file="${CTDB_NFS_CALLOUT_STATE_DIR}/list_shares_cache" + # -nt operator is well supported in Linux: dash, bash, ksh, ... + # shellcheck disable=SC2039 if [ ! -r "$nfs_exports_file" ] || [ ! -r "$_cache_file" ] || \ [ "$nfs_exports_file" -nt "$_cache_file" ] ; then mkdir -p "$CTDB_NFS_CALLOUT_STATE_DIR"