Browse code

Actually add show command to git (sigh). Fix script invocations. There are no pre-fetch and post-fetch scripts anymore. Pre-fetch was never useful. post-fetch can be dealt with in pre-build.sh. Fix script inheritance.

Nat! authored on 19-02-2017 16:55:02
Showing 11 changed files
... ...
@@ -163,7 +163,7 @@ Suggested resolution (in $owd):
163 163
     ${C_RESET_BOLD}mulle-bootstrap${C_ERROR}
164 164
 
165 165
 Or do you feel lucky ? Then try again with
166
-   ${C_RESET_BOLD}mulle-bootstrap -f${C_ERROR}
166
+   ${C_RESET_BOLD}mulle-bootstrap -f ${MULLE_BOOTSTRAP_ARGUMENTS}${C_ERROR}
167 167
 But you've gotta ask yourself one question: Do I feel lucky ?
168 168
 Well, do ya, punk?"
169 169
       exit 1
... ...
@@ -223,7 +223,7 @@ _bootstrap_main()
223 223
 
224 224
    warn_scripts_main "${BOOTSTRAP_DIR}" || exit 1
225 225
 
226
-   if [ "${MULLE_FLAG_DIRTY_HARRY}" = "NO" ] || fetch_needed
226
+   if fetch_needed
227 227
    then
228 228
       MULLE_EXECUTABLE_FAIL_PREFIX="mulle-bootstrap fetch"
229 229
       fetch_main "$@" || exit 1
... ...
@@ -627,6 +627,12 @@ bootstrap_main()
627 627
    #
628 628
    command=${1:-"bootstrap"}
629 629
 
630
+   if [ "${MULLE_FLAG_DIRTY_HARRY}" = "YES" ]
631
+   then
632
+      set_fetch_needed
633
+      set_build_needed
634
+   fi
635
+
630 636
    if ! is_bootstrap_project
631 637
    then
632 638
       case "$1" in
... ...
@@ -56,6 +56,7 @@ _bootstrap_auto_copy()
56 56
    #
57 57
    tmpdir="`mktemp -d /tmp/mulle-bootstrap.XXXXXXXX`"
58 58
    inherit_files "${tmpdir}" "${src}"
59
+   inherit_scripts "${tmpdir}" "${src}"
59 60
 
60 61
    [ -z "${DEFAULT_IFS}" ] && internal_fail "IFS fail"
61 62
    IFS="
... ...
@@ -85,6 +86,13 @@ _bootstrap_auto_copy()
85 86
             fi
86 87
          ;;
87 88
 
89
+         bin)
90
+            if [ -d "${filepath}" ]
91
+            then
92
+               exekutor cp -Ran ${COPYMOVEFLAGS} "${filepath}" "${dstfilepath}" >&2
93
+            fi
94
+         ;;
95
+
88 96
          repositories)
89 97
             _bootstrap_merge_repository_files "${filepath}" "${dstfilepath}" "NO"
90 98
          ;;
... ...
@@ -165,13 +173,17 @@ _bootstrap_auto_create()
165 173
 
166 174
 bootstrap_auto_create()
167 175
 {
168
-   log_debug "bootstrap_auto_create"
176
+   log_debug ":bootstrap_auto_create begin:"
169 177
 
170 178
    _bootstrap_auto_create "${BOOTSTRAP_DIR}.auto" "${BOOTSTRAP_DIR}"
171
-}
172 179
 
180
+   log_debug ":bootstrap_auto_create end:"
181
+}
173 182
 
174 183
 
184
+##
185
+## bootstrap_auto_update
186
+##
175 187
 _bootstrap_merge_expanded_settings_in_front()
176 188
 {
177 189
    local addition="$1"
... ...
@@ -192,64 +204,6 @@ _bootstrap_merge_expanded_settings_in_front()
192 204
 }
193 205
 
194 206
 
195
-#
196
-# read repository file, properly do expansions
197
-# replace branch with override if needed
198
-#
199
-_bootstrap_read_repository_file()
200
-{
201
-   local srcfile="$1"
202
-   local delete_dstdir="$2"
203
-
204
-   local srcbootstrap
205
-   local clones
206
-
207
-   srcbootstrap="`dirname -- "${srcfile}"`"
208
-   clones="`read_expanded_setting "$srcfile" "" "${srcbootstrap}"`"
209
-
210
-   local url        # url of clone
211
-   local dstdir
212
-   local branch
213
-   local scm
214
-   local tag
215
-
216
-   IFS="
217
-"
218
-   for clone in ${clones}
219
-   do
220
-      IFS="${DEFAULT_IFS}"
221
-
222
-      parse_raw_clone "${clone}"
223
-
224
-      case "${url}" in
225
-         */\.\./*|\.\./*|*/\.\.|\.\.)
226
-            fail "Relative urls like \"${url}\" don't work (anymore).\nTry \"-y fetch --no-symlink-creation\" instead"
227
-         ;;
228
-      esac
229
-
230
-      case "${scm}" in
231
-         symlink)
232
-            fail "You can't specify symlink in the repositories file yourself. Use -y flag"
233
-         ;;
234
-      esac
235
-
236
-      branch="${OVERRIDE_BRANCH:-${branch}}"
237
-      branch="${branch:-master}"
238
-
239
-      if [ "${delete_dstdir}" = "YES" ]
240
-      then
241
-         dstdir=""
242
-      fi
243
-
244
-      dstdir="`computed_stashdir "${url}" "${name}" "${dstdir}"`"
245
-      scm="${scm:-git}"
246
-
247
-      echo "${url};${dstdir};${branch};${scm};${tag}"
248
-   done
249
-
250
-   IFS="${DEFAULT_IFS}"
251
-}
252
-
253 207
 
254 208
 _bootstrap_merge_repository_files()
255 209
 {
... ...
@@ -263,7 +217,7 @@ _bootstrap_merge_repository_files()
263 217
    local additions
264 218
 
265 219
    contents="`cat "${dstfile}" 2> /dev/null || :`"
266
-   additions="`_bootstrap_read_repository_file "${srcfile}" "${delete_dstdir}"`" || fail "read"
220
+   additions="`read_repository_file "${srcfile}" "${delete_dstdir}"`" || fail "read"
267 221
    additions="`echo "${additions}"| sed 's/;*$//'`"
268 222
    additions="`merge_repository_contents "${contents}" "${additions}"`"
269 223
 
... ...
@@ -315,32 +269,16 @@ _bootstrap_auto_merge_root_settings()
315 269
       # "repositories" files gets special treatment
316 270
       # "embedded_repositories" is not merged though
317 271
       case "${settingname}" in
318
-            "repositories")
319
-               _bootstrap_merge_repository_files "${srcfile}" "${dstfile}" "YES"
272
+         "embedded_repositories")
273
+            continue  # done by caller
274
+         ;;
275
+
276
+         "repositories")
277
+            _bootstrap_merge_repository_files "${srcfile}" "${dstfile}" "YES"
320 278
             continue
321
-            ;;
279
+         ;;
322 280
       esac
323 281
 
