From 69284c66e818bfcce1d2ac09980680a83f192487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 1 Mar 2018 12:38:55 +0100 Subject: Fix how updater configuration is generated The branch override was added. --- build_medkit.sh | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/build_medkit.sh b/build_medkit.sh index 96f91fa..9b42cb2 100755 --- a/build_medkit.sh +++ b/build_medkit.sh @@ -65,10 +65,8 @@ while [ $# -gt 0 ]; do if [ -z "$MODEL" ]; then MODEL="$1" elif [ -z "$BRANCH" ]; then - if [ "$1" == "deploy" ]; then - BRANCH= - else - BRANCH="-$1" + if [ "$1" != "deploy" ]; then + BRANCH="$1" TEST_BRANCH=true case "$1" in rc) @@ -90,6 +88,9 @@ done exit 1 } +# Branch name with dash (yes for real) +DBRANCH="-$BRANCH" + ## Build needed tools ## # Git puller helper function (git_pull output_path source_url) @@ -144,11 +145,11 @@ export L10N export LISTS export OVERLAY export TEST_BRANCH -export ROOT="$(readlink -f "root-$MODEL$BRANCH")" +export ROOT="$(readlink -f "root-$MODEL$DBRANCH")" ## Dump updater-ng entry script ## -export UPDATER_CONFIG=".updater-$MODEL$BRANCH.lua" +export UPDATER_CONFIG=".updater-$MODEL$DBRANCH.lua" cat > "$UPDATER_CONFIG" <> "$ROOT/etc/config/updater" -echo "config pkglists 'pkglists'" >> "$ROOT/etc/config/updater" +UPDCNF="$ROOT/etc/config/updater" +echo > "\$UPDCNF" +[ -z "$BRANCH" ] || cat >> "\$UPDCNF" <> "\$UPDCNF" while IFS=',' read LIST; do - echo " list lists '\$LIST'" >> "$ROOT/etc/config/updater" + echo " list lists '\$LIST'" >> "\$UPDCNF" done <<< "\$LISTS" -echo >> "$ROOT/etc/config/updater" -echo "config l10n 'l10n'" >> "$ROOT/etc/config/updater" +echo >> "\$UPDCNF" +echo "config l10n 'l10n'" >> "\$UPDCNF" while IFS=',' read LANG; do - echo " list langs '\$LANG'" >> "$ROOT/etc/config/updater" + echo " list langs '\$LANG'" >> "\$UPDCNF" done <<< "\$L10N" +echo >> "\$UPDCNF" ## Overlay user's files if [ -n "$OVERLAY" ]; then @@ -259,7 +266,7 @@ rm -f usr/share/updater/flags rm -rf usr/share/updater/unpacked rm -rf var/opkg-collided # Create archive -tar -czf "../medkit-$MODEL$BRANCH.tar.gz" . +tar -czf "../medkit-$MODEL$DBRANCH.tar.gz" . ) EOF -- cgit v1.2.3