Browse code

fixed a variety of large and small errors

Nat! authored on 04-09-2016 18:12:34
Showing 8 changed files
... ...
@@ -1,19 +1,26 @@
1 1
 SCRIPTS=install.sh \
2
-mulle-bootstrap-brew.sh \
3
-mulle-bootstrap-build.sh \
4
-mulle-bootstrap-clean.sh \
5
-mulle-bootstrap-convert-pre-0.10.sh \
6
-mulle-bootstrap-fetch.sh \
7
-mulle-bootstrap-functions.sh \
8
-mulle-bootstrap-gcc.sh \
9
-mulle-bootstrap-init.sh \
10
-mulle-bootstrap-local-environment.sh \
11
-mulle-bootstrap-settings.sh \
12
-mulle-bootstrap-scm.sh \
13
-mulle-bootstrap-scripts.sh \
14
-mulle-bootstrap-tag.sh \
15
-mulle-bootstrap-warn-scripts.sh \
16
-mulle-bootstrap-xcode.sh
2
+src/mulle-bootstrap-array.sh \
3
+src/mulle-bootstrap-auto-update.sh \
4
+src/mulle-bootstrap-brew.sh \
5
+src/mulle-bootstrap-build.sh \
6
+src/mulle-bootstrap-build-environment.sh \
7
+src/mulle-bootstrap-clean.sh \
8
+src/mulle-bootstrap-dependency-resolve.sh \
9
+src/mulle-bootstrap-fetch.sh \
10
+src/mulle-bootstrap-functions.sh \
11
+src/mulle-bootstrap-gcc.sh \
12
+src/mulle-bootstrap-init.sh \
13
+src/mulle-bootstrap-install.sh \
14
+src/mulle-bootstrap-local-environment.sh \
15
+src/mulle-bootstrap-logging.sh \
16
+src/mulle-bootstrap-mingw.sh \
17
+src/mulle-bootstrap-refresh.sh \
18
+src/mulle-bootstrap-scm.sh \
19
+src/mulle-bootstrap-scripts.sh \
20
+src/mulle-bootstrap-settings.sh \
21
+src/mulle-bootstrap-tag.sh \
22
+src/mulle-bootstrap-warn-scripts.sh \
23
+src/mulle-bootstrap-xcode.sh
17 24
 
18 25
 CHECKSTAMPS=$(SCRIPTS:.sh=.chk)
19 26
 SHELLFLAGS=-x -e SC2164,SC2166,SC2006 -s sh
... ...
@@ -48,7 +48,7 @@ usage()
48 48
 {
49 49
    cat <<EOF
50 50
 usage: mulle-bootstrap [options] [command] [--help]
51
- Common Options: 
51
+ Common Options:
52 52
    -a -y     : default answer to questions (scripts wont be checked)
53 53
                -a (clone preferred) -y (local copy/symlink preferred)
54 54
    -n        : do nothing creative or destructive
... ...
@@ -226,7 +226,7 @@ bootstrap_main()
226 226
 
227 227
       shift
228 228
       continue
229
-   done   
229
+   done
230 230
 
231 231
   command=${1:-"bootstrap"}
232 232
    [ $# -eq 0 ] || shift
... ...
@@ -245,6 +245,7 @@ bootstrap_main()
245 245
       FLUFF)
246 246
          MULLE_BOOTSTRAP_FLUFF="YES"
247 247
          MULLE_BOOTSTRAP_VERBOSE="YES"
248
+         MULLE_BOOTSTRAP_TRACE_EXECUTION="YES"
248 249
          if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
249 250
          then
250 251
             MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
... ...
@@ -310,18 +311,18 @@ bootstrap_main()
310 311
    then
311 312
       case "${command}" in
312 313
          bootstrap|nomagic|setup-xcode|xcode|tag)
313
-           . mulle-bootstrap-refresh.sh  
314
+           . mulle-bootstrap-refresh.sh
314 315
             refresh_main || exit 1
315 316
          ;;
316 317
 
317 318
          clean|dist-clean|fetch)
318
-           . mulle-bootstrap-refresh.sh  
319
+           . mulle-bootstrap-refresh.sh
319 320
 
320 321
             refresh_main clear || exit 1
321 322
          ;;
322 323
 
323 324
          update)