324
-      # #
325
-      # # non mergable settings are not merged
326
-      # #
327
-      # match="`echo "${NON_MERGABLE_SETTINGS}" | fgrep -s -x "${settingname}"`"
328
-      # if [ ! -z "${match}" ]
329
-      # then
330
-      #    log_fluff "Setting \"${settingname}\" is not mergable, so ignored"
331
-      #    continue
332
-      # fi
333
-
334
-      # #
335
-      # # environment is not copied over
336
-      # #
337
-      # match="`egrep -s -x "^[A-Z_]+$" <<< "${settingname}"`"
338
-      # if [ ! -z "${match}" ]
339
-      # then
340
-      #    log_fluff "Setting \"${settingname}\" is environment, so ignored"
341
-      #    continue
342
-      # fi
343
-
344 282
       match="`echo "${MERGABLE_SETTINGS}" | fgrep -s -x "${settingname}"`"
345 283
       if [ -z "${match}" ]
346 284
       then
... ...
@@ -410,12 +348,18 @@ bootstrap_auto_update()
410 348
    then
411 349
       _bootstrap_auto_merge_root_settings "${BOOTSTRAP_DIR}.auto" "${stashdir}"
412 350
 
413
-      local srcfile
351
+      local src
352
+
353
+      src="${stashdir}/${BOOTSTRAP_DIR}/embedded_repositories"
354
+      if [ -f "${src}" ]
355
+      then
356
+         _bootstrap_auto_embedded_copy "${name}" "${stashdir}" "${src}"
357
+      fi
414 358
 
415
-      srcfile="${stashdir}/${BOOTSTRAP_DIR}/embedded_repositories"
416
-      if [ -f "${srcfile}" ]
359
+      src="${stashdir}/${BOOTSTRAP_DIR}/bin"
360
+      if [ -d "${src}" ]
417 361
       then
418
-         _bootstrap_auto_embedded_copy "${name}" "${stashdir}" "${srcfile}"
362
+         inherit_scripts "${BOOTSTRAP_DIR}.auto/${name}.build/bin" "${src}"
419 363
       fi
420 364
    else
421 365
       # could be helpful to user
... ...
@@ -429,8 +373,14 @@ bootstrap_auto_update()
429 373
 }
430 374
 
431 375
 
432
-bootstrap_create_build_folders()
376
+##
377
+## bootstrap_auto_final
378
+##
379
+_bootstrap_create_build_folders()
433 380
 {
381
+   local clonenames="$1"
382
+   local reposdir="$2"
383
+
434 384
    #
435 385
    # now pick up on build order and produce .build folders
436 386
    # but build order could be "hand coded", lets use it
... ...
@@ -449,7 +399,6 @@ bootstrap_create_build_folders()
449 399
    [ -d "${BOOTSTRAP_DIR}.auto/overrides" ]
450 400
    has_overrides=$?
451 401
 
452
-   clonenames="`read_root_setting "build_order"`"
453 402
    revclonenames="`echo "${clonenames}" | sed '1!G;h;$!d'`"  # reverse lines
454 403
 
455 404
    local tmp
... ...
@@ -471,7 +420,7 @@ bootstrap_create_build_folders()
471 420
    do
472 421
       IFS="${DEFAULT_IFS}"
473 422
 
474
-      apath="`stash_of_repository "${REPOS_DIR}" "${revname}"`/.bootstrap"
423
+      apath="`stash_of_repository "${reposdir}" "${revname}"`/.bootstrap"
475 424
       if [ -d "${apath}" ]
476 425
       then
477 426
          revclonenames="`add_line "${revclonenames}" "${revname}"`"
... ...
@@ -488,6 +437,7 @@ bootstrap_create_build_folders()
488 437
       if [ ${has_settings} -eq 0 ]
489 438
       then
490 439
          inherit_files "${dstdir}" "${BOOTSTRAP_DIR}.auto/settings"
440
+         inherit_scripts "${dstdir}" "${BOOTSTRAP_DIR}.auto/settings"
491 441
       fi
492 442
 
493 443
       if [ "`read_build_setting "${name}" "final" "NO"`" = "YES" ]
... ...
@@ -501,11 +451,12 @@ bootstrap_create_build_folders()
501 451
       do
502 452
          IFS="${DEFAULT_IFS}"
503 453
 
504
-         srcdir="`stash_of_repository "${REPOS_DIR}" "${revname}"`/.bootstrap/${name}.build"
454
+         srcdir="`stash_of_repository "${reposdir}" "${revname}"`/.bootstrap/${name}.build"
505 455
 
506 456
          if [ -d "${srcdir}" ]
507 457
          then
508 458
             inherit_files "${dstdir}" "${srcdir}"
459
+            inherit_scripts "${dstdir}" "${srcdir}"
509 460
             if [ "`read_build_setting "${name}" "final" "NO"`" = "YES" ]
510 461
             then
511 462
                break
... ...
@@ -516,12 +467,12 @@ bootstrap_create_build_folders()
516 467
          then
517 468
             break
518 469
          fi
519
-
520 470
       done
521 471
 
522 472
       if [ ${has_overrides} -eq 0 ]
523 473
       then
524 474
          override_files "${dstdir}" "${BOOTSTRAP_DIR}.auto/overrides"
475
+         override_scripts "${dstdir}" "${BOOTSTRAP_DIR}.auto/overrides"
525 476
       fi
526 477
    done
527 478
 
... ...
@@ -539,11 +490,7 @@ bootstrap_auto_final()
539 490
 
540 491
    log_fluff "Creating ${C_MAGENTA}${C_BOLD}build_order${C_VERBOSE} from repositories"
541 492
 
542
-   if [ -f "${BOOTSTRAP_DIR}.auto/build_order" ]
543
-   then
544
-      log_fluff "build_order already exists"
545
-      return
546
-   fi
493
+   [ -f "${BOOTSTRAP_DIR}.auto/build_order" ] && internal_fail "build_order already exists"
547 494
 
548 495
    #
549 496
    # add stuff from bootstrap folder
... ...
@@ -582,7 +529,10 @@ bootstrap_auto_final()
582 529
 
583 530
    redirect_exekutor "${BOOTSTRAP_DIR}.auto/build_order" echo "${order}"
584 531
 
585
-   bootstrap_create_build_folders
532
+   local clonenames
533
+
534
+   clonenames="`read_root_setting "build_order"`"
535
+   _bootstrap_create_build_folders "${clonenames}" "${REPOS_DIR}"
586 536
 }
587 537
 
588 538
 
... ...
@@ -1845,17 +1845,6 @@ build_with_configuration_sdk_preferences()
1845 1845
       rmdir_safer "${builddir}"
1846 1846
    fi
1847 1847
 
1848
-   #
1849
-   # execute pre-build script (f.e. for libcurl)
1850
-   #
1851
-   local script
1852
-
1853
-   script="`find_build_setting_file "${name}" "bin/pre-build.sh"`"
1854
-   if [ -x "${script}" ]
1855
-   then
1856
-      build_script "${script}" "${configuration}" "${srcdir}" "${builddir}" "${name}" "${sdk}" || exit 1
1857
-   fi
1858
-
1859 1848
    local project
