diff options
Diffstat (limited to 'cmd/build-all.sh')
-rwxr-xr-x | cmd/build-all.sh | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/cmd/build-all.sh b/cmd/build-all.sh new file mode 100755 index 0000000..b626592 --- /dev/null +++ b/cmd/build-all.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +CMD_DIR="$(realpath $(dirname $0))" +PATH=$PATH:$CMD_DIR +PROJ_DIR="$(realpath $CMD_DIR/..)" + +while : +do + >"$TMP/before.txt" find "${PROJ_DIR}" -name '*.txz' + mkdir -p "${PROJ_DIR}/patches/packages/" + for pkg in $PROJ_DIR/patches/source/*; do + ( + cd "$pkg" + + export OUTPUT="${PROJ_DIR}/patches/packages/" + PKG_NAME=$(basename $(realpath .)) + + built=$(find "$OUTPUT" -name "$PKG_NAME-*.txz") + if [ -n "$built" ]; then + continue + fi + + sh *.SlackBuild + built="$(find "$TMP" -name "*.txz")" + if [ -z "$built" ]; then + continue + fi + mkdir -p "${OUTPUT}" + upgradepkg --install-new "$TMP"/*.txz + mv "$TMP"/*.txz "${OUTPUT}" + ) + done + + for pkg in $PROJ_DIR/source/**/*; do + ( + cd "$pkg" + + export OUTPUT="${PROJ_DIR}/slackware/$(pkg-set.sh)" + PKG_NAME=$(basename $(realpath .)) + + built=$(find "$OUTPUT" -name "$PKG_NAME-*.txz") + if [ -n "$built" ]; then + continue + fi + + sh *.SlackBuild + built="$(find "$TMP" -name "*.txz")" + if [ -z "$built" ]; then + continue + fi + mkdir -p "${OUTPUT}" + upgradepkg --install-new "$TMP"/*.txz + mv "$TMP"/*.txz "${OUTPUT}" + ) + done + >"$TMP/after.txt" find "${PROJ_DIR}" -name '*.txz' + + NEW_PACKAGES="$(diff $TMP/before.txt $TMP/after.txt | grep "^>" | sed "s#^> ##")" + if [ ! $NEW_PACKAGES ]; then + break + fi +done + |