Browse code

Fix some obvious bugs and some other improvements.

Nat! authored on 20-02-2017 16:01:36
Showing 4 changed files
... ...
@@ -158,7 +158,7 @@ ensure_consistency()
158 158
    if [ -f "${REPOS_DIR}/.bootstrap_fetch_started" ]
159 159
    then
160 160
       log_error "A previous fetch or update was incomplete.
161
-Suggested resolution (in $owd):
161
+Suggested resolution (in $PWD):
162 162
     ${C_RESET_BOLD}mulle-bootstrap clean dist${C_ERROR}
163 163
     ${C_RESET_BOLD}mulle-bootstrap${C_ERROR}
164 164
 
... ...
@@ -642,7 +642,8 @@ bootstrap_main()
642 642
          *)
643 643
             case "${command}" in
644 644
                bootstrap|nomagic|build|dist|clean|dist-clean|fetch|install|syteminstall|upgrade|update|setup-xcode|xcode|tag)
645
-               fail "There is no ${BOOTSTRAP_DIR} folder here, can't continue"
645
+                  fail "There is no ${BOOTSTRAP_DIR} or ${BOOTSTRAP_DIR}.local folder here, can't continue"
646
+               ;;
646 647
             esac
647 648
          ;;
648 649
       esac
... ...
@@ -884,7 +885,7 @@ brew_main()
884 885
    command="${1:-install}"
885 886
    [ $# -eq 0 ] || shift
886 887
 
887
-   if [ ! -d "${BOOTSTRAP_DIR}" ]
888
+   if [ ! -d "${BOOTSTRAP_DIR}" -a ! -d "${BOOTSTRAP_DIR}.local" ]
888 889
    then
889 890
       case "$1" in
890 891
          -h|--help)
... ...
@@ -892,8 +893,9 @@ brew_main()
892 893
 
893 894
          *)
894 895
             case "${command}" in
895
-            dist|clean|dist-clean|install|upgrade|update|setup-xcode|xcode)
896
-               fail "There is no ${BOOTSTRAP_DIR} folder here, can't continue"
896
+               dist|clean|dist-clean|install|upgrade|update|setup-xcode|xcode)
897
+                  fail "There is no ${BOOTSTRAP_DIR} or ${BOOTSTRAP_DIR}.local folder here, can't continue"
898
+               ;;
897 899
             esac
898 900
          ;;
899 901
       esac
... ...
@@ -351,11 +351,8 @@ assoc_array_set()
351 351
 #
352 352
 assoc_array_merge_with_array()
353 353
 {
354
-   local array1
355
-   local array2
356
-
357
-   array="$1"
358
-   array="$2"
354
+   local array1="$1"
355
+   local array2="$2"
359 356
 
360 357
    echo "${array2}" "${array1}" | sort -u -t'=' -k1,1
361 358
 }
... ...
@@ -368,11 +365,8 @@ assoc_array_merge_with_array()
368 365
 #
369 366
 assoc_array_augment_with_array()
370 367
 {
371
-   local array1
372
-   local array2
373
-
374
-   array="$1"
375
-   array="$2"
368
+   local array1="$1"
369
+   local array2="$2"
376 370
 
377 371
    echo "${array1}" "${array2}" | sort -u -t'=' -k1,1
378 372
 }
... ...
@@ -66,7 +66,7 @@ fetch_brew_if_needed()
66 66
 
67 67
    if [ -d "${ADDICTIONS_DIR}" ]
68 68
    then
69
-      fail "There is already a \"${ADDICTIONS_DIR}\" directory, move it away"
69
+      fail "There is already an \"${ADDICTIONS_DIR}\" folder here, move it away"
70 70
    fi
71 71
 
72 72
    case "${UNAME}" in
... ...
@@ -35,13 +35,10 @@ MULLE_BOOTSTRAP_DEPENDENCY_RESOLVE_SH="included"
35 35
 
36 36
 _dependency_add()
37 37
 {
38
-   local map
39
-   local name
40
-   local sub_name
38
+   local map="$1"
39
+   local name="$2"
40
+   local sub_name="$3"
41 41
 
42
-   map="$1"
43
-   name="$2"
44
-   sub_name="$3"
45 42
 
46 43
    local escaped_dependencies
47 44
    local dependencies
... ...
@@ -69,29 +66,23 @@ dependency_add()
69 66
 {
70 67
    if [ "${MULLE_TRACE_RESOLVER_FLIP_X}" = "YES" ]
71 68
    then
72
-   #     set +x
73
-   :
69
+      set +x
74 70
    fi
75 71
 
76 72
    _dependency_add "$@"
77 73
 
78 74
    if [ "${MULLE_TRACE_RESOLVER_FLIP_X}" = "YES" ]
79 75
    then
80
-   #   set -x
81
-   :
76
+      set -x
82 77
    fi
83 78
 }
84 79
 
85 80
 
86 81
 _dependency_add_array()
87 82
 {
88
-   local map
89
-   local name
90
-   local array
91
-
92
-   map="$1"
93
-   name="$2"
94
-   array="$3"
83
+   local map="$1"
84
+   local name="$2"
85
+   local array="$3"
95 86
 
96 87
    local sub_name
97 88
 
... ...
@@ -128,11 +119,8 @@ dependency_add_array()
128 119
 
129 120
 _dependency_resolve()
130 121
 {
131
-   local map
132
-   local name
133
-
134
-   map="$1"
135
-   name="$2"
122
+   local map="$1"
123
+   local name="$2"
136 124
 
137 125
    if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" -o "$MULLE_FLAG_MERGE_LOG" = "YES"  ]
138 126
    then
... ...
@@ -182,11 +170,8 @@ _dependency_resolve()
182 170
 
183 171
 dependency_resolve()
184 172
 {
185
-   local map
186
-   local name
187
-
188
-   map="$1"
189
-   name="$2"
173
+   local map="$1"
174
+   local name="$2"
190 175
 
191 176
    RESOLVED_DEPENDENCIES=
192 177
    UNRESOLVED_DEPENDENCIES=