From bf11180c10033d73a0f658a465b8191a734d5ebd Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@robotics.uk.to>
Date: Thu, 3 Nov 2016 11:49:59 +0000
Subject: [PATCH] Tidying

---
 src/freedombone-mirrors | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/freedombone-mirrors b/src/freedombone-mirrors
index f6e603473..cdb9a3320 100755
--- a/src/freedombone-mirrors
+++ b/src/freedombone-mirrors
@@ -121,23 +121,27 @@ function enable_mirrors_via_onion {
     fi
 }
 
+function update_installed_single_repo {
+    # only deal with a single app
+    filename=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${SYNC_SINGLE_APP}
+    if [ ! -f $filename ]; then
+        echo $"The app $SYNC_SINGLE_APP was not found"
+        exit 36822
+    fi
+    APP_REPOS=($(cat ${MAIN_COMMAND} $filename | grep "_REPO=\"" | grep -v "(cat " | uniq -u | sed 's|${PROJECT_NAME}|'"${PROJECT_NAME}"'|g'))
+    for line in "${APP_REPOS[@]}"
+    do
+        INSTALLED_APPS_REPOS+=("${line}")
+    done
+}
+
 function update_installed_apps_repos {
     INSTALLED_APPS_REPOS=()
 
     function_check app_is_installed
 
-    # only deal with a single app
     if [ $SYNC_SINGLE_APP ]; then
-        filename=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-${SYNC_SINGLE_APP}
-        if [ ! -f $filename ]; then
-            echo $"The app $SYNC_SINGLE_APP was not found"
-            exit 36822
-        fi
-        APP_REPOS=($(cat ${MAIN_COMMAND} $filename | grep "_REPO=\"" | grep -v "(cat " | uniq -u | sed 's|${PROJECT_NAME}|'"${PROJECT_NAME}"'|g'))
-        for line in "${APP_REPOS[@]}"
-        do
-            INSTALLED_APPS_REPOS+=("${line}")
-        done
+        update_installed_single_repo
         return
     fi
 
-- 
GitLab