324
-           . mulle-bootstrap-refresh.sh 
325
+           . mulle-bootstrap-refresh.sh
325 326
          ;;
326 327
       esac
327 328
    fi
... ...
@@ -333,9 +334,9 @@ bootstrap_main()
333 334
             DONT_RECURSE=YES
334 335
          fi
335 336
 
336
-         . mulle-bootstrap-fetch.sh 
337
-         . mulle-bootstrap-build.sh 
338
-         . mulle-bootstrap-warn-scripts.sh 
337
+         . mulle-bootstrap-fetch.sh
338
+         . mulle-bootstrap-build.sh
339
+         . mulle-bootstrap-warn-scripts.sh
339 340
 
340 341
          if [ "${DONT_RECURSE}" = "" ]
341 342
          then
... ...
@@ -60,28 +60,30 @@ bootstrap_auto_update_merge()
60 60
 
61 61
       settingname="`basename -- "${i}"`"
62 62
       srcfile="${directory}/.bootstrap/${settingname}"
63
-      dstfile="${BOOTSTRAP_SUBDIR}.auto/${settingname}"
64
-      localfile="${BOOTSTRAP_SUBDIR}.local/${settingname}"
65 63
 
66
-      if [ -e "${localfile}" ]
64
+      if [ -d "${srcfile}" ]
67 65
       then
68
-         log_verbose "Setting \"${settingname}\" is locally specified, so not merged"
69 66
          continue
70 67
       fi
71 68
 
72
-      if [ -d "${srcfile}" ]
69
+      localfile="${BOOTSTRAP_SUBDIR}.local/${settingname}"
70
+
71
+      if [ -e "${localfile}" ]
73 72
       then
73
+         log_verbose "Setting \"${settingname}\" is locally specified, so not merged"
74 74
          continue
75 75
       fi
76 76
 
77
-      match="`echo "$NON_MERGABLE_SETTINGS" | grep "${settingname}"`"
77
+      match="`echo "${NON_MERGABLE_SETTINGS}" | fgrep -x "${settingname}"`"
78 78
       if [ ! -z "${match}" ]
79 79
       then
80
+         log_fluff "Setting \"${settingname}\" is not mergable"
80 81
          continue
81 82
       fi
82 83
 
83 84
       log_verbose "Inheriting \"${settingname}\" from \"${srcfile}\""
84 85
 
86
+      dstfile="${BOOTSTRAP_SUBDIR}.auto/${settingname}"
85 87
       if [ -f "${dstfile}" ]
86 88
       then
87 89
          tmpfile="${BOOTSTRAP_SUBDIR}.auto/${settingname}.tmp"
... ...
@@ -93,6 +95,7 @@ bootstrap_auto_update_merge()
93 95
          exekutor cp "${srcfile}" "${dstfile}" || exit 1
94 96
       fi
95 97
    done
98
+
96 99
    IFS="${old}"
97 100
 }
98 101
 
... ...
@@ -145,21 +148,24 @@ bootstrap_auto_update_settings()
145 148
    srcdir="${directory}/.bootstrap/settings"
146 149
    dstdir="${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
147 150
 
148
-   mkdir_if_missing "${dstdir}" 
151
+   if dir_has_files "${srcdir}"
152
+   then
153
+      mkdir_if_missing "${dstdir}"
149 154
 
150
-   bootstrap_auto_copy_files  "${srcdir}" "${dstdir}"
155
+      bootstrap_auto_copy_files  "${srcdir}" "${dstdir}"
151 156
 
152
-   # copy scripts
157
+      # copy scripts
153 158
 
154
-   srcdir="${srcdir}/bin"
155
-   dstdir="${dstdir}/bin"
159
+      srcdir="${srcdir}/bin"
160
+      dstdir="${dstdir}/bin"
156 161
 
157
-   mkdir_if_missing "${dstdir}" 
158
-   bootstrap_auto_copy_files  "${srcdir}" "${dstdir}"
162
+      mkdir_if_missing "${dstdir}"
163
+      bootstrap_auto_copy_files  "${srcdir}" "${dstdir}"
159 164
 
160
-   rmdir_if_empty "${dstdir}/bin"
165
+      rmdir_if_empty "${dstdir}/bin"
161 166
 
162
-   rmdir_if_empty "${dstdir}" 
167
+      rmdir_if_empty "${dstdir}"
168
+   fi
163 169
 }