1860 1849
 
1861 1850
    for preference in ${preferences}
... ...
@@ -2310,15 +2299,9 @@ build_main()
2310 2299
    #
2311 2300
    # START
2312 2301
    #
2313
-   if [ ! -d "${REPOS_DIR}" ]
2314
-   then
2315
-      log_info "No repositories fetched, so nothing to build."
2316
-      return 0
2317
-   fi
2318
-
2319 2302
    if [ ! -f "${BOOTSTRAP_DIR}.auto/build_order" ]
2320 2303
    then
2321
-      log_error "No ${C_MAGENTA}${C_BOLD}build_order${C_ERROR} found. You need to install first."
2304
+      log_info "No repositories fetched, so nothing to build."
2322 2305
       return 1
2323 2306
    fi
2324 2307
 
... ...
@@ -59,8 +59,14 @@ ${STASHES_DEFAULT_DIR}
59 59
 }
60 60
 
61 61
 
62
-_clean_usage()
62
+clean_usage()
63 63
 {
64
+   cat <<EOF >&2
65
+usage:
66
+   mulle-bootstrap clean [build|dist|install|output]
67
+
68
+EOF
69
+
64 70
    setup_clean_environment
65 71
 
66 72
    cat <<EOF >&2
... ...
@@ -90,17 +96,7 @@ ${OUTPUT_CLEANABLE_SUBDIRS}
90 96
 ${DIST_CLEANABLE_SUBDIRS}
91 97
 ---
92 98
 EOF
93
-}
94 99
 
95
-
96
-clean_usage()
97
-{
98
-   cat <<EOF >&2
99
-usage:
100
-   mulle-bootstrap clean [build|dist|install|output]
101
-
102
-EOF
103
-   _clean_usage
104 100
    exit 1
105 101
 }
106 102
 
... ...
@@ -213,7 +209,7 @@ clean_directories()
213 209
 
214 210
 
215 211
 
216
-_print_stashdir()
212
+_collect_stashdir()
217 213
 {
218 214
    # local reposdir="$1"  # ususally .bootstrap.repos
219 215
    # local name="$2"      # name of the clone
... ...
@@ -223,20 +219,22 @@ _print_stashdir()
223 219
    # local tag="$6"       # tag to checkout of the clone
224 220
    local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
225 221
 
222
+   is_minion_bootstrap_project "${stashdir}" && return
223
+
226 224
    local stashparentdir
227 225
 
228 226
    stashparentdir="`dirname -- "${stashdir}"`"
229
-   if [ "${stashparentdir}" != "${STASHES_DEFAULT_DIR}" ]
230
-   then
231
-      echo "${stashdir}"
232
-   fi
227
+
228
+   [ "${stashparentdir}" = "${STASHES_DEFAULT_DIR}" ] && return
229
+
230
+   echo "${stashdir}"
233 231
 }
234 232
 
235 233
 
236 234
 print_stashdir_repositories()
237 235
 {
238 236
    walk_repositories "repositories" \
239
-                     "_print_stashdir" \
237
+                     "_collect_stashdir" \
240 238
                      "" \
241 239
                      "${REPOS_DIR}"
242 240
 }
... ...
@@ -245,7 +243,7 @@ print_stashdir_repositories()
245 243
 print_stashdir_embedded_repositories()
246 244
 {
247 245
    walk_repositories "embedded_repositories" \
248
-                     "_print_stashdir" \
246
+                     "_collect_stashdir" \
249 247
                      "" \
250 248
                      "${EMBEDDED_REPOS_DIR}"
251 249
 }
... ...
@@ -269,6 +267,8 @@ ${BOOTSTRAP_DIR}.auto"`"
269 267
    then
270 268
       DIST_CLEANABLE_SUBDIRS="`add_line "${DIST_CLEANABLE_SUBDIRS}" ".repos"`"
271 269
    else
270
+      [ -z "${MULLE_BOOTSTRAP_REPOSITORIES_SH}" ] && . mulle-bootstrap-repositories.sh
271
+
272 272
       #
273 273
       # as a master we don't throw the minions out
274 274
       #
... ...
@@ -299,6 +299,8 @@ ${BOOTSTRAP_DIR}.auto"`"
299 299
 #
300 300
 _clean_execute()
301 301
 {
302
+   local style="$1"
303
+
302 304
    local flag
303 305
 
304 306
    [ -z "${DEPENDENCIES_DIR}"  ]   && internal_fail "DEPENDENCIES_DIR is empty"
... ...
@@ -310,7 +312,7 @@ _clean_execute()
310 312
    CLEAN_EMPTY_PARENTS="`read_config_setting "clean_empty_parent_folders" "YES"`"
311 313
 
312 314
 
313
-   case "${COMMAND}" in
315
+   case "${style}" in
314 316
       build)
315 317
          BUILD_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "clean_folders" "${CLONESBUILD_SUBDIR}
316 318
 ${DEPENDENCIES_DIR}/tmp"`"
... ...
@@ -327,9 +329,13 @@ ${DEPENDENCIES_DIR}/tmp"`"
327 329
          flag="`clean_directories "${BUILD_CLEANABLE_SUBDIRS}" "${flag}"`"
328 330
          clean_files "${BUILD_CLEANABLE_FILES}"
329 331
       ;;
332
+
333
+      *)
334
+         internal_fail "Unknown clean style \"${style}\""
335
+      ;;
330 336
    esac
331 337
 
332
-   case "${COMMAND}" in
338
+   case "${style}" in
333 339
       output)
334 340
          OUTPUT_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "output_clean_folders" "${DEPENDENCIES_DIR}"`"
335 341
          clean_directories "${OUTPUT_CLEANABLE_SUBDIRS}" "${flag}"
... ...
@@ -344,7 +350,7 @@ ${DEPENDENCIES_DIR}/tmp"`"
344 350
       ;;
345 351
    esac
346 352
 
347
-   case "${COMMAND}" in
353
+   case "${style}" in
348 354
       install)
349 355
          INSTALL_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "install_clean_folders" "${REPOS_DIR}
350 356
 .bootstrap.auto"`"
... ...
@@ -354,7 +360,7 @@ ${DEPENDENCIES_DIR}/tmp"`"
354 360
       ;;
355 361
    esac
356 362
 
357
-   case "${COMMAND}" in
363
+   case "${style}" in
358 364
       dist)
359 365
          _dist_clean
360 366
       ;;
... ...
@@ -383,26 +389,23 @@ clean_main()
383 389
 {
384 390
    log_debug "::: clean :::"
385 391
 
386
-   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
392
+   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]        && . mulle-bootstrap-settings.sh
387 393
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
388
-   [ -z "${MULLE_BOOTSTRAP_REPOSITORIES_SH}" ] && . mulle-bootstrap-repositories.sh
389 394
 
390 395
    [ -z "${DEFAULT_IFS}" ] && internal_fail "IFS fail"
391 396
 
392 397
    build_complete_environment
393 398
 
