Couple of small bugfixes.

This commit is contained in:
Darren 'Tadgy' Austin 2022-10-06 17:16:30 +01:00
commit cfcb903fa0

View file

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: 0.6.6 # Version: 0.6.7
# Copyright (c) 2005-2022: # Copyright (c) 2005-2022:
# Darren 'Tadgy' Austin <darren (at) afterdark.org.uk> # Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>
# Licensed under the terms of the GNU General Public License version 3. # Licensed under the terms of the GNU General Public License version 3.
@ -152,7 +152,7 @@ eval "$(declare -p PKG_STORE PKG_CONFIG_ARCHIVE | sed -re 's/\\\$/$/g')"
# Sanity. # Sanity.
SRC_DIR="$(pwd)" SRC_DIR="$(pwd)"
umask 0022 umask 0022
[[ ! -e "$BUILD_WORKDIR" ]] || mkdir -p -m 750 "$BUILD_WORKDIR" || die "Failed to create working directory" [[ ! -e "$BUILD_WORKDIR" ]] { || mkdir -p -m 750 "$BUILD_WORKDIR" || die "Failed to create working directory"; }
rm -rf "$BUILD_ROOT" && mkdir -m 755 "$BUILD_ROOT" || die "Failed to clear build root" rm -rf "$BUILD_ROOT" && mkdir -m 755 "$BUILD_ROOT" || die "Failed to clear build root"
[[ -n "${SRC_DIRNAMES[*]}" ]] && { rm -rf "${SRC_DIRNAMES[@]/#/$BUILD_WORKDIR/}" || die "Failed to clear source directories"; } [[ -n "${SRC_DIRNAMES[*]}" ]] && { rm -rf "${SRC_DIRNAMES[@]/#/$BUILD_WORKDIR/}" || die "Failed to clear source directories"; }
@ -172,23 +172,25 @@ rm -rf "$BUILD_ROOT" && mkdir -m 755 "$BUILD_ROOT" || die "Failed to clear build
} }
# Unpack sources. # Unpack sources.
while read -r SRC; do [[ -n "${SRC_FILENAMES[*]}" ]] && {
case "$SRC" in while read -r SRC; do
*.tar.?z|*.t?z) case "$SRC" in
tar -xv -C "$BUILD_WORKDIR" -f "$SRC" || die "Failed to extract source: $SRC" *.tar.?z|*.t?z)
;; tar -xv -C "$BUILD_WORKDIR" -f "$SRC" || die "Failed to extract source: $SRC"
*.zip|*.ZIP) ;;
unzip -d "$BUILD_WORKDIR" "$SRC" || die "Failed to extract source: $SRC" *.zip|*.ZIP)
;; unzip -d "$BUILD_WORKDIR" "$SRC" || die "Failed to extract source: $SRC"
*) ;;
die "Un-handled source archive format: ${SRC##*.}" *)
;; die "Un-handled source archive format: ${SRC##*.}"
esac ;;
done < <(printf "%s\\n" "${SRC_FILENAMES[@]}") esac
done < <(printf "%s\\n" "${SRC_FILENAMES[@]}")
}
# Fix any weird permissions on sources. # Fix any weird permissions on sources.
chown -R root:root "${SRC_DIRNAMES[@]/#/$BUILD_WORKDIR/}" && chmod -R go-w "${SRC_DIRNAMES[@]/#/$BUILD_WORKDIR/}" || \ [[ -n "${SRC_DIRNAMES[*]}" ]] && { chown -R root:root "${SRC_DIRNAMES[@]/#/$BUILD_WORKDIR/}" && chmod -R go-w "${SRC_DIRNAMES[@]/#/$BUILD_WORKDIR/}" || \
die "Failed to correct source directory permissions" die "Failed to correct source directory permissions"; }
# Standard ./configure options. # Standard ./configure options.
CONFIGURE_OPTS=("${BUILD_ALTCC:+CC=\"$BUILD_ALTCC\"}" "${BUILD_ALTCXX:+CXX=\"$BUILD_ALTCXX\"}" "--prefix=\"$BUILD_PREFIX\"" CONFIGURE_OPTS=("${BUILD_ALTCC:+CC=\"$BUILD_ALTCC\"}" "${BUILD_ALTCXX:+CXX=\"$BUILD_ALTCXX\"}" "--prefix=\"$BUILD_PREFIX\""