Browse code

Fix fetching. Useful override_branch config added (and less useful -fb option) removed. Add -ld debug log output, which is sometimes more useful than full -vv.

Nat! authored on 16-02-2017 13:58:15
Showing 25 changed files
... ...
@@ -50,6 +50,7 @@ bootstrap_technical_option_usage()
50 50
    if [ ! -z "${MULLE_TRACE}" ]
51 51
    then
52 52
       cat <<EOF
53
+   -ld       : additional debug output
53 54
    -le       : external command execution log output
54 55
    -lm       : extended dependency analysis output
55 56
    -ls       : extended settings log output
... ...
@@ -176,6 +177,8 @@ define_expansion()
176 177
 
177 178
    keyvalue="$1"
178 179
 
180
+   is_bootstrap_project || fail "This is not a mulle-bootstrap project"
181
+
179 182
    if [ -z "${keyvalue}" ]
180 183
    then
181 184
       fail "Missing key, directly after -D"
... ...
@@ -209,7 +212,7 @@ _bootstrap_main()
209 212
 {
210 213
    local command
211 214
 
212
-   log_fluff "::: bootstrap begin :::"
215
+   log_debug "::: bootstrap begin :::"
213 216
 
214 217
    . mulle-bootstrap-fetch.sh
215 218
    . mulle-bootstrap-build.sh
... ...
@@ -238,7 +241,7 @@ _bootstrap_main()
238 241
       log_verbose "No build needed"
239 242
    fi
240 243
 
241
-   log_fluff "::: bootstrap end :::"
244
+   log_debug "::: bootstrap end :::"
242 245
 }
243 246
 
244 247
 
... ...
@@ -393,6 +396,10 @@ bootstrap_technical_flags()
393 396
          MULLE_FLAG_EXECUTOR_DRY_RUN="YES"
394 397
       ;;
395 398
 
399
+      -ld|--log-debug)
400
+         MULLE_FLAG_LOG_DEBUG="YES"
401
+      ;;
402
+
396 403
       -le|--log-execution)
397 404
          MULLE_FLAG_LOG_EXECUTOR="YES"
398 405
       ;;
... ...
@@ -67,12 +67,15 @@ _bootstrap_auto_copy()
67 67
       filepath="${tmpdir}/${name}"
68 68
       dstfilepath="${dst}/${name}"
69 69
 
70
+      # only inherit, don't override
71
+      if [ -e "${dstfilepath}" ]
72
+      then
73
+         continue
74
+      fi
75
+
70 76
       case "${name}" in
71 77
          config)
72
-            if [ "${is_local}" = "YES" ]
73
-            then
74
-               exekutor cp -Ran ${COPYMOVETARFLAGS} "${filepath}" "${dstfilepath}"
75
-            fi
78
+            # stays in local
76 79
          ;;
77 80
 
78 81
          *.build|settings|overrides)
... ...
@@ -82,13 +85,11 @@ _bootstrap_auto_copy()
82 85
             fi
83 86
          ;;
84 87
 
85
-         *)
86
-            # only inherit, don't override
87
-            if [ -e "${dstfilepath}" ]
88
-            then
89
-               continue
90
-            fi
88
+         repositories)
89
+            _bootstrap_merge_repository_files "${filepath}" "${dstfilepath}" "NO"
90
+         ;;
91 91
 
92
+         *)
92 93
             #
93 94
             # root settings get the benefit of expansion
94 95
             #
... ...
@@ -156,6 +157,8 @@ _bootstrap_auto_create()
156 157
 
157 158
 bootstrap_auto_create()
158 159
 {
160
+   log_debug "bootstrap_auto_create"
161
+
159 162
    _bootstrap_auto_create "${BOOTSTRAP_DIR}.auto" "${BOOTSTRAP_DIR}"
160 163
 }
161 164
 
... ...
@@ -181,40 +184,23 @@ _bootstrap_merge_expanded_settings_in_front()
181 184
 }
182 185
 
183 186
 
184
-# _make_master_clones()
185
-# {
186
-#    local clones="$1"
187
-
188
-#    local clone
189
-#    local name       # name of the clone
190
-#    local url        # url of clone
191
-#    local branch
192
-#    local scm
193
-#    local tag
194
-#    local stashdir   # dir of repository (usually inside stashes)
195
-
196
-#    IFS="
197
-# "
198
-#    for clone in ${clones}
199
-#    do
200
-#       IFS="${DEFAULT_IFS}"
201
-
202
-#       parse_clone "${clone}"
203
-
204
-#       echo "${url};${name};${branch};${scm};${tag}" | sed 's/;*$//'
205
-#    done
206
-
207
-#    IFS="${DEFAULT_IFS}"
208
-# }
187
+#
188
+# read repository file, properly do expansions
189
+# replace branch with override if needed
190
+#
191
+_bootstrap_read_repository_file()
192
+{
193
+   local srcfile="$1"
194
+   local delete_dstdir="$2"
209 195
 
196
+   local srcbootstrap
197
+   local clones
210 198
 
211
-_remove_dstdir_from_clones()
212
-{
213
-   local clones="$1"
199
+   srcbootstrap="`dirname -- "${srcfile}"`"
200
+   clones="`read_expanded_setting "$srcfile" "" "${srcbootstrap}"`"
214 201
 
215
-   local clone
216 202
    local url        # url of clone
217
-   local dstdir       # name of the clone
203
+   local dstdir
218 204
    local branch
219 205
    local scm
220 206
    local tag
... ...
@@ -227,12 +213,47 @@ _remove_dstdir_from_clones()
227 213
 
228 214
       parse_raw_clone "${clone}"
229 215
 
230
-      echo "${url};;${branch};${scm};${tag}" | sed 's/;*$//'
216
+      case "${url}" in
217
+         */\.\./*|\.\./*|*/\.\.|\.\.)
218
+            fail "Relative urls like \"${url}\" don't work (anymore).\nTry \"-y fetch --no-symlink-creation\" instead"
219
+         ;;
220
+      esac
221
+
222
+      branch="${OVERRIDE_BRANCH:-${branch}}"
223
+      branch="${branch:-master}"
224
+
225
+      if [ "${delete_dstdir}" = "YES" ]
226
+      then
227
+         dstdir=""
228
+      fi
229
+
230
+      echo "${url};${dstdir};${branch};${scm};${tag}"
231 231
    done
232 232
 
233 233
    IFS="${DEFAULT_IFS}"
234 234
 }
235 235
 