394
-   COMMAND=
395
-
396 399
    while [ $# -ne 0 ]
397 400
    do
398 401
       case "$1" in
399 402
          -h|-help|--help)
400
-            COMMAND=help
403
+            clean_usage
401 404
          ;;
402 405
 
403 406
          -*)
404 407
             log_error "${MULLE_EXECUTABLE_FAIL_PREFIX}: Unknown clean option $1"
405
-            COMMAND=help
408
+            clean_usage
406 409
          ;;
407 410
 
408 411
          *)
... ...
@@ -413,28 +416,21 @@ clean_main()
413 416
       shift
414 417
    done
415 418
 
416
-   if [ -z "${COMMAND}" ]
417
-   then
418
-      COMMAND=${1:-"output"}
419
-      [ $# -eq 0 ] || shift
420
-   fi
419
+   local style
421 420
 
421
+   style=${1:-"output"}
422 422
 
423
-   case "$COMMAND" in
423
+   case "$1" in
424 424
       output|dist|build|install)
425
-         clean_execute "$@"
425
+         clean_execute "${style}"
426 426
       ;;
427 427
 
428 428
       help)
429 429
          clean_usage
430 430
       ;;
431 431
 
432
-      _help)
433
-         _clean_usage
434
-      ;;
435
-
436 432
       *)
437
-         log_error "Unknown command \"${COMMAND}\""
433
+         log_error "Unknown clean style \"${style}\""
438 434
          clean_usage
439 435
       ;;
440 436
    esac
... ...
@@ -57,15 +57,58 @@ tar_remove_extension()
57 57
 # dstdir need not exist
58 58
 # srcdir must exist
59 59
 # ext can be empty
60
-# noclobber can be empty or YES
60
+# noclobber can be empty=NO,NO or YES
61 61
 #
62
+_archive_files()
63
+{
64
+   local srcdir="$1"
65
+   local ext="$2"
66
+
67
+   (
68
+      exekutor cd "${srcdir}" ;
69
+      if [ -z "${ext}" ]
70
+      then
71
+         exekutor find . \( -type f -a ! -name "*.*" \) -print
72
+      else
73
+         exekutor find . \( -type f -a -name "*.${ext}" \) -print
74
+      fi |
75
+         exekutor tar -c ${taroptions} -f - -T -
76
+   ) || exit 1
77
+}
78
+
79
+
80
+_filter_boring_tar_output()
81
+{
82
+   egrep -v 'Already exist|Error exit delayed'
83
+   :
84
+}
85
+
86
+
87
+_unarchive_files()
88
+{
89
+   local dstdir="$1"
90
+   local noclobber="$2"
91
+
92
+   (
93
+      exekutor cd "${dstdir}" ;
94
+      if [ "${noclobber}" = "NO" ]
95
+      then
96
+         exekutor tar -x ${TARFLAGS} -f -
97
+      else
98
+         exekutor tar -x ${TARFLAGS} -k -f -
99
+         :
100
+      fi 2>&1 | _filter_boring_tar_output
101
+   ) >&2 # 2> /dev/null   #intentional order
102
+}
103
+
104
+
62 105
 _copy_files()
63 106
 {
64 107
    local taroptions="$1" ; shift
65 108
    local dstdir="$1" ; shift
66 109
    local srcdir="$1" ; shift
67 110
    local ext="$1" ; shift
68
-   local noclobber="$1" ; shift
111
+   local noclobber="${1:-YES}" ; shift
69 112
 
70 113
    [ -d "${srcdir}" ] || internal_fail "${srcdir} does not exist"
71 114
    [ -d "${dstdir}" ] || internal_fail "${dstdir} does not exist"
... ...
@@ -80,26 +123,7 @@ _copy_files()
80 123
    #
81 124
    # copy over files only, let tar remove extension
82 125
    #
83
-   (
84
-      exekutor cd "${srcdir}" ;
85
-      if [ -z "${ext}" ]
86
-      then
87
-         exekutor find . \( -type f -a ! -name "*.*" \) -print
88
-      else
89
-         exekutor find . \( -type f -a -name "*.${ext}" \) -print
90
-      fi |
91
-         exekutor tar -c ${taroptions} -f - -T -
92
-   ) |
93
-   (
94
-      exekutor cd "${dstdir}" ;
95
-      if [ -z "${noclobber}" ]
96
-      then
97
-         exekutor tar -x ${TARFLAGS} -f - >&2 2> /dev/null #intentional order
98
-      else
99
-         exekutor tar -x ${TARFLAGS} -k -f - >&2 2> /dev/null
100
-         :
101
-      fi
102
-   )
126
+   _archive_files "${srcdir}" "${ext}" | _unarchive_files "${dstdir}" "${noclobber}"
103 127
 }
104 128
 
105 129
 
... ...
@@ -125,7 +149,10 @@ copy_files_keeping_extension()
125 149
 #
126 150
 inherit_files()
