From a35257bfd28f7440a37c13f1f6dab9a650d3ea40 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Wed, 21 Sep 2022 10:38:47 +0200 Subject: [PATCH] Allow to re-apply mods to a pre-existing chroot --- path/wdvn-make | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/path/wdvn-make b/path/wdvn-make index f21b921..aab10ba 100755 --- a/path/wdvn-make +++ b/path/wdvn-make @@ -1,13 +1,27 @@ #!/bin/bash set -e -mkdir -p "$1" -wdvn-get "$1" +if [[ -d "$1.tmp" ]]; then + rm -r -f "$1.tmp" +fi + +if ! [[ -d "$1" ]]; then + mkdir -p "$1.tmp" + wdvn-get "$1.tmp" + mv "$1.tmp" "$1" +fi + +if [[ -f "$1/chroot" ]]; then + rm -f "$1/chroot" +fi + for WDVN_MODLIST in "${@:2}" do + echo "-- $WDVN_MODLIST --" while IFS="" read -r WDVN_LINE || [ -n "$WDVN_LINE" ] do - echo "> $WDVN_LINE ..." + echo "> $WDVN_LINE" source wdvn-mod "mods/$WDVN_LINE" "$1" done < "modlists/$WDVN_MODLIST" done +echo "-- CLEANUP --" wdvn-clean "$1" \ No newline at end of file