236
+
237
+_bootstrap_merge_repository_files()
238
+{
239
+   local srcfile="$1"
240
+   local dstfile="$2"
241
+   local delete_dstdir="${3:-NO}"
242
+
243
+   log_fluff "Copying expanded \"repositories\" from \"${srcfile}\""
244
+
245
+   local contents
246
+   local additions
247
+
248
+   contents="`cat "${dstfile}" 2> /dev/null || :`"
249
+   additions="`_bootstrap_read_repository_file "${srcfile}" "${delete_dstdir}"`" || fail "read"
250
+   additions="`echo "${additions}"| sed 's/;*$//'`"
251
+   additions="`merge_repository_contents "${contents}" "${additions}"`"
252
+
253
+   redirect_exekutor "${dstfile}" echo "${additions}"
254
+}
255
+
256
+
236 257
 #
237 258
 # prepend new contents to old contents
238 259
 # of a few select and known files, these are merged with whats there
... ...
@@ -241,6 +262,8 @@ _remove_dstdir_from_clones()
241 262
 #
242 263
 _bootstrap_auto_merge_root_settings()
243 264
 {
265
+   log_debug ":_bootstrap_auto_merge_root_settings:"
266
+
244 267
    dst="$1"
245 268
    directory="$2"
246 269
 
... ...
@@ -276,21 +299,7 @@ _bootstrap_auto_merge_root_settings()
276 299
       #
277 300
       if [ "${settingname}" = "repositories" ]
278 301
       then
279
-         local additions
280
-
281
-         additions="`_bootstrap_merge_expanded_settings_in_front "${srcfile}" ""`"
282
-         additions="`_remove_dstdir_from_clones "${additions}"`"
283
-
284
-         if [ -f "${dstfile}" ]
285
-         then
286
-            local contents
287
-
288
-            contents="`cat "${dstfile}"`"
289
-            additions="`merge_repository_contents "${contents}" "${additions}"`"
290
-         else
291
-            log_fluff "Copying expanded \"repositories\" from \"${srcfile}\""
292
-         fi
293
-         redirect_exekutor "${dstfile}" echo "${additions}"
302
+         _bootstrap_merge_repository_files "${srcfile}" "${dstfile}"
294 303
          continue
295 304
       fi
296 305
 
... ...
@@ -349,6 +358,8 @@ _bootstrap_auto_embedded_copy()
349 358
 
350 359
    local dst
351 360
 
361
+   log_debug ":_bootstrap_auto_embedded_copy:"
362
+
352 363
    dst="${BOOTSTRAP_DIR}.auto/.deep/${name}.d"
353 364
 
354 365
    rmdir_safer "${dst}"
... ...
@@ -370,12 +381,11 @@ bootstrap_auto_update()
370 381
    local name="$1"
371 382
    local stashdir="$2"
372 383
 
373
-   log_fluff ":bootstrap_auto_update: begin"
384
+   log_debug ":bootstrap_auto_update: begin"
374 385
 
375 386
    if [ -d "${stashdir}/${BOOTSTRAP_DIR}" ]
376 387
    then
377 388
       _bootstrap_auto_merge_root_settings "${BOOTSTRAP_DIR}.auto" "${stashdir}"
378
-      sort_repository_file "${stashdir}"
379 389
 
380 390
       local srcfile
381 391
 
... ...
@@ -392,7 +402,7 @@ bootstrap_auto_update()
392 402
       fi
393 403
    fi
394 404
 
395
-   log_fluff ":bootstrap_auto_update: end"
405
+   log_debug ":bootstrap_auto_update: end"
396 406
 }
397 407
 
398 408
 
