From e1a2ebab5c4d6727cae37fb829c671c1cd0e7f56 Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Thu, 5 Dec 2013 08:45:12 +0100 Subject: [PATCH] gencode-remote gibt nur noch befehle aus wenn was zu tun ist ... --- cdist/conf/type/__zypper_repo/gencode-remote | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cdist/conf/type/__zypper_repo/gencode-remote b/cdist/conf/type/__zypper_repo/gencode-remote index efe0a8f5..c93ca229 100644 --- a/cdist/conf/type/__zypper_repo/gencode-remote +++ b/cdist/conf/type/__zypper_repo/gencode-remote @@ -51,8 +51,6 @@ else state="present" fi -all_repo_ids="$(cat "$__object/explorer/all_repo_ids")" -enabled_repo_ids="$(cat "$__object/explorer/enabled_repo_ids")" repo_id="$(cat "$__object/explorer/repo_id")" act_id="" @@ -62,6 +60,13 @@ elif grep -q "$repo_id" "$__object/explorer/all_repo_ids"; then act_id="$repo_id" fi +if grep -q "$act_id" "$__object/explorer/enabled_repo_ids"; then + state="enabled" +else + state="disabled" +fi + + case "$state" in present) if [ -z "$desc" ] || [ -z "$uri" ]; then @@ -78,12 +83,12 @@ case "$state" in fi ;; enabled) - if [ ! -z "$act_id" ]; then + if [ ! -z "$act_id" ] && [ "$state" = "disabled" ]; then echo zypper $zypper_def_opts modifyrepo -e "$act_id" fi ;; disabled) - if [ ! -z "$act_id" ]; then + if [ ! -z "$act_id" ] && [ "$state" = "disabled" ]; then echo zypper $zypper_def_opts modifyrepo -d "$act_id" fi ;;