From fad588b898d364635a0e5ee2a1d76fb2531e459d Mon Sep 17 00:00:00 2001 From: Francois B Date: Mon, 1 Jan 2018 16:58:02 +0100 Subject: [PATCH] update after repo added improved --- core_functions.sh | 7 ++++++- vars.sh | 7 ++++++- yggdrasil.sh | 8 +++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/core_functions.sh b/core_functions.sh index 9d41b15..da41d9f 100644 --- a/core_functions.sh +++ b/core_functions.sh @@ -133,6 +133,8 @@ function updateSystem () { ret_code=$? retCode $ret_code printf "\n" + + repoAdded=0 } # @@ -508,6 +510,7 @@ function addSpecificRepoFct () { printf "[ADD_REPO_FCT] for package : $1, " printf "add repo by function : ${appRepo[1]} \n" eval "${appRepo[1]}" + repoAdded=$(($repoAdded+1)) fi done if [ "$2" == "yes" ]; then @@ -546,7 +549,9 @@ function installAppsFromList () { done unset i unset app - updateSystem + if [ "$repoAdded" -gt "0" ]; then + updateSystem + fi for i in $Apps; do app=(${i//;/ }) if [ "${app[2]}" == "$1" ]; then diff --git a/vars.sh b/vars.sh index 13e4a3c..ff03cc2 100644 --- a/vars.sh +++ b/vars.sh @@ -36,6 +36,11 @@ logFile="/home/"$myHomedir"/yggdrasil.log" cTime=$(date +%H:%M) cDate=$(date +%d-%m-%Y) +# +# repo/ppa added counter +# +repoAdded=0 + # # shell color codes # @@ -56,4 +61,4 @@ BOLDJAUNE=${BOLD}${JAUNE} BOLDBLEU=${BOLD}${BLEU} BOLDMAUVE=${BOLD}${MAUVE} BOLDCYAN=${BOLD}${CYAN} -BOLDBLANC=${BOLD}${BLANC} \ No newline at end of file +BOLDBLANC=${BOLD}${BLANC} diff --git a/yggdrasil.sh b/yggdrasil.sh index ff2cc2b..c57dddc 100755 --- a/yggdrasil.sh +++ b/yggdrasil.sh @@ -38,8 +38,14 @@ echo "--[ Yggdrasil log ]--[ "$cDate" ]--[ "$cTime" ]-----------------------" >> # # arguments/options management with getopts # -while getopts ":h,v,a,c" option; do +while getopts ":h,v,a,c,t" option; do case "$option" in + t) #test purpose only + installNightly + installBeta + installBase + exit + ;; a) # install all apps #TODO: msg "Installing all Apps"