127 151
 {
128
-   local dstdir
152
+   local dstdir="$1"
153
+   # local srcdir="$2"
154
+   # local ext="$3"
155
+   # local noclobber="$4"
129 156
 
130 157
    dstdir="$1"
131 158
 
... ...
@@ -135,10 +162,29 @@ inherit_files()
135 162
 
136 163
    # prefer to copy os-specific first, "-k" won't overwrite
137 164
    copy_files_stripping_last_extension "$@" "${UNAME}" "YES" || fail "copy"
138
-   copy_files_stripping_last_extension "$@" "sh.${UNAME}" "YES" || fail "copy"
139 165
 
140 166
    # then to copy generic, again "-k" won't overwrite
141 167
    copy_files_keeping_extension "$@" "" "YES" || fail "copy"
168
+}
169
+
170
+
171
+inherit_scripts()
172
+{
173
+   local dstdir="$1"
174
+   # local srcdir="$2"
175
+   # local ext="$3"
176
+   # local noclobber="$4" default YES
177
+
178
+   dstdir="$1"
179
+
180
+   [ $# -eq 2 ] || internal_fail "parameter error"
181
+
182
+   mkdir_if_missing "${dstdir}"
183
+
184
+   # prefer to copy os-specific first, "-k" won't overwrite
185
+   copy_files_stripping_last_extension "$@" "sh.${UNAME}" "YES" || fail "copy"
186
+
187
+   # then to copy generic, again "-k" won't overwrite
142 188
    copy_files_keeping_extension "$@" "sh" "YES" || fail "copy"
143 189
 }
144 190
 
... ...
@@ -149,24 +195,41 @@ inherit_files()
149 195
 #
150 196
 override_files()
151 197
 {
152
-   local dstdir
198
+   local dstdir="$1"
199
+   local srcdir="$2"
200
+   local ext="$3"
201
+   # local noclobber="$4"
153 202
 
154
-   dstdir="$1"
203
+   [ $# -eq 2 ] || internal_fail "parameter error"
204
+
205
+   mkdir_if_missing "${dstdir}"
206
+
207
+   # first copy generic, clobber what's there
208
+   copy_files_keeping_extension "${dstdir}" "${srcdir}" "" "NO"      || fail "copy"
209
+
210
+   # then copy os-specific to clobber generics
211
+   copy_files_stripping_last_extension "${dstdir}" "${srcdir}" "${UNAME}" "NO" || fail "copy"
212
+}
213
+
214
+
215
+override_scripts()
216
+{
217
+   local dstdir="$1"
218
+   # local srcdir="$2"
219
+   # local ext="$3"
220
+   # local noclobber="$4"
155 221
 
156 222
    [ $# -eq 2 ] || internal_fail "parameter error"
157 223
 
158 224
    mkdir_if_missing "${dstdir}"
159 225
 
160 226
    # first copy generic, clobber what's there
161
-   copy_files_keeping_extension "$@"      || fail "copy"
162 227
    copy_files_keeping_extension "$@" "sh" || fail "copy"
163 228
 
164 229
    # then copy os-specific to clobber generics
165
-   copy_files_stripping_last_extension "$@" "${UNAME}" || fail "copy"
166 230
    copy_files_stripping_last_extension "$@" "sh.${UNAME}" || fail "copy"
167 231
 }
168 232
 
169
-
170 233
 # make sure functions are present
171 234
 
172 235
 copy_initialize()
... ...
@@ -129,6 +129,8 @@ defer_main()
129 129
    #
130 130
    # dist clean ourselves
131 131
    #
132
+   log_info "Cleaning minion before deferral"
133
+
132 134
    clean_execute "dist"
133 135
 
134 136
    master_add_minion_bootstrap_project "${masterpath}" "${minionpath}"
... ...
@@ -195,6 +197,10 @@ emancipate_main()
195 197
 
196 198
    log_info "Emancipating from \"${masterpath}\""
197 199
    master_remove_minion_bootstrap_project "${masterpath}" "${minionpath}"
200
+
201
+   log_info "Cleaning master before emancipation"
202
+   clean_execute "output"
203
+
198 204
    emancipate_minion_bootstrap_project "${minionpath}"
199 205
 
200 206
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
... ...
@@ -203,6 +209,7 @@ emancipate_main()
203 209
    #
204 210
    # dist clean ourselves
205 211
    #
212
+   log_info "Cleaning ex-minion after emancipation"
206 213
    clean_execute "dist"
207 214
 }
208 215
 
... ...
@@ -458,7 +458,12 @@ clone_or_symlink()
458 458
                   "${tag}" \
459 459
                   "${stashdir}"
460 460
 
461
-   warn_scripts_main "${stashdir}/.bootstrap" "${stashdir}" || fail "Ok, aborted"  #sic
461
+   if [ "${DONT_WARN_SCRIPTS}" != "YES" ]
462
+   then
463
+      [ -z "${MULLE_BOOTSTRAP_WARN_SCRIPTS_SH}" ] && . mulle-bootstrap-warn-scripts.sh
464
+
465
+      warn_scripts_main "${stashdir}/.bootstrap" "${stashdir}" || fail "Ok, aborted"  #sic
466
+   fi
462 467
 
463 468
    if [ "${operation}" = "link_command" ]
464 469
    then
... ...
@@ -471,7 +476,7 @@ clone_or_symlink()
471 476
 ##
472 477
 ## CLONE
473 478
 ##
474
-_clone_repository()
479
+clone_repository()
475 480
 {
476 481
    local reposdir="$1"  # ususally .bootstrap.repos
477 482
    local name="$2"      # name of the clone
... ...
@@ -483,6 +488,8 @@ _clone_repository()
483 488
 
484 489
    [ $# -eq 7 ] || internal_fail "fail"
485 490
 
491
+   log_action "clone" "$@"
492
+
486 493
    assert_sane_parameters "empty is ok"
487 494
 
488 495
    if [ "${OPTION_CHECK_USR_LOCAL_INCLUDE}" = "YES" ] && has_usr_local_include "${name}"
... ...
@@ -514,18 +521,10 @@ Suggested fix:
514 521
 }
515 522
 
516 523
 
517
-clone_repository()
518
-{
519
-   log_action "clone" "$@"
520
-
521
-   _clone_repository "$@"   # pass thru rval
522
-}
523
-
524
-
525 524
 ##
526 525
 ## CHECKOUT
527 526
 ##
528
-_checkout_repository()
527
+checkout_repository()
529 528
 {
530 529
    local reposdir="$1"  # ususally .bootstrap.repos
531 530
    local name="$2"      # name of the clone
... ...
@@ -535,6 +534,8 @@ _checkout_repository()
535 534
    local tag="$6"       # tag to checkout of the clone
536 535
    local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
537 536
 
537
+   log_action "checkout" "$@"
538
+
538 539
    local operation
539 540
 
540 541
    case "${scm}" in
... ...
@@ -559,23 +560,11 @@ _checkout_repository()
559 560
 }
560 561
 
561 562
 
562
-checkout_repository()
563
-{
564
-   local url="$3"       # URL of the clone
565
-   local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
566
-
567
-   log_action "checkout" "$@"
568
-
569
-   _checkout_repository "$@"
570
-}
571
-
572
-
573 563
 ##
574 564
 ## UPDATE
575 565
 ## this like git fetch, does not update repository
576 566
 ##
577
-
578
-_update_repository()
567
+update_repository()
579 568
 {
580 569
    local reposdir="$1"  # ususally .bootstrap.repos
581 570
    local name="$2"      # name of the clone
... ...
@@ -585,6 +574,8 @@ _update_repository()
585 574
    local tag="$6"       # tag to checkout of the clone
586 575
    local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
587 576
 
577
+   log_action "update" "$@"
578
+
588 579
    local operation
589 580
 
590 581
    case "${scm}" in
... ...
@@ -609,21 +600,11 @@ _update_repository()
609 600
 }
610 601
 
611 602
 
612
-update_repository()
613
-{
614
-   log_action "update" "$@"
615
-
616
-   _update_repository "$@" > /dev/null
617
-
618
-   echo "${clone}"  # hackish
619
-}
620
-
621
-
622 603
 ##
623 604
 ## UPGRADE
624 605
 ## This is a pull
625 606
 
626
-_upgrade_repository()
607
+upgrade_repository()
627 608
 {
628 609
    local reposdir="$1"  # ususally .bootstrap.repos
629 610
    local name="$2"      # name of the clone
... ...
@@ -633,6 +614,8 @@ _upgrade_repository()
633 614
    local tag="$6"       # tag to checkout of the clone
634 615
    local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
635 616
 
617
+   log_action "upgrade" "$@"
618
+
636 619
    local operation
637 620
 
638 621
    case "${scm}" in
... ...
@@ -657,16 +640,6 @@ _upgrade_repository()
657 640
 }
658 641
 
659 642
 
660
-upgrade_repository()
661
-{
662
-   log_action "upgrade" "$@"
663
-
664
-   _upgrade_repository "$@" > /dev/null
665
-
666
-   echo "${clone}"  # hackish
667
-}
668
-
669
-
670 643
 #
671 644
 # Walk repositories with a callback function
672 645
 #
... ...
@@ -740,34 +713,6 @@ _update_operation_walk_deep_embedded_repositories()
740 713
 }
741 714
 
742 715
 
743
-##
744
-## FETCH
745
-##
746
-
747
-did_fetch_repository()
748
-{
749
-#   local reposdir="$1"  # ususally .bootstrap.repos
750
-   local name="$2"      # name of the clone
751
-#   local url="$3"       # URL of the clone
752
-#   local branch="$4"    # branch of the clone
753
-#   local scm="$5"       # scm to use for this clone
754
-#   local tag="$6"       # tag to checkout of the clone
755
-#   local stashdir="$7"  # stashdir of this clone (absolute or relative to $PWD)
756
-
757
-   fetch__run_build_settings_script "post-fetch" "${name}" "$@"
758
-}
759
-
760
-
761
-did_fetch_repositories()
762
-{
763
-   walk_clones "$*" "did_fetch_repository" "${REPOS_DIR}"
764
-}
765
-
766
-did_fetch_embedded_repositories()
767
-{
768
-   walk_clones "$*" "did_fetch_repository" "${REPOS_DIR}"
769
-}
770
-
771 716
 ##
772 717
 ## UPDATE
773 718
 ##
... ...
@@ -810,26 +755,10 @@ upgrade_deep_embedded_repositories()
810 755
 }
811 756
 
812 757
 
813
-did_upgrade_repository()
814
-{
815
-   local name="$2"      # name of the clone
816
-
817
-   fetch__run_build_settings_script "post-fetch" "${name}" "$@"
818
-}
819
-
820
-
821
-did_upgrade_repositories()
822
-{
823
-   local clones="$1"
824
-
825
-   walk_clones "${clones}" "did_upgrade_repository" "${REPOS_DIR}"
826
-}
827
-
828 758
 
829 759
 ##
830 760
 ##
831 761
 ##
832
-
833 762
 required_action_for_clone()
834 763
 {
835 764
    local newclone="$1" ; shift
... ...
@@ -918,12 +847,15 @@ clone"
918 847
       local oldstashdir
919 848
 
920 849
       oldstashdir="`get_old_stashdir "${reposdir}" "${name}"`"
921
-      if [ -d "${oldstashdir}" ]
850
+      if [ "${oldstashdir}" != "${newstashdir}" ]
922 851
       then
923
-         echo "move ${oldstashdir}"
924
-      else
925
-         log_warning "Can't find ${name} in ${oldstashdir}. Will clone again"
926
-         echo "clone"
852
+         if [ -d "${oldstashdir}" ]
853
+         then
854
+            echo "move ${oldstashdir}"
855
+         else
856
+            log_warning "Can't find ${name} in ${oldstashdir}. Will clone again"
857
+            echo "clone"
858
+         fi
927 859
       fi
928 860
    fi
929 861
 
... ...
@@ -998,11 +930,9 @@ work_clones()
998 930
    local dstdir
999 931
 
1000 932
    local actionitems
1001
-   local fetched
1002 933
    local remember
1003 934
    local repotype
1004 935
    local oldstashdir
1005
-   local did_fetch
1006 936
 
1007 937
    case "${reposdir}" in
1008 938
       *embedded)
... ...
@@ -1057,8 +987,6 @@ work_clones()
1057 987
 
1058 988
       log_debug "${C_INFO}Actions for \"${name}\": ${actionitems:-none}"
1059 989
 
1060
-      did_fetch="NO"
1061
-
1062 990
       IFS="
1063 991
 "
1064 992
       for item in ${actionitems}
... ...
@@ -1097,7 +1025,6 @@ work_clones()
1097 1025
                      scm="symlink"
1098 1026
                   ;;
1099 1027
                esac
1100
-               did_fetch="YES"
1101 1028
             ;;
1102 1029
 
1103 1030
             "ignore")