164 170
 
165 171
 
... ...
@@ -176,7 +182,7 @@ bootstrap_auto_update_repo_settings()
176 182
    srcdir="${directory}/.bootstrap"
177 183
    dstdir="${BOOTSTRAP_SUBDIR}.auto"
178 184
 
179
-   mkdir_if_missing "${dstdir}" 
185
+   mkdir_if_missing "${dstdir}"
180 186
 
181 187
    #
182 188
    # copy repo settings flat if not present already
... ...
@@ -197,11 +203,10 @@ bootstrap_auto_update_repo_settings()
197 203
          continue
198 204
       fi
199 205
 
200
-      log_fluff  "Copy \"${i}\" to \"${dstdir}\""
201 206
       exekutor cp -Ra "${i}" ${dstdir}/${reponame}""
202 207
    done
203 208
 
204
-   rmdir_if_empty "${dstdir}" 
209
+   rmdir_if_empty "${dstdir}"
205 210
 }
206 211
 
207 212
 
... ...
@@ -241,13 +246,14 @@ bootstrap_auto_update()
241 246
    log_fluff "Acquiring \"${name}\" repo settings"
242 247
    bootstrap_auto_update_repo_settings "${directory}"
243 248
 
249
+   log_fluff "Acquisiton of \"${name}\" complete"
244 250
    return 0
245 251
 }
246 252
 
247 253
 #
248 254
 # copy contents of .bootstrap.local to .bootstrap.auto
249 255
 # them add contents of .bootstrap to .bootstrap.auto, if not present
250
-# 
256
+#
251 257
 bootstrap_auto_create()
252 258
 {
253 259
    log_verbose "Creating .bootstrap.auto from .bootstrap and .bootstrap.local"
... ...
@@ -292,6 +298,6 @@ auto_update_initialize()
292 298
     log_fluff ":auto_update_initialize:"
293 299
 
294 300
   NON_MERGABLE_SETTINGS='embedded_repositories
295
-'   
301
+'
296 302
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh && functions_initialize
297 303
 }
... ...
@@ -29,11 +29,6 @@
29 29
 #   POSSIBILITY OF SUCH DAMAGE.
30 30
 MULLE_BOOTSTRAP_BUILD_SH="included"
31 31
 
32
-[ -z "${MULLE_BOOTSTRAP_BUILD_ENVIRONMENT_SH}" ] && . mulle-bootstrap-build-environment.sh
33
-[ -z "${MULLE_BOOTSTRAP_GCC_SH}" ] && . mulle-bootstrap-gcc.sh
34
-[ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
35
-[ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
36
-
37 32
 
38 33
 build_usage()
39 34
 {
... ...
@@ -551,7 +546,7 @@ find_compiler()
551 546
       ;;
552 547
    esac
553 548
 
554
-   assert_binary "${compiler}" 
549
+   assert_binary "${compiler}"
555 550
    echo "`basename -- "${compiler}"`"
556 551
 }
557 552
 
... ...
@@ -623,6 +618,19 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
623 618
    # no problem if those are empty
624 619
    c_compiler="`find_compiler CC`"
625 620
    cxx_compiler="`find_compiler CXX`"
621
+
622
+   local c_compiler_line
623
+   local cxx_compiler_line
624
+
625
+   if [ ! -z "${c_compiler}" ]
626
+   then
627
+      c_compiler_line="-DCMAKE_C_COMPILER=${c_compiler}"
628
+   fi
629
+   if [ ! -z "${cxx_compiler}" ]
630
+   then
631
+      cxx_compiler_line="-DCMAKE_CXX_COMPILER=${cxx_compiler}"
632
+   fi
633
+
626 634
    # linker="`read_build_setting "${name}" "LD"`"
627 635
 
628 636
    local other_cflags
... ...
@@ -713,8 +721,8 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
713 721
       includelines="`add_path "${includelines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}"`"
714 722
       includelines="`add_path "${includelines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${HEADER_DIR_NAME}"`"
715 723
 
716
-      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} "`"
717
-      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${LIBRARY_DIR_NAME} "`"
724
+      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}"`"
725
+      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${LIBRARY_DIR_NAME}"`"
718 726
 
719 727
       frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}"`"
720 728
       frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${FRAMEWORK_DIR_NAME}"`"
