diff --git a/build-aux/build-ports.sh b/build-aux/build-ports.sh index 3debb026..874b08a7 100755 --- a/build-aux/build-ports.sh +++ b/build-aux/build-ports.sh @@ -1,4 +1,4 @@ -set -e +#!/bin/sh -e make_dir_path_absolute() { (cd "$1" && pwd) @@ -9,9 +9,7 @@ has_command() { } # Detect if the environment isn't set up properly. -if [ -z "$PACKAGES" -a "${PACKAGES+x}" = 'x' ]; then - exit 0 -elif [ -z "$HOST" ]; then +if [ -z "$HOST" ]; then echo "$0: error: You need to set \$HOST" >&2 exit 1 elif [ -z "$SYSROOT" ]; then @@ -54,6 +52,16 @@ CXXFLAGS="$CXXFLAGS -Werror=format -Wno-error=format-contains-nul" export CFLAGS export CXXFLAGS +# Create the system root if absent. +mkdir -p "$SYSROOT" + +# Create the binary package repository. +mkdir -p "$SORTIX_REPOSITORY_DIR" + +# Initialize Tix package management in the system root if absent. +[ -e "$SYSROOT/tix/collection.conf" ] || +tix-collection "$SYSROOT" create --platform=$HOST --prefix= --disable-multiarch --generation=2 + # Detect all packages. get_all_packages() { for PACKAGE in $(ls "$SORTIX_PORTS_DIR"); do @@ -124,16 +132,6 @@ BUILD_LIST=$(unset MAKE; rm -f "$DEPENDENCY_MAKEFILE" PACKAGES="$BUILD_LIST" -# Create the system root if absent. -mkdir -p "$SYSROOT" - -# Create the binary package repository. -mkdir -p "$SORTIX_REPOSITORY_DIR" - -# Initialize Tix package management in the system root if absent. -[ -e "$SYSROOT/tix/collection.conf" ] || -tix-collection "$SYSROOT" create --platform=$HOST --prefix= --disable-multiarch --generation=2 - # Build all the packages (if needed) and otherwise install them. for PACKAGE in $PACKAGES; do [ -f "$SORTIX_REPOSITORY_DIR/$PACKAGE.tix.tar.xz" ] ||