X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-make.git;a=blobdiff_plain;f=scripts%2Faxify;h=99bfaddd3c65028ca9fa032f8d000a8e9a40a427;hp=7c0390c9dbe80a5a0621346d726e9dd38d0be14d;hb=refs%2Fheads%2Fmaster;hpb=0f6e86b7054265f71501c730f9e162bd7c2dc370 diff --git a/scripts/axify b/scripts/axify index 7c0390c..99bfadd 100755 --- a/scripts/axify +++ b/scripts/axify @@ -1,7 +1,8 @@ #!/bin/bash +# shellcheck disable=SC2250 # # ax-make: Alex' Simple Makefile System -# Copyright (c)2014-2022 Alexander Barton (alex@barton.de) +# Copyright (c)2014-2023 Alexander Barton (alex@barton.de) # # 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 @@ -34,7 +35,7 @@ Download() { echo "Downloading $URL to \"$FILE\" ..." if curl --version >/dev/null 2>&1; then - curl -#o "$FILE" "$URL" && return 0 + curl -#Lo "$FILE" "$URL" && return 0 echo "Failed to download $URL! [curl]" return 1 fi @@ -82,13 +83,13 @@ while true; do shift done -[ $# -gt 1 ] && Usage +[[ $# -gt 1 ]] && Usage -[ -n "$1" ] && LIB_D="$1" +[[ -n "$1" ]] && LIB_D="$1" -if [ -r "/usr/local/share/ax-make/Makefile.ax" ]; then +if [[ -r "/usr/local/share/ax-make/Makefile.ax" ]]; then MAKEFILE_AX="/usr/local/share/ax-make/Makefile.ax" -elif [ -r "/usr/share/ax-make/Makefile.ax" ]; then +elif [[ -r "/usr/share/ax-make/Makefile.ax" ]]; then MAKEFILE_AX="/usr/share/ax-make/Makefile.ax" else echo "$NAME: No source \"Makefile.ax\" found!" @@ -98,12 +99,12 @@ fi # -- Makefile.ax -- -if [ ! -d "$LIB_D" ]; then +if [[ ! -d "$LIB_D" ]]; then mkdir -pv "$LIB_D" || exit 1 fi target="$LIB_D/$(basename "$MAKEFILE_AX")" -if [ ! -e "$target" ] || [ "$MAKEFILE_AX" -nt "$target" ]; then +if [[ ! -e "$target" || "$MAKEFILE_AX" -nt "$target" ]]; then echo "Updating \"$target\" ..." cp -v "$MAKEFILE_AX" "$target" || exit 1 else @@ -112,53 +113,57 @@ fi # -- Project Makefile's --- -if [ ! -e "Makefile" ]; then +if [[ ! -e "Makefile" ]]; then echo "Creating \"Makefile\" ..." -[ "$LIB_D" != "." ] && subdirs="$LIB_D" || subdirs="" +[[ "$LIB_D" != "." ]] && subdirs="$LIB_D" || subdirs="" cat >"Makefile" <"$LIB_D/Makefile" </dev/null 2>&1; then echo "Creating \"AUTHORS$SUFFIX\" file ..." echo "$(git config user.name) <$(git config user.email)>" >>"AUTHORS$SUFFIX" fi fi -if [ ! -e COPYING ]; then +if [[ ! -e COPYING ]]; then LICENSE_URL="" case "$LICENSE" in "") ;; "gpl2") - LICENSE_URL="http://www.gnu.org/licenses/gpl-2.0.txt" + LICENSE_URL="https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt" ;; "gpl3") - LICENSE_URL="http://www.gnu.org/licenses/gpl-3.0.txt" + LICENSE_URL="https://www.gnu.org/licenses/gpl-3.0.txt" ;; "lgpl21") - LICENSE_URL="https://www.gnu.org/licenses/lgpl-2.1.txt" + LICENSE_URL="https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt" ;; "lgpl3") LICENSE_URL="https://www.gnu.org/licenses/lgpl-3.0.txt" @@ -167,9 +172,9 @@ if [ ! -e COPYING ]; then echo "Can't setup unknown \"$LICENSE\" license!" ;; esac - [ -n "$LICENSE_URL" ] && Download "$LICENSE_URL" COPYING + [[ -n "$LICENSE_URL" ]] && Download "$LICENSE_URL" COPYING else - [ -n "$LICENSE" ] && echo "COPYING file already exists, skipping." + [[ -n "$LICENSE" ]] && echo "COPYING file already exists, skipping." fi files=() @@ -180,7 +185,7 @@ if [[ -n "$ADD_FILES" ]]; then fi for f in "${files[@]}"; do - if [ ! -e "$f" ]; then + if [[ ! -e "$f" ]]; then echo "Creating empty \"$f\" file ..." touch "$f" fi