... ...
@@ -729,11 +737,11 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
729 737
       prefixbuild="`add_path "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCY_SUBDIR}"`"
730 738
       dependenciesdir="`add_path "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}"`"
731 739
 
732
-      cmakemodulepath="\${CMAKE_MODULE_PATH}"
733
-      if [ ! -z "${CMAKE_MODULE_PATH}" ]
734
-      then
735
-         cmakemodulepath="${CMAKE_MODULE_PATH}${PATH_SEPARATOR}${cmakemodulepath}"   # prepend
736
-      fi
740
+#      cmakemodulepath="\${CMAKE_MODULE_PATH}"
741
+#      if [ ! -z "${CMAKE_MODULE_PATH}" ]
742
+#      then
743
+#         cmakemodulepath="${CMAKE_MODULE_PATH}${PATH_SEPARATOR}${cmakemodulepath}"   # prepend
744
+#      fi
737 745
 
738 746
       local frameworkprefix
739 747
       local libraryprefix
... ...
@@ -770,6 +778,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
770 778
       for path in ${includelines}
771 779
       do
772 780
          other_cflags="`concat "${other_cflags}" "${includeprefix}${path}"`"
781
+         other_cxxflags="`concat "${other_cxxflags}" "${includeprefix}${path}"`"
773 782
       done
774 783
 
775 784
       for path in ${librarylines}
... ...
@@ -780,6 +789,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
780 789
       for path in ${frameworklines}
781 790
       do
782 791
          other_cflags="`concat "${other_cflags}" "${frameworkprefix}${path}"`"
792
+         other_cxxflags="`concat "${other_cxxflags}" "${frameworkprefix}${path}"`"
783 793
          other_ldflags="`concat "${other_ldflags}" "${frameworkprefix}${path}"`"
784 794
       done
785 795
 
... ...
@@ -793,10 +803,10 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
793 803
       local oldpath
794 804
       local rval
795 805
 
796
-      [ -z "${BUILDPATH}"] && internal_fail "BUILDPATH not set"
797
-   
806
+      [ -z "${BUILDPATH}" ] && internal_fail "BUILDPATH not set"
807
+
798 808
       oldpath="$PATH"
799
-      PATH="${BUILDPATH}" 
809
+      PATH="${BUILDPATH}"
800 810
 
801 811
       logging_exekutor "${CMAKE}" -G "${CMAKE_GENERATOR}" "-DCMAKE_BUILD_TYPE=${mapped}" \
802 812
 "${sdkparameter}" \
... ...
@@ -805,30 +815,29 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
805 815
 "-DCMAKE_INCLUDE_PATH=${includelines}" \
806 816
 "-DCMAKE_LIBRARY_PATH=${librarylines}" \
807 817
 "-DCMAKE_FRAMEWORK_PATH=${frameworklines}" \
808
-"-DCMAKE_C_COMPILER=${c_compiler}" \
809
-"-DCMAKE_CXX_COMPILER=${cxx_compiler}" \
818
+"${c_compiler_line}" \
819
+"${cxx_compiler_line}" \
810 820
 "-DCMAKE_C_FLAGS=${other_cflags}" \
811 821
 "-DCMAKE_CXX_FLAGS=${other_cxxflags}" \
812 822
 "-DCMAKE_EXE_LINKER_FLAGS=${other_ldflags}" \
813 823
 "-DCMAKE_SHARED_LINKER_FLAGS=${other_ldflags}" \
814
-"-DCMAKE_MODULE_PATH=${cmakemodulepath}" \
815 824
 ${CMAKE_FLAGS} \
816 825
 ${localcmakeflags} \
817
-"${relative_srcdir}" > "${logfile1}" 
826
+"${relative_srcdir}" > "${logfile1}"
818 827
       rval=$?
819 828
 
820 829
       if [ $rval -ne 0 ]
821 830
       then
822
-         PATH="${oldpath}" 
831
+         PATH="${oldpath}"
823 832
          build_fail "${logfile1}" "cmake"
824 833
       fi
825 834
 
826
-      logging_exekutor "${MAKE}" ${MAKE_FLAGS} ${local_make_flags} install > "${logfile2}" 
835
+      logging_exekutor "${MAKE}" ${MAKE_FLAGS} ${local_make_flags} install > "${logfile2}"
827 836
       rval=$?
828 837
 
829 838
       PATH="${oldpath}"
