Browse code

Fix brews, fix dist clean

Nat! authored on 02-05-2017 15:40:18
Showing 7 changed files
... ...
@@ -1,3 +1,13 @@
1
+### 3.5.4
2
+
3
+* fix brews not being installed
4
+* clean dist now also dist cleans minions embedded repositories
5
+
6
+
7
+### 3.5.4
8
+
9
+* fix bug in ${expansion:-default}
10
+
1 11
 
2 12
 ### 3.5.2
3 13
 
4 14
new file mode 100644
... ...
@@ -0,0 +1,40 @@
1
+# Writing a build script for mulle-bootstrap
2
+
3
+
4
+Assume you want to create a custom build script for a dependency "foo".
5
+In the simplest case "foo" contains an \"install.sh\" script:
6
+
7
+
8
+```
9
+mkdir -p .bootstrap/foo.build/bin
10
+cat <<EOF > .bootstrap/foo.build/bin/build.sh
11
+#! /bin/sh
12
+
13
+configuration="$1"  # usually either Release or Debug, default Release
14
+stashdir="$2"       # same as ${PWD}
15
+builddir="$3"       # a place to put intermediate files
16
+dstdir="$4"         # where to install to (e.g. /usr/local)
17
+name="$5"           # "foo"
18
+sdk="$6"            # Usually "Default"
19
+
20
+
21
+./install.sh "$3"
22
+EOF
23
+chmod 755 .bootstrap/foo.build/bin/build.sh
24
+```
25
+
26
+
27
+## Getting logging support from mulle-bootstrap
28
+
29
+Spice up your script with mulle-bootstrap logging functionality:
30
+
31
+
32
+```
33
+. mulle-bootstrap-logging.sh
34
+
35
+log_info "Info"
36
+log_warning "Warning"
37
+log_verbose "Verbose"
38
+log_fluff "Fluff"
39
+fail "Failed"
40
+```
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33 33
 MULLE_EXECUTABLE_VERSION_MINOR=5
34
-MULLE_EXECUTABLE_VERSION_PATCH=3
34
+MULLE_EXECUTABLE_VERSION_PATCH=4
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37
 
... ...
@@ -119,6 +119,8 @@ fetch_brew_if_needed()
119 119
 
120 120
 walk_brews()
121 121
 {
122
+   log_debug "walk_brews" "$@"
123
+
122 124
    local brews="$1"; shift
123 125
    local callback="$1"; shift
124 126
 
... ...
@@ -327,9 +329,13 @@ find_brews()
327 329
 #
328 330
 _brew_install_brews()
329 331
 {
332
+   log_debug "_brew_install_brews" "$@"
333
+
330 334
    local brewcmd="$1" ; shift
331 335
    local brews="$@"
332 336
 
337
+   [ -z "${brewcmd}" ] && internal_fail "empty brewcmd"
338
+
333 339
    if [ -z "${brews}" ]
334 340
    then
335 341
       brews="`find_brews`"
... ...
@@ -125,6 +125,16 @@ print_stashdir_deep_embedded_repositories()
125 125
 }
126 126
 
127 127
 
128
+print_stashdir_deep_embedded_minion_repositories()
129
+{
130
+   local permissions
131
+
132
+   permissions="minion"
133
+   walk_deep_embedded_minion_repositories "_collect_stashdir" \
134
+                                         "${permissions}"
135
+}
136
+
137
+
128 138
 _collect_embedded_stashdir()
129 139
 {
130 140
    # local reposdir="$1"  # ususally .bootstrap.repos
... ...
@@ -186,6 +196,7 @@ ${BOOTSTRAP_DIR}.auto"`"
186 196
 
187 197
    #
188 198
    # as a master we don't throw the minions out
199
+   # but we are responsible for embedded repositories of minions
189 200
    #
190 201
    local stashes
191 202
 
... ...
@@ -197,6 +208,9 @@ ${BOOTSTRAP_DIR}.auto"`"
197 208
 
198 209
    stashes="`print_stashdir_deep_embedded_repositories`"
199 210
    DIST_CLEANABLE_SUBDIRS="`add_line "${DIST_CLEANABLE_SUBDIRS}" "${stashes}"`"
211
+
212
+   stashes="`print_stashdir_deep_embedded_minion_repositories`"
213
+   DIST_CLEANABLE_SUBDIRS="`add_line "${DIST_CLEANABLE_SUBDIRS}" "${stashes}"`"
200 214
 }
201 215
 
202 216
 
... ...
@@ -1601,7 +1601,7 @@ _common_fetch()
1601 1601
    #
1602 1602
    case "${BREW_PERMISSIONS}" in
1603 1603
       fetch|update|upgrade)
