diff --git a/packaging/freebsd/package.sh b/packaging/freebsd/package.sh index 0533be9010..b81d33e565 100755 --- a/packaging/freebsd/package.sh +++ b/packaging/freebsd/package.sh @@ -43,7 +43,7 @@ esac # Only binaries for this machine run here (the --version check at the end); a FreeBSD target built # on another OS never does. HOST_ARCH="$(release_arch "$(uname -m)" 2>/dev/null)" || HOST_ARCH="$(uname -m)" -if [ -n "${CARGO_BUILD_TARGET:-}" ] && [ "$(uname -s)" != FreeBSD ]; then +if [[ -n "${CARGO_BUILD_TARGET:-}" ]] && [[ "$(uname -s)" != FreeBSD ]]; then HOST_ARCH="$(uname -s) $HOST_ARCH" fi BASENAME="pdfcraft-$VERSION-freebsd-$ARCH" @@ -74,12 +74,12 @@ copy_docs "$STAGE/share/doc/pdfcraft" # which has to run here: build it for this machine, not for CARGO_BUILD_TARGET. (unset CARGO_BUILD_TARGET; stage_models "$STAGE/share/pdfcraft/models") -if [ -z "${CARGO_BUILD_TARGET:-}" ] && [ "$ARCH" = "$HOST_ARCH" ]; then +if [[ -z "${CARGO_BUILD_TARGET:-}" ]] && [[ "$ARCH" = "$HOST_ARCH" ]]; then "$STAGE/bin/pdfcraft" --version else # They cannot run here, so check what they are instead: executables, not libraries or objects. # An older file(1) calls a PIE a shared object; its interpreter still marks it as a program. - want="$ARCH"; [ "$ARCH" != x86_64 ] || want=x86-64 + want="$ARCH"; [[ "$ARCH" != x86_64 ]] || want=x86-64 for b in "$STAGE"/bin/*; do case "$(file -b "$b")" in ELF*" executable, "*"$want"*FreeBSD* | ELF*"$want"*FreeBSD*interpreter*) ;;