830 839
       [ $rval -ne 0 ] && build_fail "${logfile2}" "make"
831
-   
840
+
832 841
       set +f
833 842
 
834 843
    exekutor cd "${owd}"
... ...
@@ -980,8 +989,8 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
980 989
       includelines="`add_path "${includelines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}"`"
981 990
       includelines="`add_path "${includelines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${HEADER_DIR_NAME}"`"
982 991
 
983
-      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} "`"
984
-      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${LIBRARY_DIR_NAME} "`"
992
+      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}"`"
993
+      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${LIBRARY_DIR_NAME}"`"
985 994
 
986 995
       frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}"`"
987 996
       frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_ADDICTION_SUBDIR}/${FRAMEWORK_DIR_NAME}"`"
... ...
@@ -1034,7 +1043,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1034 1043
       local rval
1035 1044
 
1036 1045
       oldpath="$PATH"
1037
-      PATH="${BUILDPATH}" 
1046
+      PATH="${BUILDPATH}"
1038 1047
 
1039 1048
       # use absolute paths for configure, safer (and easier to read IMO)
1040 1049
       DEPENDENCIES_DIR="'${dependenciesdir}'" \
... ...
@@ -1049,11 +1058,11 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1049 1058
 
1050 1059
       if [ $rval -ne 0 ]
1051 1060
       then
1052
-         PATH="${oldpath}" 
1061
+         PATH="${oldpath}"
1053 1062
          build_fail "${logfile1}" "configure"
1054 1063
       fi
1055 1064
 
1056
-      logging_exekutor "${MAKE}" ${MAKE_FLAGS} install > "${logfile2}" 
1065
+      logging_exekutor "${MAKE}" ${MAKE_FLAGS} install > "${logfile2}"
1057 1066
       rval=$?
1058 1067
 
1059 1068
       PATH="${oldpath}"
... ...
@@ -1482,9 +1491,9 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1482 1491
 
1483 1492
       local oldpath
1484 1493
       local rval
1485
-      
1494
+
1486 1495
       oldpath="${PATH}"
1487
-      PATH="${BUILDPATH}" 
1496
+      PATH="${BUILDPATH}"
1488 1497
       # if it doesn't install, probably SKIP_INSTALL is set
1489 1498
       cmdline="\"${XCODEBUILD}\" \"${command}\" ${arguments} \
1490 1499
 ARCHS='${ARCHS:-\${ARCHS_STANDARD_32_64_BIT\}}' \
... ...
@@ -1503,7 +1512,7 @@ HEADER_SEARCH_PATHS='${dependencies_header_search_path}' \
1503 1512
 LIBRARY_SEARCH_PATHS='${dependencies_lib_search_path}' \
1504 1513
 FRAMEWORK_SEARCH_PATHS='${dependencies_framework_search_path}'"
1505 1514
 
1506
-      logging_eval_exekutor "${cmdline}" > "${logfile}" 
1515
+      logging_eval_exekutor "${cmdline}" > "${logfile}"
1507 1516
       rval=$?
1508 1517
 
1509 1518
       PATH="${oldpath}"
... ...
@@ -1659,7 +1668,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1659 1668
       local rval
1660 1669
 
1661 1670
       oldpath="${PATH}"
1662
-      PATH="${BUILDPATH}" 
1671
+      PATH="${BUILDPATH}"
1663 1672
 
1664 1673
       run_log_build_script "${owd}/${script}" \
1665 1674
          "${configuration}" \
... ...
@@ -1667,10 +1676,10 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1667 1676
          "${owd}/${builddir}" \
1668 1677
          "${owd}/${BUILD_DEPENDENCY_SUBDIR}" \
1669 1678
          "${name}" \
1670
-         "${sdk}" > "${logfile}" 
1679
+         "${sdk}" > "${logfile}"
1671 1680
       rval=$?
1672 1681
 
1673
-      PATH="${oldpath}" 
1682
+      PATH="${oldpath}"
1674 1683
       [ $rval -ne 0 ] && build_fail "${logfile}" "build.sh"
1675 1684
 
1676 1685
    exekutor cd "${owd}"
