From 00a97602a4aa78803ad8567d2510d26bf1f6ee83 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Oct 2013 21:12:36 +0200 Subject: [PATCH] gluon-core: upgrade: fix directory movement --- .../files/etc/uci-defaults/zzz-gluon-upgrade | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/package/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade b/package/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade index fe1897d8..751f4d71 100755 --- a/package/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade +++ b/package/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade @@ -35,27 +35,29 @@ do_component() { local version="$(version_of "$component")" if [ -z "$version" ]; then continue; fi - cd "$component" + ( + cd "$component" - local oldversion="$(oldversion_of "$component")" - if [ -z "$oldversion" ]; then - do_dir initial - else - local v + local oldversion="$(oldversion_of "$component")" + if [ -z "$oldversion" ]; then + do_dir initial + else + local v - for v in *; do - if [ "$v" = initial -o "$v" = invariant -o "$v" = version ]; then continue; fi + for v in *; do + if [ "$v" = initial -o "$v" = invariant -o "$v" = version ]; then continue; fi - # The return value of opkg compare-versions is negated - if ! opkg compare-versions "$v" '>>' "$oldversion"; then - do_dir "$v" - fi - done - fi + # The return value of opkg compare-versions is negated + if ! opkg compare-versions "$v" '>>' "$oldversion"; then + do_dir "$v" + fi + done + fi - do_dir invariant + do_dir invariant - echo "$version" > "$VERSION_DIR"/"$component" + echo "$version" > "$VERSION_DIR"/"$component" + ) } @@ -66,16 +68,14 @@ if [ -z "$oldversion" ]; then oldversion="$(cat "$VERSION_FILE_FREIFUNK" 2>/dev/ if [ -z "$oldversion" ]; then oldversion="$(cat "$VERSION_FILE_LFF" 2>/dev/null)"; fi if [ -z "$oldversion" ]; then oldversion="$(cat "$VERSION_FILE_KFF" 2>/dev/null)"; fi -( - cd "$UPGRADE_DIR" +cd "$UPGRADE_DIR" - do_component core +do_component core - for component in *; do ( - if [ "$component" != 'core' ]; then - do_component "$component" - fi - ) done -) +for component in *; do + if [ "$component" != 'core' ]; then + do_component "$component" + fi +done rm -f "$VERSION_FILE_FREIFUNK" "$VERSION_FILE_LFF" "$VERSION_FILE_KFF"