... ...
@@ -1169,11 +1096,6 @@ work_clones()
1169 1096
       # create clone as it is now
1170 1097
       clone="`echo "${url};${dstdir};${branch};${scm};${tag}" | sed 's/;*$//'`"
1171 1098
 
1172
-      if [ "${did_fetch}" = "YES" ]
1173
-      then
1174
-         fetched="`add_line "${fetched}" "${url};${stashdir};${branch};${scm};${tag}"`"
1175
-      fi
1176
-
1177 1099
       #
1178 1100
       # always remember, what we have now (except if its a minion)
1179 1101
       #
... ...
@@ -1192,11 +1114,6 @@ work_clones()
1192 1114
    done
1193 1115
 
1194 1116
    IFS="${DEFAULT_IFS}"
1195
-
1196
-   if [ ! -z "${fetched}" ]
1197
-   then
1198
-      echo "${fetched}"
1199
-   fi
1200 1117
 }
1201 1118
 
1202 1119
 #
... ...
@@ -1215,7 +1132,7 @@ fetch_once_embedded_repositories()
1215 1132
 
1216 1133
       clones="`read_root_setting "embedded_repositories"`" ;
1217 1134
       work_clones "${EMBEDDED_REPOS_DIR}" "${clones}" "NO"
1218
-   ) || exit 1
1135
+   ) > /dev/null || exit 1
1219 1136
 }
1220 1137
 
1221 1138
 
... ...
@@ -1235,6 +1152,7 @@ _fetch_once_deep_repository()
1235 1152
 
1236 1153
    if [ ! -d "${autodir}" ]
1237 1154
    then
1155
+      log_fluff "${autodir} not present, so done"
1238 1156
       return
1239 1157
    fi
1240 1158
 
... ...
@@ -1268,16 +1186,13 @@ fetch_once_deep_embedded_repositories()
1268 1186
    walk_repositories "repositories"  \
1269 1187
                      "_fetch_once_deep_repository" \
1270 1188
                      "${permissions}" \
1271
-                     "${REPOS_DIR}"
1189
+                     "${REPOS_DIR}" > /dev/null
1272 1190
 }
1273 1191
 
1274 1192
 
1275 1193
 fetch_loop_repositories()
1276 1194
 {
1277
-   local fetched
1278
-   local all_fetched
1279 1195
    local loops
1280
-
1281 1196
    local before
1282 1197
    local after
1283 1198
 
... ...
@@ -1305,22 +1220,18 @@ fetch_loop_repositories()
1305 1220
          break
1306 1221
       fi
1307 1222
 
1223
+      if [ -z "${__IGNORE__}" ]
1224
+      then
1225
+         log_fluff "Get back in the ring to take another swing"
1226
+      fi
1227
+
1308 1228
       __REFRESHED__=""
1309 1229
 
1310
-      fetched="`work_clones "${REPOS_DIR}" "${before}" "YES"`" || exit 1
1311
-      all_fetched="`add_line "${all_fetched}" "${fetched}"`"
1230
+      work_clones "${REPOS_DIR}" "${before}" "YES" > /dev/null
1312 1231
 
1313 1232
       __IGNORE__="`add_line "${__IGNORE__}" "${__REFRESHED__}"`"
1314 1233
 
1315
-      log_fluff "Get back in the ring to take another swing"
1316 1234
    done
1317
-
1318
-   if [ ! -z "${fetched}" ]
1319
-   then
1320
-      echo "${fetched}"
1321
-   fi
1322
-
1323
-   :
1324 1235
 }
