Skip to content

Commit

Permalink
Fix shellcheck issues in genversion.sh and gen-tarball.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Sep 3, 2024
1 parent 4e76711 commit 0d9cadb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions gen-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

set -e

TAG=$(printf "%s" "$(git describe "${1:-HEAD}")")
TAG="$(printf "%s" "$(git describe "${1:-HEAD}")")"
NAME="xrootd-${TAG#v}"

set -x

git archive -9 --prefix="${NAME}/" -o "${NAME}.tar.gz" ${TAG}
git archive -9 --prefix="${NAME}/" -o "${NAME}.tar.gz" "${TAG}"

16 changes: 8 additions & 8 deletions genversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function usage()
{
cat 1>&2 <<-EOF
Usage:
$(basename $0) [--help|--version]
$(basename "$0") [--help|--version]
--help prints this message
--print-only ignored, used for backward compatibility
Expand All @@ -21,15 +21,15 @@ function usage()
EOF
}

SRC=$(dirname $0)
VF=${SRC}/VERSION
SRC="$(dirname "$0")"
VF="${SRC}/VERSION"

if [[ -n "${XRDVERSION}" ]]; then
VERSION=${XRDVERSION};
VERSION="${XRDVERSION}";
elif [[ -r "${VF}" ]] && grep -vq "Format:" "${VF}"; then
VERSION=$(sed -e 's/-g/+git/' "${VF}")
elif git -C ${SRC} describe --match 'v*' >/dev/null 2>&1; then
VERSION=$(git -C ${SRC} describe --match 'v*' | sed -e 's/-g/+git/')
VERSION="$(sed -e 's/-g/+git/' "${VF}")"
elif git -C "${SRC}" describe --match 'v*' >/dev/null 2>&1; then
VERSION="$(git -C "${SRC}" describe --match 'v*' | sed -e 's/-g/+git/')"
else
VERSION="v5.7-rc$(date +%Y%m%d)"
fi
Expand Down Expand Up @@ -67,7 +67,7 @@ while [[ $# -gt 0 ]]; do
done

if [[ -v SANITIZE ]]; then
VERSION=$(sed -e 's/v//; s/-rc/~rc/; s/-g/+git/; s/-/.post/; s/-/./' <<< ${VERSION})
VERSION=$(sed -e 's/v//; s/-rc/~rc/; s/-g/+git/; s/-/.post/; s/-/./' <<< "${VERSION}")
fi

printf "%s" "${VERSION}"

0 comments on commit 0d9cadb

Please sign in to comment.