From cf6aec9febfa7d9da2b006d6c5618b551d48be7b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 31 Aug 2021 04:58:06 +0300 Subject: [PATCH 5/5] Replace uses of deprecated 'which' command with 'command -v' See osdn #42769 Signed-off-by: Marko Lindqvist --- bootstrap/generate_gitrev.sh | 2 +- fc_version | 2 +- scripts/mapimg2anim | 6 +++--- scripts/setup_auth_server.sh | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bootstrap/generate_gitrev.sh b/bootstrap/generate_gitrev.sh index c5bbdce6de..fdde1c2e29 100755 --- a/bootstrap/generate_gitrev.sh +++ b/bootstrap/generate_gitrev.sh @@ -22,7 +22,7 @@ REV2="dist" # Check that all commands required by this script are available # If not, we will not claim to know which git revision this is # (REVSTATE will be OFF) - if which git && which tail && which wc ; then + if command -v git && command -v tail && command -v wc ; then REVTMP="$(git rev-parse --short HEAD 2>/dev/null)" if test "x$REVTMP" != "x" ; then # This is git repository. Check for local modifications diff --git a/fc_version b/fc_version index 6b7d437f1a..3a7467d343 100755 --- a/fc_version +++ b/fc_version @@ -65,7 +65,7 @@ if test "x$FREECIV_LABEL_FORCE" != "x" ; then VERSION_LABEL=$(echo $FREECIV_LABEL_FORCE | sed "s//$VERSION_LABEL/g") fi -if test x$VERSION_REVTYPE = xgit && which git > /dev/null ; then +if test x$VERSION_REVTYPE = xgit && command -v git > /dev/null ; then VERSION_REV="$(git rev-parse --short HEAD)" else VERSION_REV="" diff --git a/scripts/mapimg2anim b/scripts/mapimg2anim index 8b7c6c00eb..9b86244a85 100755 --- a/scripts/mapimg2anim +++ b/scripts/mapimg2anim @@ -1,5 +1,5 @@ #!/bin/bash -#/********************************************************************** +#/*********************************************************************** # Freeciv - Copyright (C) 2010 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ basename=`basename ${scriptname}` # check for required tools (convert) have_convert=TRUE -prog_convert=`which convert` +prog_convert=`command -v convert` RES=$? if [ $RES -ne 0 ]; then # without this tool nothing can be done @@ -41,7 +41,7 @@ fi # check for required tools (ffmpeg) have_ffmpef=TRUE -prog_ffmpeg=`which ffmpeg` +prog_ffmpeg=`command -v ffmpeg` RES=$? if [ $RES -ne 0 ]; then have_ffmpef=FALSE diff --git a/scripts/setup_auth_server.sh b/scripts/setup_auth_server.sh index de9ef412ae..edf2986af1 100755 --- a/scripts/setup_auth_server.sh +++ b/scripts/setup_auth_server.sh @@ -18,7 +18,7 @@ # I know that this will not work with bare sh. Tested with bash, # so I set it in use above. -if which basename >/dev/null +if command -v basename >/dev/null then PROGRAM_NAME="$(basename $0)" else @@ -190,7 +190,7 @@ fi echo echo "First we populate the player database on the MySQL server" -if ! which mysql >/dev/null +if ! command -v mysql >/dev/null then echo "mysql command not found. Aborting!" exit 1 -- 2.33.0