From 96c5f0bc1102d094cf222dcef5c4e744d298ebbe Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 13 May 2020 03:18:28 +0300 Subject: simplify repository checking --- mkrootfs.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mkrootfs.sh b/mkrootfs.sh index 6767911..18a8981 100755 --- a/mkrootfs.sh +++ b/mkrootfs.sh @@ -63,15 +63,16 @@ msg "Setting KISS_ROOT to $MNTDIR" export KISS_ROOT="$MNTDIR" # Check whether REPO and REPO_PATH variables exist -[ "$REPO" ] && { - # Remove if /tmp/repo already exists - rm -rf /tmp/repo - git clone --depth 1 "$REPO" /tmp/repo - msg "Cloning repository to /var/db/kiss/repo" - rm -rf "$MNTDIR/var/db/kiss/repo" - git clone --depth 1 "$REPO" "$MNTDIR/var/db/kiss/repo" - export KISS_PATH="${HOST_REPO_PATH:-/tmp/repo/core}" -} || die "REPO variable is not set" +[ "$REPO" ] || die "REPO variable is not set" + +# Remove if /tmp/repo already exists +rm -rf /tmp/repo +git clone --depth 1 "$REPO" /tmp/repo +msg "Cloning repository to /var/db/kiss/repo" +rm -rf "$MNTDIR/var/db/kiss/repo" +git clone --depth 1 "$REPO" "$MNTDIR/var/db/kiss/repo" +export KISS_PATH="${HOST_REPO_PATH:-/tmp/repo/core}" + msg "Starting build from the PKGS variable" -- cgit v1.2.3