1604
-         brew_install_brews
1604
+         brew_install_brews "install"
1605 1605
       ;;
1606 1606
    esac
1607 1607
 
... ...
@@ -493,6 +493,8 @@ _deep_walk_auto_trampoline()
493 493
 
494 494
 walk_auto_minions()
495 495
 {
496
+   log_debug "walk_auto_minions" "$@"
497
+
496 498
    local minions
497 499
 
498 500
    minions="`read_root_setting "minions"`"
... ...
@@ -502,6 +504,8 @@ walk_auto_minions()
502 504
 
503 505
 walk_auto_repositories()
504 506
 {
507
+   log_debug "walk_auto_repositories" "$@"
508
+
505 509
    local settingname="$1";shift
506 510
 
507 511
    local clones
... ...
@@ -513,6 +517,8 @@ walk_auto_repositories()
513 517
 
514 518
 walk_repos_minions()
515 519
 {
520
+   log_debug "walk_repos_minions" "$@"
521
+
516 522
    local reposdir="$1";shift
517 523
    local callback="$1";shift
518 524
    local permissions="$1";shift
... ...
@@ -530,6 +536,8 @@ walk_repos_minions()
530 536
 
531 537
 walk_repos_repositories()
532 538
 {
539
+   log_debug "walk_repos_repositories" "$@"
540
+
533 541
    local reposdir="$1";shift
534 542
    local callback="$1";shift
535 543
    local permissions="$1";shift
... ...
@@ -547,6 +555,8 @@ walk_repos_repositories()
547 555
 
548 556
 walk_deep_embedded_auto_minions()
549 557
 {
558
+   log_debug "walk_deep_embedded_auto_minions" "$@"
559
+
550 560
    local callback="$1";shift
551 561
    local permissions="$1";shift
552 562
 
... ...
@@ -565,11 +575,14 @@ walk_deep_embedded_auto_minions()
565 575
 
566 576
 walk_deep_embedded_auto_repositories()
567 577
 {
578
+   log_debug "walk_deep_embedded_auto_repositories" "$@"
579
+
568 580
    local callback="$1";shift
569 581
    local permissions="$1";shift
570 582
 
571 583
    local clones
572 584
 
585
+
573 586
    clones="`read_root_setting "repositories"`"
574 587
    _walk_repositories "${clones}" \
575 588
                       _deep_walk_auto_trampoline \
... ...
@@ -581,8 +594,10 @@ walk_deep_embedded_auto_repositories()
581 594
 }
582 595
 
583 596
 
584
-walk_deep_embedded_repos_minions()
597
+walk_deep_embedded_minion_repositories()
585 598
 {
599
+   log_debug "walk_deep_embedded_minion_repositories" "$@"
600
+
586 601
    local callback="$1";shift
587 602
    local permissions="$1";shift
588 603
 
... ...
@@ -601,6 +616,8 @@ walk_deep_embedded_repos_minions()
601 616
 
602 617
 walk_deep_embedded_repos_repositories()
603 618
 {
619
+   log_debug "walk_deep_embedded_repos_repositories" "$@"
620
+
604 621
    local callback="$1";shift
605 622
    local permissions="$1";shift
606 623