... ...
@@ -500,6 +510,10 @@ bootstrap_auto_final()
500 510
 {
501 511
    exekutor [ -d "${BOOTSTRAP_DIR}.auto" ] || internal_fail "${BOOTSTRAP_DIR}.auto does not exist"
502 512
 
513
+   log_fluff "Analysing dependencies of repositories"
514
+
515
+   sort_repository_file
516
+
503 517
    log_fluff "Creating ${C_MAGENTA}${C_BOLD}build_order${C_VERBOSE} from repositories"
504 518
 
505 519
    if [ -f "${BOOTSTRAP_DIR}.auto/build_order" ]
... ...
@@ -553,7 +567,7 @@ auto_update_initialize()
553 567
 {
554 568
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
555 569
 
556
-   log_fluff ":auto_update_initialize:"
570
+   log_debug ":auto_update_initialize:"
557 571
 
558 572
    MERGABLE_SETTINGS='brews
559 573
 tarballs
... ...
@@ -156,8 +156,11 @@ find_brews()
156 156
    brews="`read_root_setting "brews" | sort | sort -u`"
157 157
    if [ ! -z "${brews}" ]
158 158
    then
159
-      log_info "Setting read from .bootstrap.auto folder. \
159
+      if [ "${MULLE_BOOTSTRAP_EXECUTABLE}" != "mulle-bootstrap" ]
160
+      then
161
+         log_info "Setting read from .bootstrap.auto folder. \
160 162
 You might want to use mulle-bootstrap instead of mulle-brew."
163
+      fi
161 164
       echo "${brews}"
162 165
       return
163 166
    fi
... ...
@@ -296,7 +299,6 @@ _brew_common_main()
296 299
    [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
297 300
    [ -z "${ADDICTIONS_DIR}" ] && internal_fail "missing ADDICTIONS_DIR"
298 301
 
299
-   BREW="${ADDICTIONS_DIR}/bin/brew"
300 302
 
301 303
    #
302 304
    # should we check for '/usr/local/include/<name>' and don't fetch if
... ...
@@ -323,37 +325,37 @@ _brew_common_main()
323 325
 
324 326
 brew_upgrade_main()
325 327
 {
326
-   log_fluff "::: brew upgrade begin :::"
328
+   log_debug "::: brew upgrade begin :::"
327 329
 
328 330
    USAGE="_brew_usage"
329 331
    COMMAND="upgrade"
330 332
    _brew_common_main "$@"
331 333
 
332
-   log_fluff "::: brew upgrade end :::"
334
+   log_debug "::: brew upgrade end :::"
333 335
 }
334 336
 
335 337
 
336 338
 brew_update_main()
337 339
 {
338
-   log_fluff "::: brew update begin :::"
340
+   log_debug "::: brew update begin :::"
339 341
 
340 342
    USAGE="_brew_usage"
341 343
    COMMAND="update"
342 344
    _brew_common_main "$@"
343 345
 
344
-   log_fluff "::: brew update end :::"
346
+   log_debug "::: brew update end :::"
345 347
 }
346 348
 
347 349
 
348 350
 brew_install_main()
349 351
 {
350
-   log_fluff "::: brew install begin :::"
352
+   log_debug "::: brew install begin :::"
351 353
 
352 354
    USAGE="_brew_usage"
353 355
    COMMAND="install"
354 356
    _brew_common_main "$@"
355 357
 
356
-   log_fluff "::: brew install end :::"
358
+   log_debug "::: brew install end :::"
357 359
 }
358 360
 
359 361
 
... ...
@@ -361,9 +363,13 @@ brew_initialize()
361 363
 {
362 364
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
363 365
 
364
-   log_fluff ":brew_initialize:"
366
+   log_debug ":brew_initialize:"
367
+
368
+   [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
369
+   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ]         && . mulle-bootstrap-functions.sh
370
+
371
+   BREW="${ADDICTIONS_DIR}/bin/brew"
365 372
 
366
-   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
367 373
    :
368 374
 }
369 375
 
... ...
@@ -2213,7 +2213,7 @@ build_main()
2213 2213
 {
2214 2214
    local  clean
2215 2215
 
2216
-   log_fluff "::: build begin :::"
2216
+   log_debug "::: build begin :::"
2217 2217
 
2218 2218
    [ -z "${DEFAULT_IFS}" ] && internal_fail "IFS fail"
2219 2219
    [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]        && . mulle-bootstrap-settings.sh
... ...
@@ -2367,7 +2367,7 @@ build_main()
2367 2367
    remove_file_if_present "${REPOS_DIR}/.bootstrap_build_started"
2368 2368
    create_file_if_missing "${REPOS_DIR}/.bootstrap_build_done"
2369 2369
 
2370
-   log_fluff "::: build end :::"
2370
+   log_debug "::: build end :::"
2371 2371
 }
2372 2372
 
2373 2373
 
... ...
@@ -223,19 +223,25 @@ _print_stashdir()
223 223
    # local tag="$6"       # tag to checkout of the clone
224 224
    local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
225 225
 
226
-   echo "${stashdir}"
226
+   local stashparentdir
227
+
228
+   stashparentdir="`dirname -- "${stashdir}"`"
229
+   if [ "${stashparentdir}" != "${STASHES_DEFAULT_DIR}" ]
230
+   then
231
+      echo "${stashdir}"
232
+   fi
227 233
 }
228 234
 
229 235
 
230 236
 print_stashdir_repositories()
231 237
 {
232
-   _operation_walk_repositories "_print_stashdir"
238
+   walk_repositories "repositories" "_print_stashdir"
233 239
 }
234 240
 
235 241
 
236 242
 print_stashdir_embedded_repositories()
237 243
 {
238
-   _operation_walk_embedded_repositories "_print_stashdir"
244
+   walk_repositories "embedded_repositories" "_print_stashdir"
239 245
 }
240 246
 
241 247
 
... ...
@@ -244,9 +250,10 @@ print_stashdir_embedded_repositories()
244 250
 #
245 251
 _dist_clean()
246 252
 {
253
+   # dependencies already done before
254
+
247 255
    DIST_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "dist_clean_folders" \
248 256
 "${REPOS_DIR}
249
-${DEPENDENCIES_DIR}
250 257
 ${ADDICTIONS_DIR}
251 258
 ${STASHES_DEFAULT_DIR}
252 259
 ${BOOTSTRAP_DIR}.auto"`"
... ...
@@ -362,7 +369,7 @@ clean_execute()
362 369
 #
363 370
 clean_main()
364 371
 {
365
-   log_fluff "::: clean :::"
372
+   log_debug "::: clean :::"
366 373
 
367 374
    [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
368 375
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
... ...
@@ -93,7 +93,7 @@ common_settings_initialize()
93 93
 {
94 94
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
95 95
 
96
-   log_fluff ":common_settings_initialize:"
96
+   log_debug ":common_settings_initialize:"
97 97
 
98 98
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
99 99
    [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
... ...
@@ -173,7 +173,7 @@ copy_initialize()
173 173
 {
174 174
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
175 175
 
176
-   log_fluff ":copy_initialize:"
176
+   log_debug ":copy_initialize:"
177 177
 
178 178
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
179 179
 }
... ...
@@ -60,7 +60,7 @@ EOF
60 60
 
61 61
 defer_main()
62 62
 {
63
-   log_fluff ":defer_main:"
63
+   log_debug ":defer_main:"
64 64
 
65 65
    while [ $# -ne 0 ]
66 66
    do
... ...
@@ -124,7 +124,7 @@ defer_main()
124 124
    make_minion_bootstrap_project "${minionpath}" "${masterpath}"
125 125
 
126 126
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
127
-   [ -z "${MULLE_BOOTSTRAP_CLEAN_SH}" ] && . mulle-bootstrap-clean.sh
127
+   [ -z "${MULLE_BOOTSTRAP_CLEAN_SH}" ]           && . mulle-bootstrap-clean.sh
128 128
 
129 129
    #
130 130
    # dist clean ourselves
... ...
@@ -138,7 +138,7 @@ defer_main()
138 138
 
139 139
 emancipate_main()
140 140
 {
141
-   log_fluff ":emancipate_main:"
141
+   log_debug ":emancipate_main:"
142 142
 
143 143
    while [ $# -ne 0 ]
144 144
    do
... ...
@@ -30,7 +30,7 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 #
32 32
 #
33
-MULLE_BOOTSTRAP_DEPENDENY_RESOLVE_SH="included"
33
+MULLE_BOOTSTRAP_DEPENDENCY_RESOLVE_SH="included"
34 34
 
35 35
 
36 36
 _dependency_add()
... ...
@@ -222,7 +222,7 @@ dependency_resolve_initialize()
222 222
 {
223 223
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
224 224
 
225
-   log_fluff ":dependency_resolve_initialize:"
225
+   log_debug ":dependency_resolve_initialize:"
226 226
 
227 227
    [ -z "${MULLE_BOOTSTRAP_ARRAY_SH}" ] && . mulle-bootstrap-array.sh
228 228
    :
... ...
@@ -59,17 +59,16 @@ usage:
59 59
    mulle-bootstrap ${COMMAND} [options] [repositories]
60 60
 
61 61
    Options
62
-      -c           :  use caches from CACHES_PATH to locate repositories
63
-      -cU          :  check /usr/local for duplicates
64
-      -e           :  fetch embedded repositories only
65
-      -es          :  allow embedded symlinks (very experimental)
66
-      -fb <branch> :  force to use branch for all repostories
67
-      -fs          :  follow symlinks when updating/upgrading (not recommended)
68
-      -l           :  allow creation of symlinks
69
-      -le          :  allow creation of embedded symlinks
70
-      -i           :  ignore wrongly checked out branches
71
-      -nc          :  don't use caches. Useful to counter flag -y
72
-      -ns          :  don't create symlinks. Useful to counter flag -y
62
+      -c    :  use caches from CACHES_PATH to locate repositories
63
+      -cU   :  check /usr/local for duplicates
64
+      -e    :  fetch embedded repositories only
65
+      -es   :  allow embedded symlinks (very experimental)
66
+      -fs   :  follow symlinks when updating/upgrading (not recommended)
67
+      -l    :  allow creation of symlinks
68
+      -le   :  allow creation of embedded symlinks
69
+      -i    :  ignore wrongly checked out branches
70
+      -nc   :  don't use caches. Useful to counter flag -y
71
+      -ns   :  don't create symlinks. Useful to counter flag -y
73 72
 
74 73
    install  :  clone or symlink non-exisiting repositories and other resources
75 74
    update   :  execute a "fetch" in already fetched repositories
... ...
@@ -104,24 +103,6 @@ assert_sane_parameters()
104 103
    :
105 104
 }
106 105
 
107
-
108
-write_protect_directory()
109
-{
110
-   if [ -d "$1" ]
111
-   then
112
-      #
113
-      # ensure basic structure is there to squelch linker warnings
114
-      #
115
-      exekutor mkdir "$1/Frameworks" 2> /dev/null
116
-      exekutor mkdir "$1/lib" 2> /dev/null
117
-      exekutor mkdir "$1/include" 2> /dev/null
118
-
119
-      log_info "Write-protecting ${C_RESET_BOLD}$1${C_INFO} to avoid spurious header edits"
120
-      exekutor chmod -R a-w "$1"
121
-   fi
122
-}
123
-
124
-
125 106
 #
126 107
 # future, download tarballs...
127 108
 # we check for existance during fetch, but install during build
... ...
@@ -785,15 +766,21 @@ _operation_walk_deep_embedded_repositories()
785 766
 
786 767
 did_fetch_repository()
787 768
 {
769
+#   local reposdir="$1"  # ususally .bootstrap.repos
788 770
    local name="$2"      # name of the clone
771
+#   local url="$3"       # URL of the clone
772
+#   local branch="$4"    # branch of the clone
773
+#   local scm="$5"       # scm to use for this clone
774
+#   local tag="$6"       # tag to checkout of the clone
775
+#   local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
789 776
 
790
-   fetch__run_build_settings_script "did-install" "${name}" "$@"
777
+   fetch__run_build_settings_script "post-fetch" "${name}" "$@"
791 778
 }
792 779
 
793 780
 
794 781
 did_fetch_repositories()
795 782
 {
796
-   walk_clones "did_fetch_repository" "${REPOS_DIR}" "$@"
783
+   walk_clones "$*" "did_fetch_repository" "${REPOS_DIR}"
797 784
 }
798 785
 
799 786
 
... ...
@@ -843,7 +830,7 @@ did_upgrade_repository()
843 830
 {
844 831
    local name="$2"      # name of the clone
845 832
 
846
-   fetch__run_build_settings_script "did-upgrade" "${name}" "$@"
833
+   fetch__run_build_settings_script "post-fetch" "${name}" "$@"
847 834
 }
848 835
 
849 836
 
... ...
@@ -894,6 +881,8 @@ required_action_for_clone()
894 881
       return
895 882
    fi
896 883
 
884
+   log_debug "Change: \"${clone}\" -> \"${newclone}\""
885
+
897 886
    local reposdir
898 887
    local name
899 888
    local url
... ...
@@ -1029,7 +1018,7 @@ work_clones()
1029 1018
       fi
1030 1019
 
1031 1020
       #
1032
-      # optimization, try to no redo fetches
1021
+      # optimization, try not to redo fetches
1033 1022
       #
1034 1023
       echo "${__IGNORE__}" | fgrep -s -q -x "${clone}" > /dev/null
1035 1024
       if [ $? -eq 0 ]
... ...
@@ -1037,9 +1026,19 @@ work_clones()
1037 1026
          continue
1038 1027
       fi
1039 1028
 
1029
+      #
1030
+      # unify clone, by stripping extraneous ;
1031
+      #
1032
+      clone="`echo "${clone}" | sed 's/;*$//'`"
1033
+
1034
+      log_debug "${C_INFO}Doing ${clone}..."
1035
+
1040 1036
       __REFRESHED__="`add_line "${__REFRESHED__}" "${clone}"`"
1041 1037
 
1042
-      parse_clone "${clone}" || exit 1
1038
+      local dstdir
1039
+
1040
+      parse_raw_clone "${clone}"
1041
+      process_clone "${clone}"
1043 1042
 
1044 1043
       actionitems="`required_action_for_clone "${clone}" \
1045 1044
                                               "${reposdir}" \
... ...
@@ -1050,7 +1049,7 @@ work_clones()
1050 1049
                                               "${tag}" \
1051 1050
                                               "${stashdir}"`" || exit 1
1052 1051
 
1053
-      log_fluff "Actions for \"${name}\": ${actionitems}"
1052
+      log_debug "${C_INFO}Actions for \"${name}\": ${actionitems:-none}"
1054 1053
 
1055 1054
       IFS="
1056 1055
 "
... ...
@@ -1146,7 +1145,13 @@ work_clones()
1146 1145
       #
1147 1146
       if [ "${remember}" = "YES" ]
1148 1147
       then
1149
-         remember_stash_of_repository "${clone}" \
1148
+         local actualclone
1149
+
1150
+         # branch could be overwritten
1151
+         actualclone="`echo "${url};${dstdir};${branch};${scm};${tag}" | sed 's/;*$//'`"
1152
+         log_debug "${C_INFO}Remembering ${actualclone}..."
1153
+
1154
+         remember_stash_of_repository "${actualclone}" \
1150 1155
                                       "${reposdir}" \
1151 1156
                                       "${name}"  \
1152 1157
                                       "${url}" \
... ...
@@ -1171,7 +1176,8 @@ work_clones()
1171 1176
 #
1172 1177
 fetch_once_embedded_repositories()
1173 1178
 {
1174
-   log_fluff "fetch_once_embedded_repositories"
1179
+   log_debug "fetch_once_embedded_repositories"
1180
+
1175 1181
    (
1176 1182
       STASHES_DEFAULT_DIR=""
1177 1183
       STASHES_ROOT_DIR=""
... ...
@@ -1180,7 +1186,7 @@ fetch_once_embedded_repositories()
1180 1186
       local clones
1181 1187
 
1182 1188
       clones="`read_root_setting "embedded_repositories"`" ;
1183
-      work_clones "${EMBEDDED_REPOS_DIR}" "${clones}" "NO" > /dev/null
1189
+      work_clones "${EMBEDDED_REPOS_DIR}" "${clones}" "NO"
1184 1190
    ) || exit 1
1185 1191
 }
1186 1192
 
... ...
@@ -1214,14 +1220,14 @@ _fetch_once_deep_repository()
1214 1220
 
1215 1221
       # ugliness
1216 1222
       clones="`read_setting "${autodir}/embedded_repositories"`" ;
1217
-      work_clones "${reposdir}" "${clones}" "NO" > /dev/null
1223
+      work_clones "${reposdir}" "${clones}" "NO"
1218 1224
    ) || exit 1
1219 1225
 }
1220 1226
 
1221 1227
 
1222 1228
 fetch_once_deep_embedded_repositories()
1223 1229
 {
1224
-   log_fluff "fetch_once_deep_embedded_repositories"
1230
+   log_debug "fetch_once_deep_embedded_repositories"
1225 1231
 
1226 1232
    _operation_walk_repositories "_fetch_once_deep_repository"
1227 1233
 }
... ...
@@ -1236,7 +1242,7 @@ fetch_loop_repositories()
1236 1242
    local before
1237 1243
    local after
1238 1244
 
1239
-   log_fluff "fetch_loop_repositories"
1245
+   log_debug "fetch_loop_repositories"
1240 1246
 
1241 1247
    loops=""
1242 1248
    before=""
... ...
@@ -1323,7 +1329,7 @@ run_post_upgrade_scripts()
1323 1329
    [ "${OPTION_EMBEDDED_ONLY}" = "YES" ] && return
1324 1330
 
1325 1331
    did_upgrade_repositories "$@"
1326
-   fetch__run_root_settings_script "post-upgrade" "$@"
1332
+   fetch__run_root_settings_script "post-fetch" "$@"
1327 1333
 }
1328 1334
 
1329 1335
 
... ...
@@ -1333,6 +1339,7 @@ run_post_upgrade_scripts()
1333 1339
 fetch_loop()
1334 1340
 {
1335 1341
    local fetched
1342
+   local deep_fetched
1336 1343
    local is_master
1337 1344
 
1338 1345
    unpostpone_trace
... ...
@@ -1345,12 +1352,16 @@ fetch_loop()
1345 1352
 
1346 1353
    bootstrap_auto_create
1347 1354
 
1348
-   fetch_once_embedded_repositories
1355
+   fetched="`fetch_once_embedded_repositories`" || exit 1
1356
+   did_fetch_repositories "${fetched}"
1349 1357
 
1350 1358
    if [ "${OPTION_EMBEDDED_ONLY}" = "NO" ]
1351 1359
    then
1352 1360
       fetched="`fetch_loop_repositories`" || exit 1
1353
-      fetch_once_deep_embedded_repositories
1361
+      did_fetch_repositories "${fetched}"
1362
+
1363
+      fetched="`fetch_once_deep_embedded_repositories`" || exit 1
1364
+      did_fetch_repositories "${fetched}"
1354 1365
    fi
1355 1366
 
1356 1367
    bootstrap_auto_final
... ...
@@ -1437,8 +1448,10 @@ _common_main()
1437 1448
    local OPTION_ALLOW_CREATING_EMBEDDED_SYMLINKS="NO"
1438 1449
    local OPTION_ALLOW_SEARCH_CACHES="NO"
1439 1450
    local OPTION_EMBEDDED_ONLY="NO"
1451
+   local OVERRIDE_BRANCH
1440 1452
 
1441 1453
    OPTION_CHECK_USR_LOCAL_INCLUDE="`read_config_setting "check_usr_local_include" "NO"`"
1454
+   OVERRIDE_BRANCH="`read_config_setting "override_branch"`"
1442 1455
 
1443 1456
    case "${UNAME}" in
1444 1457
       mingw)
... ...
@@ -1475,17 +1488,6 @@ _common_main()
1475 1488
             OPTION_EMBEDDED_ONLY="YES"
1476 1489
          ;;
1477 1490
 
1478
-         -fb|--force-branch)
1479
-            shift
1480
-            [ $# -ne 0 ] || fail "branch missing"
1481
-
1482
-            OPTION_FORCE_BRANCH="$1"
1483
-            if [ -z "${OPTION_FORCE_BRANCH}" ]
1484
-            then
1485
-               OPTION_FORCE_BRANCH="master"
1486
-            fi
1487
-         ;;
1488
-
1489 1491
          -fs|--follow-symlinks)
1490 1492
             OPTION_ALLOW_FOLLOWING_SYMLINKS="YES"
1491 1493
          ;;
... ...
@@ -1656,35 +1658,35 @@ _common_main()
1656 1658
 
1657 1659
 fetch_main()
1658 1660
 {
1659
-   log_fluff "::: fetch begin :::"
1661
+   log_debug "::: fetch begin :::"
1660 1662
 
1661 1663
    USAGE="fetch_usage"
1662 1664
    COMMAND="fetch"
1663 1665
    _common_main "$@"
1664 1666
 
1665
-   log_fluff "::: fetch end :::"
1667
+   log_debug "::: fetch end :::"
1666 1668
 }
1667 1669
 
1668 1670
 
1669 1671
 update_main()
1670 1672
 {
1671
-   log_fluff "::: update begin :::"
1673
+   log_debug "::: update begin :::"
1672 1674
 
1673 1675
    USAGE="fetch_usage"
1674 1676
    COMMAND="update"
1675 1677
    _common_main "$@"
1676 1678
 
1677
-   log_fluff "::: update end :::"
1679
+   log_debug "::: update end :::"
1678 1680
 }
1679 1681
 
1680 1682
 
1681 1683
 upgrade_main()
1682 1684
 {
1683
-   log_fluff "::: upgrade begin :::"
1685
+   log_debug "::: upgrade begin :::"
1684 1686
 
1685 1687
    USAGE="fetch_usage"
1686 1688
    COMMAND="upgrade"
1687 1689
    _common_main "$@"
1688 1690
 
1689
-   log_fluff "::: upgrade end :::"
1691
+   log_debug "::: upgrade end :::"
1690 1692
 }
... ...
@@ -347,7 +347,7 @@ flags_main()
347 347
    local COMBINE
348 348
    local ABSOLUTE_PATHS
349 349
 
350
-   log_fluff ":flags_main:"
350
+   log_debug ":flags_main:"
351 351
 
352 352
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
353 353
 
... ...
@@ -1311,7 +1311,7 @@ write_protect_directory()
1311 1311
       exekutor mkdir "$1/lib" 2> /dev/null
1312 1312
       exekutor mkdir "$1/include" 2> /dev/null
1313 1313
 
1314
-      log_info "Write-protecting ${C_RESET_BOLD}$1${C_INFO} to avoid spurious header edits"
1314
+      log_verbose "Write-protecting ${C_RESET_BOLD}$1${C_VERBOSE} to avoid spurious header edits"
1315 1315
       exekutor chmod -R a-w "$1"
1316 1316
    fi
1317 1317
 }
... ...
@@ -1324,7 +1324,7 @@ functions_initialize()
1324 1324
 {
1325 1325
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
1326 1326
 
1327
-   log_fluff ":functions_initialize:"
1327
+   log_debug ":functions_initialize:"
1328 1328
 
1329 1329
    [ -z "${MULLE_BOOTSTRAP_ARRAY_SH}" ] && . mulle-bootstrap-array.sh
1330 1330
 
... ...
@@ -276,7 +276,7 @@ install_frameworks_by_symlinking()
276 276
 #
277 277
 install_main()
278 278
 {
279
-   log_fluff "::: install :::"
279
+   log_debug "::: install :::"
280 280
 
281 281
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
282 282
 
... ...
@@ -62,6 +62,11 @@ user_say_yes()
62 62
 
63 63
       printf "${C_WARNING}%b${C_RESET} (y/${C_GREEN}N${C_RESET}) > " "$*" >&2
64 64
       read x
65
+
66
+      if [ -z "${x}" ]
67
+      then
68
+         x="${MULLE_FLAG_ANSWER}"
69
+      fi
65 70
    done
66 71
 }
67 72
 
... ...
@@ -474,7 +479,7 @@ local_environment_initialize()
474 479
 
475 480
 local_environment_main()
476 481
 {
477
-   log_fluff ":local_environment_main:"
482
+   log_debug ":local_environment_main:"
478 483
    # source_environment
479 484
 
480 485
    if [ "${MULLE_FLAG_EXECUTOR_DRY_RUN}" = "YES" ]
... ...
@@ -100,6 +100,15 @@ log_setting()
100 100
    fi
101 101
 }
102 102
 
103
+# for debugging, not for user. same as fluff
104
+log_debug()
105
+{
106
+   if [ "${MULLE_FLAG_LOG_DEBUG}" = "YES"  ]
107
+   then
108
+      log_printf "${C_BR_RED}%b${C_RESET}\n" "$*"
109
+   fi
110
+}
111
+
103 112
 
104 113
 log_trace()
105 114
 {
... ...
@@ -119,6 +128,8 @@ log_trace2()
119 128
 fail()
120 129
 {
121 130
    log_error "${MULLE_EXECUTABLE_FAIL_PREFIX}:" "$@"
131
+   log_error `caller`
132
+
122 133
    if [ ! -z "${MULLE_EXECUTABLE_PID}" ]
123 134
    then
124 135
       kill -INT "${MULLE_EXECUTABLE_PID}"  # kill myself (especially, if executing in subshell)
... ...
@@ -160,7 +160,7 @@ mingw_buildpath()
160 160
 mingw_initialize()
161 161
 {
162 162
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
163
-   log_fluff ":mingw_initialize:"
163
+   log_debug ":mingw_initialize:"
164 164
 }
165 165
 
166 166
 mingw_initialize
... ...
@@ -181,7 +181,7 @@ project_initialize()
181 181
 {
182 182
 #  don't do it, so far it's been overkill
183 183
 #   source_environment
184
-   log_fluff ":project_initialize:"
184
+   log_debug ":project_initialize:"
185 185
 
186 186
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ]   && . mulle-bootstrap-logging.sh
187 187
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
... ...
@@ -54,10 +54,10 @@ remember_stash_of_repository()
54 54
 
55 55
    local reposdir="$1"  # ususally .bootstrap.repos
56 56
    local name="$2"      # name of the clone
57
-   local url="$3"       # URL of the clone
58
-   local branch="$4"    # branch of the clone
59
-   local scm="$5"       # scm to use for this clone
60
-   local tag="$6"       # tag to checkout of the clone
57
+#   local url="$3"       # URL of the clone
58
+#   local branch="$4"    # branch of the clone
59
+#   local scm="$5"       # scm to use for this clone
60
+#   local tag="$6"       # tag to checkout of the clone
61 61
    local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
62 62
 
63 63
    [ -z "${clone}" ]    && internal_fail "clone is missing"
... ...
@@ -258,6 +258,8 @@ _walk_repositories()
258 258
    reposdir="$1"
259 259
    shift
260 260
 
261
+   [ -z "${callback}" ]  && internal_fail "callback is empty"
262
+
261 263
    # parse_clone
262 264
    local name
263 265
    local url
... ...
@@ -491,42 +493,23 @@ computed_stashdir()
491 493
 #
492 494
 parse_raw_clone()
493 495
 {
494
-   IFS=";" read -r url dstdir branch scm tag <<< "${1}"
495
-}
496
+   local clone="$1"
497
+
498
+   [ -z "${clone}" ] && internal_fail "parse_raw_clone: clone is empty"
496 499
 
500
+   IFS=";" read -r url dstdir branch scm tag <<< "${clone}"
501
+}
497 502
 
498 503
 # this sets values to variables that should be declared
499 504
 # in the caller!
500 505
 #
501
-#   # parse_clone
506
+#   # parse_raw_clone
502 507
 #   local name
503
-#   local url
504
-#   local branch
505
-#   local scm
506
-#   local tag
507 508
 #   local stashdir
508
-parse_clone()
509
+process_clone()
509 510
 {
510 511
    local clone="$1"
511 512
 
512
-   [ -z "${clone}" ] && internal_fail "parse_clone: clone is empty"
513
-
514
-   local dstdir
515
-
516
-   #
517
-   # expansion is now done during already during .auto creation
518
-   # clone="`expanded_variables "${1}"`"
519
-   #
520
-   IFS=";" read -r url dstdir branch scm tag <<< "${clone}"
521
-
522
-   branch="${OPTION_FORCE_BRANCH:-${branch}}"
523
-
524
-   case "${url}" in
525
-      */\.\./*|\.\./*|*/\.\.|\.\.)
526
-         fail "Relative urls like \"${url}\" don't work (anymore).\nTry \"-y fetch --no-symlink-creation\" instead"
527
-      ;;
528
-   esac
529
-
530 513
    name="`_canonical_clone_name "${url}"`"
531 514
    stashdir="`computed_stashdir "${url}" "${name}" "${dstdir}"`"
532 515
 
... ...
@@ -537,14 +520,15 @@ parse_clone()
537 520
       ;;
538 521
 
539 522
       "")
540
-         internal_fail "Diffpath is empty for \"${clone}\""
523
+         internal_fail "Stashdir is empty for \"${clone}\""
541 524
       ;;
542 525
 
543 526
       \.\.*)
544
-         fail "Repository destination \"${dstdir}\" is outside of project directory ($diffpath) (\"${clone}\")"
527
+         fail "Repository destination \"${dstdir}\" is outside of project directory ($stashdir) (\"${clone}\")"
545 528
       ;;
546 529
    esac
547 530
 
531
+
548 532
    if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" ]
549 533
    then
550 534
       log_trace2 "URL:      \"${url}\""
... ...
@@ -559,10 +543,33 @@ parse_clone()
559 543
    [ -z "${url}" ]      && internal_fail "url is empty ($clone)"
560 544
    [ -z "${name}" ]     && internal_fail "name is empty ($clone)"
561 545
    [ -z "${stashdir}" ] && internal_fail "stashdir is empty ($clone)"
562
-
563 546
    :
564 547
 }
565 548
 
549
+# this sets values to variables that should be declared
550
+# in the caller!
551
+#
552
+#   # parse_clone
553
+#   local name
554
+#   local url
555
+#   local branch
556
+#   local scm
557
+#   local tag
558
+#   local stashdir
559
+#
560
+# expansion is now done during already during .auto creation
561
+# clone="`expanded_variables "${1}"`"
562
+#
563
+parse_clone()
564
+{
565
+   local clone="$1"
566
+
567
+   local dstdir
568
+
569
+   parse_raw_clone "${clone}"
570
+   process_clone "${clone}"
571
+}
572
+
566 573
 
567 574
 #
568 575
 # walk over clones just give raw values
... ...
@@ -604,6 +611,8 @@ walk_clones()
604 611
    local callback=$1; shift
605 612
    local reposdir=$1; shift
606 613
 
614
+   [ -z "${callback}" ] && internal_fail "parameter error"
615
+
607 616
    local name
608 617
    local url
609 618
    local branch
... ...
@@ -661,10 +670,12 @@ merge_repository_contents()
661 670
 
662 671
    local clone
663 672
    local map
673
+   local url
674
+   local name
664 675
 
665 676
    if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" -o "$MULLE_FLAG_MERGE_LOG" = "YES"  ]
666 677
    then
667
-      log_trace2 "Merging \"${additions}\" into \"${contents}\""
678
+      log_trace2 "Merging repositories \"${additions}\" into \"${contents}\""
668 679
    fi
669 680
 
670 681
    #
... ...
@@ -682,7 +693,14 @@ merge_repository_contents()
682 693
       IFS="${DEFAULT_IFS}"
683 694
 
684 695
       url="`_url_part_from_clone "${clone}"`"
685
-      map="`assoc_array_set "${map}" "${url}" "${clone}"`"
696
+      name="`_canonical_clone_name "${url}"`"
697
+
698
+      if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" -o "$MULLE_FLAG_MERGE_LOG" = "YES"  ]
699
+      then
700
+         log_trace2 "${name}: ${clone}"
701
+      fi
702
+
703
+      map="`assoc_array_set "${map}" "${name}" "${clone}"`"
686 704
    done
687 705
 
688 706
    IFS="
... ...
@@ -692,7 +710,14 @@ merge_repository_contents()
692 710
       IFS="${DEFAULT_IFS}"
693 711
 
694 712
       url="`_url_part_from_clone "${clone}"`"
695
-      map="`assoc_array_set "${map}" "${url}" "${clone}"`"
713
+      name="`_canonical_clone_name "${url}"`"
714
+
715
+      if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" -o "$MULLE_FLAG_MERGE_LOG" = "YES"  ]
716
+      then
717
+         log_trace2 "${name}: ${clone}"
718
+      fi
719
+
720
+      map="`assoc_array_set "${map}" "${name}" "${clone}"`"
696 721
    done
697 722
    IFS="${DEFAULT_IFS}"
698 723
 
... ...
@@ -781,7 +806,9 @@ sort_repository_file()
781 806
    local dependency_map
782 807
    local clone
783 808
 
784
-   [ -z "${MULLE_BOOTSTRAP_DEPENDENY_RESOLVE_SH}" ] && . mulle-bootstrap-dependency-resolve.sh
809
+   log_debug ":sort_repository_file:"
810
+
811
+   [ -z "${MULLE_BOOTSTRAP_DEPENDENCY_RESOLVE_SH}" ] && . mulle-bootstrap-dependency-resolve.sh
785 812
 
786 813
    refreshed=""
787 814
    dependency_map=""
... ...
@@ -885,15 +912,14 @@ ${clone}"
885 912
 }
886 913
 
887 914
 
888
-
889 915
 mulle_repositories_initialize()
890 916
 {
891
-   [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
917
+   [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ]         && . mulle-bootstrap-logging.sh
892 918
 
893
-   log_fluff ":mulle_repositories_initialize:"
919
+   log_debug ":mulle_repositories_initialize:"
894 920
 
895
-   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
896
-   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
921
+   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]        && . mulle-bootstrap-settings.sh
922
+   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ]       && . mulle-bootstrap-functions.sh
897 923
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
898 924
    :
899 925
 }
... ...
@@ -470,7 +470,7 @@ append_dir_to_gitignore_if_needed()
470 470
 
471 471
 git_main()
472 472
 {
473
-   log_fluff "::: git :::"
473
+   log_debug "::: git :::"
474 474
 
475 475
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
476 476
    [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
... ...
@@ -525,7 +525,7 @@ run_git()
525 525
 
526 526
 scm_initialize()
527 527
 {
528
-   log_fluff ":scm_initialize:"
528
+   log_debug ":scm_initialize:"
529 529
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
530 530
    [ -z "${MULLE_BOOTSTRAP_REPOSITORIES_SH}" ] && . mulle-bootstrap-repositories.sh
531 531
    :
... ...
@@ -132,7 +132,7 @@ fetch__run_build_settings_script()
132 132
 
133 133
 scripts_initialize()
134 134
 {
135
-   log_fluff ":scripts_initialize:"
135
+   log_debug ":scripts_initialize:"
136 136
    [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]        && . mulle-bootstrap-settings.sh
137 137
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
138 138
    :
... ...
@@ -196,7 +196,8 @@ _read_setting()
196 196
       apath="`absolutepath "${apath}"`"
197 197
 
198 198
       # make some boring names less prominent
199
-      if [ "${name}" = "repositories" -o \
199
+      if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES"  -o \
200
+           "${name}" = "repositories" -o \
200 201
            "${name}" = "repositories.tmp" -o \
201 202
            "${name}" = "build_order" -o \
202 203
            "${name}" = "versions" -o \
... ...
@@ -204,9 +205,7 @@ _read_setting()
204 205
            "${name}" = "MULLE_REPOSITORIES" -o \
205 206
            "${name}" = "MULLE_NAT_REPOSITORIES"  ]
206 207
       then
207
-         log_setting "Setting ${C_MAGENTA}${name}${C_SETTING} found in \"${apath}\" as ${C_MAGENTA}${C_BOLD}${value}${C_SETTING}"
208
-      else
209
-         log_verbose "${C_SETTING}Setting ${C_MAGENTA}${name}${C_SETTING} found in \"${apath}\" as ${C_MAGENTA}${value}${C_SETTING}"
208
+         log_printf "${C_SETTING}%b${C_RESET}\n" "Setting ${C_MAGENTA}${name}${C_SETTING} found in \"${apath}\" as ${C_MAGENTA}${C_BOLD}${value}${C_SETTING}"
210 209
       fi
211 210
    fi
212 211
 
... ...
@@ -318,8 +317,7 @@ _read_home_setting()
318 317
       log_trace2 "Looking for setting \"${name}\" in \"~/.mulle-bootstrap\""
319 318
    fi
320 319
 
321
-   value="`_read_setting "${HOME}/.mulle-bootstrap/${name}"`"
322
-   if [ $? -ne 0 ]
320
+   if ! value="`_read_setting "${HOME}/.mulle-bootstrap/${name}"`"
323 321
    then
324 322
       return 2
325 323
    fi
... ...
@@ -358,24 +356,21 @@ read_config_setting()
358 356
    #
359 357
    # always lowercase config names
360 358
    #
361
-   name=`echo "${name}" | tr '[:lower:]' '[:upper:]'`
359
+   name=`echo "${name}" | tr '[:upper:]' '[:lower:]'`
362 360
 
363 361
    local value
364 362
 
365
-   value="`_read_environment_setting "${name}"`"
366
-   if [ $? -ne 0 ]
363
+   if ! value="`_read_environment_setting "${name}"`"
367 364
    then
368
-      value="`_read_setting "${BOOTSTRAP_DIR}.local/config/${name}"`"
369
-      if [ $? -ne 0 ]
365
+      if ! value="`_read_setting "${BOOTSTRAP_DIR}.local/config/${name}"`"
370 366
       then
371
-         value="`_read_home_setting "${name}"`"
372
-         if [ $? -ne 0 ]
367
+         if ! value="`_read_home_setting "${name}"`"
373 368
          then
374 369
             if [ ! -z "${default}" ]
375 370
             then
376 371
                log_setting "Setting ${C_MAGENTA}${name}${C_SETTING} set to default ${C_MAGENTA}${default}${C_SETTING}"
372
+               value="${default}"
377 373
             fi
378
-            value="${default}"
379 374
          fi
380 375
       fi
381 376
    fi
... ...
@@ -573,6 +568,7 @@ _merge_settings_in_front()
573 568
 {
574 569
    local settings1="$1"
575 570
    local settings2="$2"
571
+   local name="$3"
576 572
 
577 573
    local result
578 574
 
... ...
@@ -597,7 +593,7 @@ ${result}"
597 593
         "$MULLE_FLAG_MERGE_LOG" = "YES"  ]
598 594
    then
599 595
       log_trace2 "----------------------"
600
-      log_trace2 "Merged settings: $1, $2"
596
+      log_trace2 "Merged settings:      "
601 597
       log_trace2 "----------------------"
602 598
       log_trace2 "${result}"
603 599
       log_trace2 "----------------------"
... ...
@@ -618,7 +614,7 @@ merge_settings_in_front()
618 614
       settings2="`_read_setting "$2"`"
619 615
    fi
620 616
 
621
-   _merge_settings_in_front "${settings1}" "${settings2}"
617
+   _merge_settings_in_front "${settings1}" "${settings2}" "`basename -- "$1"`"
622 618
 }
623 619
 
624 620
 
... ...
@@ -932,7 +928,7 @@ setting_main()
932 928
 
933 929
 settings_initialize()
934 930
 {
935
-   log_fluff ":settings_initialize:"
931
+   log_debug ":settings_initialize:"
936 932
 
937 933
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
938 934
 
... ...
@@ -164,7 +164,7 @@ _common_status()
164 164
 
165 165
 status_main()
166 166
 {
167
-   log_fluff ":status_main:"
167
+   log_debug ":status_main:"
168 168
 
169 169
    local OPTION_ALLOW_FOLLOWING_SYMLINKS="YES"
170 170
    local OPTION_EMBEDDED_ONLY="NO"
... ...
@@ -190,7 +190,7 @@ tag()
190 190
 
191 191
 tag_main()
192 192
 {
193
-   log_fluff "::: tag :::"
193
+   log_debug "::: tag :::"
194 194
 
195 195
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
196 196
    [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
... ...
@@ -130,7 +130,7 @@ now."
130 130
 
131 131
 warn_scripts_main()
132 132
 {
133
-   log_fluff "::: warn_scripts begin :::"
133
+   log_debug "::: warn_scripts begin :::"
134 134
 
135 135
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
136 136
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
... ...
@@ -151,5 +151,5 @@ warn_scripts_main()
151 151
       warn_scripts "$@"
152 152
    fi
153 153
 
154
-   log_fluff "::: warn_scripts end :::"
154
+   log_debug "::: warn_scripts end :::"
155 155
 }
... ...
@@ -375,10 +375,10 @@ Release"
375 375
 
376 376
 xcode_main()
377 377
 {
378
-   log_fluff "::: xcode :::"
378
+   log_debug "::: xcode :::"
379 379
 
380 380
    [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
381
-   [ -z "${MULLE_BOOTSTRAP_BREW_SH}" ] && . mulle-bootstrap-brew.sh
381
+   [ -z "${MULLE_BOOTSTRAP_BREW_SH}" ]     && . mulle-bootstrap-brew.sh
382 382
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
383 383
 
384 384
    build_complete_environment