... ...
@@ -2121,7 +2130,7 @@ build_main()
2121 2130
 {
2122 2131
    local  clean
2123 2132
 
2124
-   log_fluff "::: build :::"
2133
+   log_fluff "::: build begin :::"
2125 2134
 
2126 2135
    while :
2127 2136
    do
... ...
@@ -2185,6 +2194,9 @@ build_main()
2185 2194
 
2186 2195
    build_complete_environment
2187 2196
 
2197
+   [ -z "${MULLE_BOOTSTRAP_GCC_SH}" ] && . mulle-bootstrap-gcc.sh && gcc_initialize
2198
+   [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh && scripts_initialize
2199
+
2188 2200
    if [ $# -eq 0 ]
2189 2201
    then
2190 2202
       log_fluff "Setting up dependencies directory as \"${DEPENDENCY_SUBDIR}\""
... ...
@@ -2217,5 +2229,8 @@ build_main()
2217 2229
    else
2218 2230
       log_fluff "No dependencies have been generated"
2219 2231
    fi
2232
+
2233
+   log_fluff "::: build end :::"
2220 2234
 }
2221 2235
 
2236
+
... ...
@@ -136,6 +136,8 @@ install_brews()
136 136
       return
137 137
    fi
138 138
 
139
+   [ -z "${MULLE_BOOTSTRAP_BREW_SH}" ] && . mulle-bootstrap-brew.sh && brew_initialize
140
+
139 141
    if [ -d "${ADDICTION_SUBDIR}" ]
140 142
    then
141 143
       log_fluff "Unprotecting \"${ADDICTION_SUBDIR}\" for ${command}."
... ...
@@ -1288,7 +1290,7 @@ update_embedded_repositories()
1288 1290
 
1289 1291
 fetch_main()
1290 1292
 {
1291
-   log_fluff "::: fetch :::"
1293
+   log_fluff "::: fetch begin :::"
1292 1294
 
1293 1295
    while :
1294 1296
    do
... ...
@@ -1346,7 +1348,6 @@ fetch_main()
1346 1348
       ;;
1347 1349
    esac
1348 1350
 
1349
-   [ -z "${MULLE_BOOTSTRAP_BREW_SH}" ] && . mulle-bootstrap-brew.sh && brew_initialize
1350 1351
    [ -z "${MULLE_BOOTSTRAP_SCM_SH}" ] && . mulle-bootstrap-scm.sh && scm_initialize
1351 1352
    [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh && scripts_initialize
1352 1353
    [ -z "${MULLE_BOOTSTRAP_WARN_SCRIPTS_SH}" ] && . mulle-bootstrap-warn-scripts.sh && warns_scripts_initialize
... ...
@@ -1411,5 +1412,7 @@ fetch_main()
1411 1412
          append_dir_to_gitignore_if_needed "${CLONES_SUBDIR}"
1412 1413
       fi
1413 1414
    fi
1415
+
1416
+   log_fluff "::: fetch end :::"
1414 1417
 }
1415 1418
 
... ...
@@ -553,7 +553,7 @@ refresh_deeply_embedded_repositories()
553 553
 
554 554
 refresh_main()
555 555
 {
556
-   log_fluff "::: refresh :::"
556
+   log_fluff "::: refresh begin :::"
557 557
 
558 558
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh && local_environment_initialize
559 559
    [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh && settings_initialize
... ...
@@ -599,28 +599,27 @@ refresh_main()
599 599
    #
600 600
    # short cut if there are no .repos
601 601
    #
602
-   if [ "${COMMAND}" = "clear" -o ! -d "${CLONESFETCH_SUBDIR}" ]
602
+   if [ "${COMMAND}" != "clear" -a -d "${CLONESFETCH_SUBDIR}" ]
603 603
    then
604
-      return 0
605
-   fi
606
-   
607
-
608
-   if [ "${DONT_RECURSE}" = "" ]
609
-   then
610
-      log_verbose "Refreshing repository settings"
611
-      refresh_repositories_settings
612
-   fi
604
+      if [ "${DONT_RECURSE}" = "" ]
605
+      then
606
+         log_verbose "Refreshing repository settings"
607
+         refresh_repositories_settings
608
+      fi
613 609
 
614
-   log_verbose "Detect zombie repositories"
615
-   refresh_repositories
610
+      log_verbose "Detect zombie repositories"
611
+      refresh_repositories
616 612
 
617
-   log_verbose "Detect embedded zombie repositories"
618
-   refresh_embedded_repositories
613
+      log_verbose "Detect embedded zombie repositories"
614
+      refresh_embedded_repositories
619 615
 
620
-   if [ "${DONT_RECURSE}" = "" ]
621
-   then
622
-      log_verbose "Detect deeply embedded zombie repositories"
623
-      refresh_deeply_embedded_repositories
616
+      if [ "${DONT_RECURSE}" = "" ]
617
+      then
618
+         log_verbose "Detect deeply embedded zombie repositories"
619
+         refresh_deeply_embedded_repositories
620
+      fi
624 621
    fi
622
+
623
+   log_fluff "::: refresh end :::"
625 624
 }
626 625
 
... ...
@@ -116,6 +116,7 @@ _read_setting()
116 116
          log_fluff "${C_MAGENTA}${C_BOLD}`basename -- "${file}" ".${os}"`${C_FLUFF} found as \"${file}\""
117 117
       fi
118 118
       echo "${value}"
119
+      return 0
119 120
    fi
120 121
 
121 122
    value="`egrep -s -v '^#|^[ ]*$' "${file}"`"
... ...
@@ -356,7 +357,6 @@ read_build_root_setting()
356 357
       set +x
357 358
    fi
358 359
 
359
-   local value
360 360
    local name
361 361
    local default
362 362
 
... ...
@@ -365,12 +365,17 @@ read_build_root_setting()
365 365
    name="$1"
366 366
    default="$2"
367 367
 
368
+   local value
369
+   local rval
370
+
371
+   rval=1
368 372
    if [ "${READ_SETTING_RETURNS_PATH}" != "YES" ]
369 373
    then
370 374
       value="`_read_bootstrap_setting "settings/${name}.${UNAME}"`"
375
+      rval=$?
371 376
    fi
372 377
 
373
-   if [ $? -ne 0 ]
378
+   if [ $rval -ne 0 ]
374 379
    then
375 380
       value="`_read_bootstrap_setting "settings/${name}"`"
376 381
       if [ $? -ne 0 ]
... ...
@@ -411,17 +416,20 @@ read_build_setting()
411 416
    default="$3"
412 417
 
413 418
    local value
419
+   local rval
414 420
 
421
+   rval=1
415 422
    if [ "${READ_SETTING_RETURNS_PATH}" != "YES" ]
416
-   then 
423
+   then
417 424
       value="`_read_bootstrap_setting "settings/${package}/${name}.${UNAME}"`"
418 425
       if [ $? -ne 0 ]
419 426
       then
420 427
          value="`_read_bootstrap_setting "settings/${name}.${UNAME}"`"
428
+         rval=$?
421 429
       fi
422 430
    fi
423 431
 
424
-   if [ $? -ne 0 ]
432
+   if [ $rval -ne 0 ]
425 433
    then
426 434
       value="`_read_bootstrap_setting "settings/${package}/${name}"`"
427 435
       if [ $? -ne 0 ]
... ...
@@ -453,19 +461,23 @@ read_fetch_setting()
453 461
       set +x
454 462
    fi
455 463
 
456
-   local value
457 464
    local default
458 465
    local name
459 466
 
460 467
    name="$1"
461 468
    default="$2"
462 469
 
470
+   local value
471
+   local rval
472
+
473
+   rval=1
463 474
    if [ "${READ_SETTING_RETURNS_PATH}" != "YES" ]
464
-   then 
475
+   then
465 476
       value="`_read_bootstrap_setting "${name}.${UNAME}"`"
477
+      rval=$?
466 478
    fi
467 479
 
468
-   if [ $? -ne 0 ]
480
+   if [ $rval -ne 0 ]
469 481
    then
470 482
       value="`_read_bootstrap_setting "${name}"`"
471 483
       if [ $? -ne 0 ]
... ...
@@ -114,7 +114,7 @@ now."
114 114
 
115 115
 warn_scripts_main()
116 116
 {
117
-   log_fluff "::: warn_scripts :::"
117
+   log_fluff "::: warn_scripts begin :::"
118 118
 
119 119
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh && local_environment_initialize
120 120
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh && functions_initialize
... ...
@@ -126,4 +126,6 @@ warn_scripts_main()
126 126
    else
127 127
       log_verbose "Script checking by autoanswer YES disabled"
128 128
    fi
129
+
130
+   log_fluff "::: warn_scripts end :::"
129 131
 }