From: Greg T. <gd...@le...> - 2020-03-17 23:26:50
|
There are some minor unnecessary bashisms in a few /bin/sh scripts. Basically, [[ is not specified as part of POSIX sh, and while it in bash has slightly different semantics than [, I am pretty sure that's not relevant in these cases. This is really just s/[[/[/ and s/]]/]/. ---------------------------------------- $NetBSD: patch-scripts_snapstamp,v 1.1 2020/03/17 23:06:08 gdt Exp $ Remediate bashisms. --- scripts/snapstamp.orig 2019-05-25 19:15:55.000000000 +0000 +++ scripts/snapstamp @@ -17,4 +17,4 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -[[ -n $STP_BUILD_SNAPSHOT && -d .git ]] && printf '%s%(%Y-%m-%dT%H-%M)T-%s' - -1 $(git describe --dirty --always --first-parent --exclude '*') +[ -n $STP_BUILD_SNAPSHOT && -d .git ] && printf '%s%(%Y-%m-%dT%H-%M)T-%s' - -1 $(git describe --dirty --always --first-parent --exclude '*') ---------------------------------------- $NetBSD: patch-scripts_gversion.in,v 1.1 2020/03/17 23:06:08 gdt Exp $ Remediate bashisms. --- scripts/gversion.in.orig 2019-05-25 15:18:50.000000000 +0000 +++ scripts/gversion.in @@ -43,10 +43,10 @@ gutenprint_release=gutenprint-@GUTENPRIN if [ -z "$3" ] ; then if [ -d "$root/.git" ] ; then tag=$(git describe --tags --dirty --first-parent --candidates=1000 --match "${gutenprint_version//./_}*" 2>/dev/null) - [[ -z $tag ]] && tag=$(git describe --tags --dirty --first-parent --candidates=1000 --match "${gutenprint_base//./_}*" 2>/dev/null) - [[ -z $tag ]] && tag=$(git describe --tags --dirty --first-parent --candidates=1000 --match "${gutenprint_release//./_}*" 2>/dev/null) - [[ -z $tag ]] && tag=$(git describe --tags --dirty --first-parent --candidates=1000 --match "gutenprint*" 2>/dev/null) - [[ -z $tag ]] && tag=$(git describe --tags --dirty --always --first-parent 2>/dev/null) + [ -z $tag ] && tag=$(git describe --tags --dirty --first-parent --candidates=1000 --match "${gutenprint_base//./_}*" 2>/dev/null) + [ -z $tag ] && tag=$(git describe --tags --dirty --first-parent --candidates=1000 --match "${gutenprint_release//./_}*" 2>/dev/null) + [ -z $tag ] && tag=$(git describe --tags --dirty --first-parent --candidates=1000 --match "gutenprint*" 2>/dev/null) + [ -z $tag ] && tag=$(git describe --tags --dirty --always --first-parent 2>/dev/null) echo $tag | sed 's/^[^0-9]*-//' > "$root/git-version-stamp" fi |