1325 1236
 
1326 1237
                       #----#
... ...
@@ -1353,39 +1264,11 @@ bury_zombies_in_graveyard()
1353 1264
 }
1354 1265
 
1355 1266
 
1356
-run_post_fetch_scripts()
1357
-{
1358
-   [ "${OPTION_EMBEDDED_ONLY}" = "YES" ] && return
1359
-
1360
-   did_fetch_repositories "$@"
1361
-   fetch__run_root_settings_script "post-fetch" "$@"
1362
-}
1363
-
1364
-
1365
-run_post_update_scripts()
1366
-{
1367
-   # makes no sense to me to run scripts here
1368
-   :
1369
-}
1370
-
1371
-
1372
-run_post_upgrade_scripts()
1373
-{
1374
-   [ "${OPTION_EMBEDDED_ONLY}" = "YES" ] && return
1375
-
1376
-   did_upgrade_repositories "$@"
1377
-   fetch__run_root_settings_script "post-fetch" "$@"
1378
-}
1379
-
1380
-
1381 1267
 #
1382 1268
 # the main fetch loop as documented somewhere with graphviz
1383 1269
 #
1384 1270
 fetch_loop()
1385 1271
 {
1386
-   local fetched
1387
-   local deep_fetched
1388
-
1389 1272
    unpostpone_trace
1390 1273
 
1391 1274
    # this is wrong, we just do "stashes" though
... ...
@@ -1393,23 +1276,18 @@ fetch_loop()
1393 1276
 
1394 1277
    bootstrap_auto_create
1395 1278
 
1396
-   fetched="`fetch_once_embedded_repositories`" || exit 1
1397
-   did_fetch_repositories "${fetched}"
1279
+   fetch_once_embedded_repositories
1398 1280
 
1399 1281
    if [ "${OPTION_EMBEDDED_ONLY}" = "NO" ]
1400 1282
    then
1401
-      fetched="`fetch_loop_repositories`" || exit 1
1402
-      did_fetch_repositories "${fetched}"
1283
+      fetch_loop_repositories
1403 1284
 
1404
-      fetched="`fetch_once_deep_embedded_repositories`" || exit 1
1405
-      did_fetch_repositories "${fetched}"
1285
+      fetch_once_deep_embedded_repositories || exit 1
1406 1286
    fi
1407 1287
 
1408 1288
    bootstrap_auto_final
1409 1289
 
1410 1290
    bury_zombies_in_graveyard
1411
-
1412
-   echo "${fetched}"
1413 1291
 }
1414 1292
 
1415 1293
 #
... ...
@@ -1417,9 +1295,8 @@ fetch_loop()
1417 1295
 #
1418 1296
 _common_fetch()
1419 1297
 {
1420
-   local fetched
1421 1298
 
1422
-   fetched="`fetch_loop "${REPOS_DIR}"`"
1299
+   fetch_loop "${REPOS_DIR}"
1423 1300
 
1424 1301
    #
1425 1302
    # do this afterwards, because brews will have been composited
... ...
@@ -1432,8 +1309,6 @@ _common_fetch()
1432 1309
    esac
1433 1310
 
1434 1311
    check_tars
1435
-
1436
-   run_post_fetch_scripts "${fetched}"
1437 1312
 }
1438 1313
 
1439 1314
 
... ...
@@ -1464,14 +1339,10 @@ _common_upgrade()
1464 1339
    upgrade_embedded_repositories
1465 1340
    [ "${OPTION_EMBEDDED_ONLY}" = "YES" ] && return
1466 1341
 
1467
-   local upgraded=""
1468
-
1469
-   upgraded="`upgrade_repositories "$@"`"
1342
+   upgrade_repositories "$@"
1470 1343
    upgrade_deep_embedded_repositories
1471 1344
 
1472 1345
    _common_fetch  # update what needs to be update
1473
-
1474
-   run_post_upgrade_scripts "${upgraded}"
1475 1346
 }
1476 1347
 
1477 1348
 
... ...
@@ -1488,10 +1359,18 @@ _common_main()
1488 1359
    local OPTION_ALLOW_SEARCH_CACHES="NO"
1489 1360
    local OPTION_EMBEDDED_ONLY="NO"
1490 1361
    local OVERRIDE_BRANCH
1362
+   local DONT_WARN_SCRIPTS="NO"
1491 1363
 
1492 1364
    OPTION_CHECK_USR_LOCAL_INCLUDE="`read_config_setting "check_usr_local_include" "NO"`"
1493 1365
    OVERRIDE_BRANCH="`read_config_setting "override_branch"`"
1494 1366
 
1367
+   DONT_WARN_SCRIPTS="`read_config_setting "dont_warn_scripts" "${MULLE_FLAG_ANSWER:-NO}"`"
1368
+
1369
+   if [ "${DONT_WARN_SCRIPTS}" = "YES" ]
1370
+   then
1371
+      log_verbose "Script checking disabled"
1372
+   fi
1373
+
1495 1374
    case "${UNAME}" in
1496 1375
       mingw)
1497 1376
          OPTION_ALLOW_CREATING_SYMLINKS="NO"
... ...
@@ -1596,7 +1475,6 @@ _common_main()
1596 1475
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
1597 1476
    [ -z "${MULLE_BOOTSTRAP_SCM_SH}" ]             && . mulle-bootstrap-scm.sh
1598 1477
    [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ]         && . mulle-bootstrap-scripts.sh
1599
-   [ -z "${MULLE_BOOTSTRAP_WARN_SCRIPTS_SH}" ]    && . mulle-bootstrap-warn-scripts.sh
1600 1478
    [ -z "${MULLE_BOOTSTRAP_ZOMBIFY_SH}" ]         && . mulle-bootstrap-zombify.sh
1601 1479
 
1602 1480
    #
... ...
@@ -1628,8 +1506,6 @@ _common_main()
1628 1506
    esac
1629 1507
 
1630 1508
    local default_permissions
1631
-   local fetched
1632
-   local upgraded
1633 1509
 
1634 1510
    #
1635 1511
    # possible values none|fetch|update|upgrade
... ...
@@ -1676,7 +1552,14 @@ _common_main()
1676 1552
    _common_fetch "$@"
1677 1553
 
1678 1554
    remove_file_if_present "${REPOS_DIR}/.bootstrap_fetch_started"
1679
-   create_file_if_missing "${REPOS_DIR}/.bootstrap_fetch_done"
1555
+
1556
+   #
1557
+   # only say we are done if a build_order was created
1558
+   #
1559
+   if [ -f "${BOOTSTRAP_DIR}.auto/build_order" ]
1560
+   then
1561
+      create_file_if_missing "${REPOS_DIR}/.bootstrap_fetch_done"
1562
+   fi
1680 1563
 
1681 1564
    if read_yes_no_config_setting "upgrade_gitignore" "YES"
1682 1565
    then
... ...
@@ -184,6 +184,12 @@ fetch_needed()
184 184
    [ -z "${REPOS_DIR}" ]     && internal_fail "REPOS_DIR undefined"
185 185
    [ -z "${BOOTSTRAP_DIR}" ] && internal_fail "BOOTSTRAP_DIR undefined"
186 186
 
187
+   if [ ! -f "${BOOTSTRAP_DIR}.local/build_order" ]
188
+   then
189
+      log_fluff "Need fetch because \"${BOOTSTRAP_DIR}.local/build_order\" does not exist."
190
+      return 0
191
+   fi
192
+
187 193
    if [ ! -f "${REPOS_DIR}/.bootstrap_fetch_done" ]
188 194
    then
189 195
       log_fluff "Need fetch because \"${REPOS_DIR}/.bootstrap_fetch_done\" does not exist."
... ...
@@ -205,6 +211,27 @@ fetch_needed()
205 211
    return 1
206 212
 }
207 213
 
214
+#
215
+# and clean up some other cruft
216
+#
217
+set_fetch_needed()
218
+{
219
+   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
220
+
221
+   remove_file_if_present "${BOOTSTRAP_DIR}.local/build_order"
222
+   remove_file_if_present "${BOOTSTRAP_DIR}.local/.bootstrap_fetch_started"
223
+   remove_file_if_present "${BOOTSTRAP_DIR}.local/.bootstrap_fetch_done"
224
+}
225
+
226
+
227
+set_build_needed()
228
+{
229
+   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
230
+
231
+   remove_file_if_present "${BOOTSTRAP_DIR}.local/.bootstrap_build_started"
232
+   remove_file_if_present "${BOOTSTRAP_DIR}.local/.bootstrap_build_done"
233
+}
234
+
208 235
 
209 236
 assert_mulle_bootstrap_version()
210 237
 {
... ...
@@ -308,93 +335,6 @@ expanded_variables()
308 335
 }
309 336
 
310 337
 
311
-# source_environment_file()
312
-# {
313
-#    local filename
314
-
315
-#    filename="$1"
316
-#    if [ ! -r "${filename}" ]
317
-#    then
318
-#       log_fluff "Environment file ${filename} not found"
319
-#       return 1
320
-#    fi
321
-
322
-#    local lines
323
-#    local line
324
-#    local key
325
-#    local value
326
-
327
-#    log_fluff "Environment file ${filename} exists"
328
-
329
-#    lines="`egrep -s -v '^#|^[ ]*$' "${filename}"`"
330
-#    IFS="
331
-# "
332
-#    for line in $lines
333
-#    do
334
-#       IFS="${DEFAULT_IFS}"
335
-
336
-#       key="`echo "${line}" | cut -d= -f1`"
337
-#       value="`echo "${line}" | cut -d= -f2`"
338
-
339
-#       value="`expanded_variables "${value}"`"
340
-#       case "${key}" in
341
-#          *\`*|*\$*|*\!*)
342
-#             fail "Illegal characters in $key of $filename"
343
-#          ;;
344
-#       esac
345
-#       case "${value}" in
346
-#          *\`*|*\$*|*\!*)
347
-#             fail "Illegal characters in $value of $filename"
348
-#          ;;
349
-#       esac
350
-#       log_verbose "Environment variable $key defined as $value"
351
-
352
-#       eval "${key}=${value}; export ${key}"
353
-#    done
354
-
355
-#    IFS="${DEFAULT_IFS}"
356
-
357
-#    return 0
358
-# }
359
-
360
-
361
-# #
362
-# # source environment
363
-# #
364
-# source_environment()
365
-# {
366
-#    local flag
367
-
368
-#    flag=""
369
-
370
-#    if source_environment_file "${HOME}/.mulle-bootstrap/environment"
371
-#    then
372
-#       flag="${MULLE_FLAG_LOG_FLUFF}"
373
-#    fi
374
-
375
-#    if source_environment_file "${BOOTSTRAP_DIR}.auto/environment"
376
-#    then
377
-#       flag="${MULLE_FLAG_LOG_FLUFF}"
378
-#    else
379
-#       if source_environment_file "${BOOTSTRAP_DIR}.local/environment"
380
-#       then
381
-#          flag="${MULLE_FLAG_LOG_FLUFF}"
382
-#       else
383
-#          if source_environment_file "${BOOTSTRAP_DIR}/environment"
384
-#          then
385
-#             flag="${MULLE_FLAG_LOG_FLUFF}"
386
-#          fi
387
-#       fi
388
-#    fi
389
-
390
-#    if [ "${flag}" = "YES" ]
391
-#    then
392
-#       log_fluff "Environment:"
393
-#       env >&2
394
-#    fi
395
-# }
396
-
397
-
398 338
 is_bootstrap_project()
399 339
 {
400 340
    local  masterpath="${1:-.}"
... ...
@@ -176,14 +176,18 @@ master_remove_minion_bootstrap_project()
176 176
    minionpath="`symlink_relpath "${minionpath}" "${masterpath}"`"
177 177
    unregex="`sed -e 's/[]\/()$*.^|[]/\\&/g' <<< "${minionpath}"`"
178 178
    filepath="${masterpath}/${BOOTSTRAP_DIR}.local/repositories"
179
-   exekutor sed -i "" -e "/^${unregex}\;/d" "${filepath}"
180 179
 
181
-   if [ -z "`read_setting "${filepath}"`" ]
180
+   if [ -f "${filepath}" ]
182 181
    then
183
-      remove_file_if_present "${filepath}"
182
+      exekutor sed -i "" -e "/^${unregex}\;/d" "${filepath}"
184 183
 
185
-      # not be master anymore if last one is gone ?
186
-      # remove_file_if_present "${masterpath}/${BOOTSTRAP_DIR}.local/is_master"
184
+      if [ -z "`read_setting "${filepath}"`" ]
185
+      then
186
+         remove_file_if_present "${filepath}"
187
+
188
+         # not be master anymore if last one is gone ?
189
+         # remove_file_if_present "${masterpath}/${BOOTSTRAP_DIR}.local/is_master"
190
+      fi
187 191
    fi
188 192
 
189 193
    exekutor touch "${masterpath}/${BOOTSTRAP_DIR}.local"
... ...
@@ -198,6 +202,7 @@ project_initialize()
198 202
 
199 203
    [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ]   && . mulle-bootstrap-logging.sh
200 204
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
205
+   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]  && . mulle-bootstrap-settings.sh
201 206
    :
202 207
 }
203 208
 
... ...
@@ -52,7 +52,7 @@ run_script()
52 52
          env | sed 's/^\(.\)/   \1/' >&2
53 53
          echo "}" >&2
54 54
       fi
55
-      exekutor "${script}" "$@"  >&2 || fail "script \"${script}\" did not run successfully"
55
+      exekutor "${script}" "$@" >&2 || fail "script \"${script}\" did not run successfully"
56 56
    else
57 57
       if [ ! -e "${script}" ]
58 58
       then
59 59
new file mode 100644
... ...
@@ -0,0 +1,362 @@
1
+#! /bin/sh
2
+#
3
+#   Copyright (c) 2017 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation