Browse code

Make mulle-bootstrap clean more nicey. Started a SETTINGS.md file as documentation. Changed the way headers are mangled to not mangling them as default. Improved and unified settings code again.

Nat! authored on 30-09-2015 15:30:07
Showing 11 changed files
... ...
@@ -38,6 +38,17 @@ dependencies. Optimally this folder is empty or non-existant.
38 38
 * Folders in `.bootstrap.auto/repos` are the settings inherited from
39 39
 .bootstrap.
40 40
 
41
+### How are multiple values separated ?
42
+
43
+Separation is done by newline, not by space.
44
+
45
+```console
46
+mkdir -p  ".bootstrap/settings" 2> /dev/null
47
+echo "Debug Release" > .bootstrap/settings/configurations # WRONG
48
+echo "Debug
49
+Release" > .bootstrap/settings/configurations # RIGHT
50
+```
51
+
41 52
 
42 53
 ### The default target/scheme is not the one I want ?
43 54
 
... ...
@@ -170,4 +181,30 @@ the dependency library are in `dependencies/usr/local/include`. What now ?
170 181
 it. Specify the targets you want to build.
171 182
 
172 183
 
184
+### I build an aggregate target and the headers end up in the wrong place
185
+
186
+mulle_bootstrap has problems with aggregate targets. Built the subtargets
187
+individually by enumerating them in ".bootstrap/settings/{reponame}/targets"
188
+
189
+
190
+```console
191
+mkdir -p  ".bootstrap/settings/MulleScion" 2> /dev/null
192
+echo "MulleScion (iOS Library)
193
+MulleScion (iOS Framework)" > .bootstrap/settings/MulleScion/targets"
194
+```
195
+
196
+### It's not working as I expect now what ?
197
+
198
+Try to use some of the debug facilities. Each of these environment variables need to be
199
+set to **YES** to work.
200
+
201
+Environment Variable                  | Description
202
+--------------------------------------+-------------------------------------
203
+MULLE_BOOTSTRAP_VERBOSE               | turn on a little more output. If you set it to VERBOSE instead of YES, it produces quite a bit more output. Set it to FULL for exhausting detail.  Set it to -x for shell tracing.
204
+MULLE_BOOTSTRAP_TRACE                 | traces shell commands as they are executed
205
+MULLE_BOOTSTRAP_TRACE_SETTINGS        | traces resolved settings
206
+MULLE_BOOTSTRAP_TRACE_ACCESS_SETTINGS | traces each file access in search for a setting
207
+
208
+
209
+
173 210
 
... ...
@@ -26,7 +26,7 @@ After cloning **mulle-bootstrap** does a simple security check with respect to `
26 26
 
27 27
 Everything you need should be present at this time. so **mulle-bootstrap** will now  build a **Debug** and a **Release** version for each library, and places the headers and the produced libraries into "./dependencies".
28 28
 
29
-Your Xcode project can be optionally massaged by **mulle-bootstrap setup-xcode** to have the .dependency folder in its search paths.
29
+Your Xcode project can be optionally massaged by **mulle-bootstrap setup-xcode** to have the "./dependencies" folder in its search paths.
30 30
 
31 31
 ## What a project user needs to do
32 32
 
... ...
@@ -52,7 +52,7 @@ Downloads all required libraries into a `.repos` folder.
52 52
 
53 53
 #### mulle-bootstrap build
54 54
 
55
-Compiles the required libraries contained in the `.repos` folder into `dependency`. It compiles each project once for Release and once for Debug (and given a file `.bootstrap/sdks` multiplied by the number of sdks needed)
55
+Compiles the required libraries contained in the `.repos` folder into `./dependencies`. It compiles each project once for Release and once for Debug (and given a file `.bootstrap/sdks` multiplied by the number of sdks needed)
56 56
 
57 57
 
58 58
 
... ...
@@ -78,7 +78,7 @@ openssl
78 78
 
79 79
 #### mulle-bootstrap setup-xcode
80 80
 
81
-Prepares a Xcode project to use the libraries that are compiled into the `dependency` folder. You still need to add the libraries to your targets though.
81
+Prepares a Xcode project to use the libraries that are compiled into the `./dependencies` folder. You still need to add the libraries to your targets though.
82 82
 
83 83
 #### mulle-bootstrap tag
84 84
 
... ...
@@ -87,7 +87,6 @@ Tag your project and all fetched repositories, with a tag.
87 87
 
88 88
 ## Known limitations
89 89
 
90
-* no "-n" test run option
91 90
 * only works for libraries so far
92
-* not much tested
91
+* not tested too much
93 92
 
94 93
new file mode 100644
... ...
@@ -0,0 +1,152 @@
1
+
2
+> None of these settings are required, they are used to tweak **mulle_bootstrap**
3
+>
4
+> <font color="green">**Important: Setting values are delimited by LF.**</font>
5
+
6
+
7
+Build Settings (Global only)
8
+===================
9
+
10
+#### Search Paths
11
+
12
+1. ./bootstrap.auto/settings
13
+2. ./bootstrap.local/settings
14
+3. ./bootstrap/settings
15
+
16
+#### Settings
17
+
18
+
19
+Setting Name            | Description                           |  Default
20
+------------------------|---------------------------------------|----------------------------
21
+buildignore             |  repositories not to build            |
22
+buildorder              |  repositories to build in that order. You only need to specify those, that need ordering. Otherwise mulle-bootstrap build in default sort order by name.   |
23
+configurations          |  configurations to build              | Debug\nRelease
24
+sdks                    |  SDKs to build                        | Default
25
+
26
+
27
+Build Settings
28
+===================
29
+
30
+These settings are usually repository specific, but can be set globally also. If they are
31
+specified globally, they won't be inheritable by other projects bootstrapping this project
32
+as a repository.
33
+
34
+#### Search Paths
35
+
36
+1. ./bootstrap.local/${reponame}/settings
37
+2. ./bootstrap/${reponame}/settings
38
+3. ./bootstrap.auto/${reponame}/settings
39
+4. ./bootstrap.auto/settings
40
+5. ./bootstrap.local/settings
41
+6. ./bootstrap/settings
42
+
43
+#### Settings
44
+
45
+Setting Name                   |  Description                              | Default
46
+-------------------------------|-------------------------------------------|---------------
47
+${configuration}.map           | rename configuration for xcodebuild       |
48
+cmake-${configuration}.map     | rename configuration for cmake            |
49
+configure-${configuration}.map | rename configuration for configure        |
50
+xcode_proper_skip_install      | assume SKIP_INSTALL is set correctly in Xcode project                          | NO
51
+xcode_mangle_header_settings   | mangle Xcode header paths. Specifcally PUBLIC_HEADERS_FOLDER_PATH and PRIVATE_HEADERS_FOLDER_PATH        | NO
52
+xcode_mangle_include_prefix    | remove /usr/local from Xcode header paths | NO
53
+xcode_mangle_header_dash       | convert '-' to '_' in Xcode header paths  | NO
54
+
55
+
56
+Settings Repository Specific
57
+===================
58
+
59
+
60
+#### Search Paths
61
+
62
+1. ./bootstrap.local/${reponame}/settings
63
+2. ./bootstrap/${reponame}/settings
64
+3. ./bootstrap.auto/${reponame}/settings
65
+
66
+
67
+#### Settings
68
+
69
+Setting Name   | Used by       | Description
70
+---------------|---------------|---------------------------
71
+tag            | fetch         | What to checkout after cloning/symlinking a repository.
72
+project        | build,xcode   | The Xcode project file to use
73
+schemes        | build         | The Xcode schemes to build
74
+targets        | build         | The Xcode targets to build
75
+
76
+
77
+Config Settings
78
+===================
79
+
80
+Environment variables use the setting name, transformed to upper case and prepended with "MULLE_BOOTSTRAP_". So preferences is MULLE_BOOTSTRAP_PREFERENCES in the environment.
81
+
82
+#### Search Paths
83
+
84
+1. ENVIRONMENT
85
+1. ./bootstrap.local/config
86
+2. ./bootstrap/config
87
+3. ./bootstrap.auto/config
88
+5. ~/.mulle-bootstrap
89
+
90
+Setting Name                   |  Description                              | Default
91
+-------------------------------|-------------------------------------------|----------------------------
92
+preferences           | list order of preferred build tools. Will be used in deciding if to use cmake or xcodebuild, if both are available       | script\nxcodebuild\ncmake\nconfigure
93
+framework_path   | path of the Frameworks folder in dependencies           | /Frameworks
94
+header_path      | path of the headers folder in dependencies              | /include
95
+lib_path         | path of the lib folder in dependencies                  | /lib
96
+symlink_forbidden | mulle-bootstrap will not attempt to symlink            | NO
97
+clean_before_build | should mulle-bootstrap clean before building          | NO
98
+                  |                                                        |
99
+clean_folders      | folders to delete for mulle-bootstrap clean           | build/.repos
100
+dist_clean_folders  | folders to delete for mulle-bootstrap clean dist     | .repos\n/.bootstrap.auto
101
+output_clean_folders| folders to delete for mulle-bootstrap clean output   | dependencies
102
+                  |                                                        |
103
+repos_foldername  |  Where to place cloned repositories                    | .repos
104
+output_foldername |  DSTROOT, --prefix of headers and libraries            | dependencies
105
+build_foldername  |  OBJROOT, build root for intermediate files like .o    | build/.repos
106
+
107
+
108
+Fetch Settings
109
+===================
110
+
111
+1. ./bootstrap.auto/settings
112
+2. ./bootstrap.local/settings
113
+3. ./bootstrap/settings
114
+
115
+
116
+Setting Name       |  Description
117
+-------------------|----------------------------------------
118
+brews              | Homebrew formulae to install
119
+gems               | Ruby gems to install
120
+gits               | Repositories to clone, specify the URLs
121
+taps               | Homebrew taps to install
122
+
123
+
124
+
125
+Fetch Script Settings
126
+==========================
127
+
128
+1. ./bootstrap.auto/settings/bin
129
+2. ./bootstrap.local/settings/bin
130
+3. ./bootstrap/settings/bin
131
+
132
+pre-install.sh
133
+post-install.sh
134
+pre-upgrade.sh
135
+post-upgrade.sh
136
+pre-tag.sh
137
+post-tag.sh
138
+
139
+
140
+Build Script Settings
141
+==========================
142
+
143
+1. ./bootstrap.local/${reponame}/settings/bin
144
+2. ./bootstrap/${reponame}/settings/bin
145
+3. ./bootstrap.auto/${reponame}/settings/bin
146
+
147
+pre-install.sh
148
+post-install.sh
149
+pre-upgrade.sh
150
+post-upgrade.sh
151
+pre-tag.sh
152
+post-tag.sh
0 153
new file mode 100755
... ...
@@ -0,0 +1,10 @@
1
+#! /bin/sh
2
+#
3
+#
4
+if [ $# -lt 1 ]
5
+then
6
+  echo "specify some files" >&2
7
+  exit 1
8
+fi
9
+
10
+egrep -h '[^_]read_[a-z0-9_]*setting \"' *.sh | sed 's/^[^`]*`\(.*\)$/\1/' | sed 's/^[ \t]*\(.*\)/\1/' | sort | sort -u
0 11
\ No newline at end of file
... ...
@@ -33,10 +33,10 @@
33 33
 .  mulle-bootstrap-gcc.sh
34 34
 
35 35
 
36
-CLEAN_BEFORE_BUILD=`read_config_setting "clean"`
36
+CLEAN_BEFORE_BUILD=`read_config_setting "clean_before_build"`
37 37
 HEADER_PATH=`read_config_setting "header_path" "/include"`
38 38
 LIBRARY_PATH=`read_config_setting "library_path" "/lib"`
39
-FRAMEWORK_PATH=`read_config_setting "frameworks_path" "/Frameworks"`
39
+FRAMEWORK_PATH=`read_config_setting "framework_path" "/Frameworks"`
40 40
 
41 41
 #
42 42
 # move stuff produced my cmake and configure to places
... ...
@@ -173,6 +173,9 @@ build_cmake()
173 173
 
174 174
    enforce_build_sanity
175 175
 
176
+   log_info "Do a cmake ${C_MAGENTA}${configuration}${C_INFO} build of \
177
+${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
178
+
176 179
    mapped=`read_build_setting "$name" "cmake-${configuration}.map" "${configuration}"`
177 180
    suffix=`determine_suffix "${configuration}" "${sdk}"`
178 181
    sdk=`cmake_sdk_parameter "${sdk}"`
... ...
@@ -268,6 +271,10 @@ build_configure()
268 271
 
269 272
    enforce_build_sanity
270 273
 
274
+   log_info "Do a configure ${C_MAGENTA}${configuration}${C_INFO} build of \
275
+${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
276
+
277
+
271 278
    mapped=`read_build_setting "$name" "configure-${configuration}.map" "${configuration}"`
272 279
    suffix=`determine_suffix "${configuration}" "${sdk}"`
273 280
    sdk=`gcc_sdk_parameter "${sdk}"`
... ...
@@ -348,12 +355,18 @@ xcode_get_setting()
348 355
 }
349 356
 
350 357
 
358
+#
359
+# What we can not fix up is
360
+# /usr/local/include/${PROJECT_NAME}
361
+# since we can't read the unresolved value (yet)
362
+#
351 363
 fixup_header_path()
352 364
 {
353 365
    local key
354 366
    local setting_key
355 367
    local default
356 368
    local name
369
+   local prefix
357 370
 
358 371
    key="$1"
359 372
    shift
... ...
@@ -364,50 +377,52 @@ fixup_header_path()
364 377
    default="$1"
365 378
    shift
366 379
 
367
-   local headers
368
-
369
-   headers=`xcode_get_setting "${key}" $*`
370
-   log_info "${key} read as \"${headers}\""
371
-
372
-   read_yes_no_build_setting "${name}" "keep_xcode_header_settings"
380
+   read_yes_no_build_setting "${name}" "xcode_mangle_header_settings"
373 381
    if [ $? -ne 0 ]
374 382
    then
375
-      case "${headers}" in
376
-         /*)
377
-         ;;
383
+      return 1
384
+   fi
378 385
 
379
-         ./*|../*)
380
-            log_warning "relative path \"${headers}\" as header path ???"
381
-         ;;
386
+   local headers
382 387
 
383
-         "")
384
-            headers="${default}"
385
-         ;;
388
+   headers=`xcode_get_setting "${key}" $*`
389
+   log_fluff "${key} read as \"${headers}\""
386 390
 
387
-         *)
388
-            headers="/${headers}"
389
-         ;;
390
-      esac
391
+   case "${headers}" in
392
+      /*)
393
+      ;;
391 394
 
392
-      local header_name
395
+      ./*|../*)
396
+         log_warning "relative path \"${headers}\" as header path ???"
397
+      ;;
393 398
 
394
-      header_name=`remove_absolute_path_prefix_up_to "${headers}" "include"`
399
+      "")
400
+         headers="${default}"
401
+      ;;
395 402
 
396
-      if read_yes_no_build_setting "${name}" "mangle_header_dash"
397
-      then
398
-         header_name="`echo "${header_name}" | tr '-' '_'`"
399
-      fi
403
+      *)
404
+         headers="/${headers}"
405
+      ;;
406
+   esac
400 407
 
401
-      if [ ! -z "${header_name}" ]
402
-      then
403
-         header_name="/${header_name}"
404
-      fi
408
+   prefix=""
409
+   read_yes_no_build_setting "${name}" "xcode_mangle_include_prefix"
410
+   if [ $? -ne 0 ]
411
+   then
412
+      headers="`remove_absolute_path_prefix_up_to "${headers}" "include"`"
413
+      prefix="${HEADER_PATH}"
414
+   fi
405 415
 
406
-      headers="`read_repo_setting "${name}" "${setting_key}" "${HEADER_PATH}${header_name}"`"
407 416
 
408
-      log_info "${key} set to \"${headers}\""
417
+   if read_yes_no_build_setting "${name}" "xcode_mangle_header_dash"
418
+   then
419
+      headers="`echo "${headers}" | tr '-' '_'`"
409 420
    fi
410 421
 
422
+   headers="`read_repo_setting "${name}" "${setting_key}" "${prefix}${headers}"`"
423
+
424
+   log_fluff "${key} set to \"${headers}\""
425
+
411 426
    echo "${headers}"
412 427
 }
413 428
 
... ...
@@ -468,9 +483,22 @@ build_xcodebuild()
468 483
    [ -z "${sdk}" ]         && internal_fail "sdk is empty"
469 484
    [ -z "${project}" ]     && internal_fail "project is empty"
470 485
 
471
-   log_fluff "Do a xcodebuild ${C_MAGENTA}${configuration}${C_FLUFF} of \
486
+   local info
487
+
488
+   info=""
489
+   if [ ! -z "${targetname}" ]
490
+   then
491
+      info="Target ${C_MAGENTA}${targetname}${C_FLUFF}"
492
+   fi
493
+
494
+   if [ ! -z "${schemename}" ]
495
+   then
496
+      info="Scheme ${C_MAGENTA}${schemename}${C_FLUFF}"
497
+   fi
498
+
499
+   log_info "Do a xcodebuild ${C_MAGENTA}${configuration}${C_FLUFF} of \
472 500
 ${C_MAGENTA}${name}${C_FLUFF} for SDK ${C_MAGENTA}${sdk}${C_FLUFF} \
473
-${C_MAGENTA}${targetname}${schemename}${C_FLUFF} ..."
501
+${info} ..."
474 502
 
475 503
    local projectname
476 504
 
... ...
@@ -596,6 +624,7 @@ ${C_MAGENTA}${targetname}${schemename}${C_FLUFF} ..."
596 624
       local public_headers
597 625
       local private_headers
598 626
       local default
627
+
599 628
       default="/include/${name}"
600 629
       public_headers="`fixup_header_path "PUBLIC_HEADERS_FOLDER_PATH" "public_headers" "${name}" "${default}" ${arguments}`"
601 630
       default="/include/${name}/private"
... ...
@@ -614,7 +643,7 @@ ${C_MAGENTA}${targetname}${schemename}${C_FLUFF} ..."
614 643
       #
615 644
       # TODO: need to figure out the correct mapping here
616 645
       #
617
-      inherited=`xcode_get_setting HEADER_SEARCH_PATHS ${arguments}`
646
+      inherited="`xcode_get_setting HEADER_SEARCH_PATHS ${arguments}`"
618 647
       path=`combined_escaped_search_path \
619 648
 "${owd}/${DEPENDENCY_SUBDIR}${HEADER_PATH}" \
620 649
 "/usr/local/include"`
... ...
@@ -625,7 +654,7 @@ ${C_MAGENTA}${targetname}${schemename}${C_FLUFF} ..."
625 654
          dependencies_header_search_path="${path} ${inherited}"
626 655
       fi
627 656
 
628
-      inherited=`xcode_get_setting LIBRARY_SEARCH_PATHS ${arguments}`
657
+      inherited="`xcode_get_setting LIBRARY_SEARCH_PATHS ${arguments}`"
629 658
       path=`combined_escaped_search_path \
630 659
 "${owd}/${DEPENDENCY_SUBDIR}${LIBRARY_PATH}/${mapped}" \
631 660
 "${owd}/${DEPENDENCY_SUBDIR}${LIBRARY_PATH}" \
... ...
@@ -643,7 +672,7 @@ ${C_MAGENTA}${targetname}${schemename}${C_FLUFF} ..."
643 672
       fi
644 673
 
645 674
 
646
-      inherited=`xcode_get_setting FRAMEWORK_SEARCH_PATHS ${arguments}`
675
+      inherited="`xcode_get_setting FRAMEWORK_SEARCH_PATHS ${arguments}`"
647 676
       path=`combined_escaped_search_path \
648 677
 "${owd}/${DEPENDENCY_SUBDIR}${FRAMEWORK_PATH}/${mapped}" \
649 678
 "${owd}/${DEPENDENCY_SUBDIR}${FRAMEWORK_PATH}"`
... ...
@@ -658,14 +687,23 @@ ${C_MAGENTA}${targetname}${schemename}${C_FLUFF} ..."
658 687
       else
659 688
          dependencies_framework_search_path="${path} ${inherited}"
660 689
       fi
690
+
691
+      if [ ! -z "${public_headers}" ]
692
+      then
693
+         arguments="${arguments} PUBLIC_HEADERS_FOLDER_PATH='${public_headers}'"
694
+      fi
695
+      if [ ! -z "${private_headers}" ]
696
+      then
697
+         arguments="${arguments} PRIVATE_HEADERS_FOLDER_PATH='${private_headers}'"
698
+      fi
699
+
700
+
661 701
       # if it doesn't install, probably SKIP_INSTALL is set
662 702
       cmdline="\"${xcodebuild}\" \"${command}\" ${arguments} \
663 703
 ARCHS='\${ARCHS_STANDARD_32_64_BIT}' \
664 704
 DEPLOYMENT_LOCATION=YES \
665 705
 DSTROOT='${owd}/${DEPENDENCY_SUBDIR}' \
666 706
 INSTALL_PATH='${LIBRARY_PATH}${suffix}' \
667
-PUBLIC_HEADERS_FOLDER_PATH='${public_headers}' \
668
-PRIVATE_HEADERS_FOLDER_PATH='${private_headers}' \
669 707
 SYMROOT='${owd}/${builddir}/' \
670 708
 OBJROOT='${owd}/${builddir}/obj' \
671 709
 ONLY_ACTIVE_ARCH=NO \
... ...
@@ -748,7 +786,7 @@ build()
748 786
    local preferences
749 787
    local configurations
750 788
 
751
-   preferences=`read_config_setting "build_preferences" "script
789
+   preferences=`read_config_setting "preferences" "script
752 790
 xcodebuild
753 791
 cmake
754 792
 configure"`
... ...
@@ -886,6 +924,7 @@ build_clones()
886 924
    #
887 925
    if [ ! -d "${CLONES_SUBDIR}" ]
888 926
    then
927
+      log_info "No repos fetched, nothing to do."
889 928
       return 0
890 929
    fi
891 930
 
... ...
@@ -7,18 +7,34 @@ COMMAND=${1:-"objs"}
7 7
 . mulle-bootstrap-local-environment.sh
8 8
 
9 9
 case "$COMMAND" in
10
-   build)
10
+   output)
11 11
    ;;
12 12
    dist)
13 13
    ;;
14
-   objects|objs)
14
+   intermediate|objs|build)
15
+   COMMAND="objs"
15 16
    ;;
16 17
    *)
17
-   echo "usage: mulle-bootstrap-clean.sh <build|dist|objs>" 2>&1
18
+   echo "usage: mulle-bootstrap-clean.sh [output|dist]" 2>&1
18 19
    exit 1
19 20
    ;;
20 21
 esac
21 22
 
23
+
24
+clean_asserted_folder()
25
+{
26
+
27
+   if [ -d "$1" ]
28
+   then
29
+      assert_sane_path "$1"
30
+      log_info "Deleting \"$1\""
31
+      exekutor rm -rf "$1"
32
+   else
33
+      log_fluff "\"$1\" doesn't exist"
34
+   fi
35
+}
36
+
37
+
22 38
 #
23 39
 # cleanability is checked, because in some cases its convenient
24 40
 # to have other tools provide stuff besides /include and /lib
... ...
@@ -26,25 +42,30 @@ esac
26 42
 #
27 43
 clean()
28 44
 {
29
-   if [ ! -z "$OBJECTS_CLEANABLE_SUBDIRS" ]
45
+   local flag
46
+
47
+   flag="NO"
48
+   if [ ! -z "$OBJS_CLEANABLE_SUBDIRS" ]
30 49
    then
31
-      if [ "${COMMAND}" = "objects" -o "${COMMAND}" = "dist" -o "${COMMAND}" = "build"  ]
50
+      if [ "${COMMAND}" = "objs" -o "${COMMAND}" = "dist" -o "${COMMAND}" = "output"  ]
32 51
       then
33
-         for dir in ${OBJECTS_CLEANABLE_SUBDIRS}
52
+         for dir in ${OBJS_CLEANABLE_SUBDIRS}
34 53
          do
35 54
             clean_asserted_folder "${dir}"
55
+            flag="YES"
36 56
          done
37 57
       fi
38 58
    fi
39 59
 
40 60
 
41
-   if [ ! -z "$BUILD_CLEANABLE_SUBDIRS" ]
61
+   if [ ! -z "$OUTPUT_CLEANABLE_SUBDIRS" ]
42 62
    then
43
-      if [ "${COMMAND}" = "dist" -o "${COMMAND}" = "build"  ]
63
+      if [ "${COMMAND}" = "dist" -o "${COMMAND}" = "output"  ]
44 64
       then
45
-         for dir in ${BUILD_CLEANABLE_SUBDIRS}
65
+         for dir in ${OUTPUT_CLEANABLE_SUBDIRS}
46 66
          do
47 67
             clean_asserted_folder "${dir}"
68
+            flag="YES"
48 69
          done
49 70
       fi
50 71
    fi
... ...
@@ -57,14 +78,30 @@ clean()
57 78
          for dir in ${DIST_CLEANABLE_SUBDIRS}
58 79
          do
59 80
             clean_asserted_folder "${dir}"
81
+            flag="YES"
60 82
          done
61 83
       fi
62 84
    fi
85
+
86
+   if [ "$flag" = "NO" ]
87
+   then
88
+      log_info "Nothing configured to clean"
89
+   fi
63 90
 }
64 91
 
65 92
 
66 93
 main()
67 94
 {
95
+   #
96
+   # don't rename these settings anymore, the consequences can be catastrophic
97
+   # for users of previous versions.
98
+   # Also don't change the search paths for read_sane_config_path_setting
99
+   #
100
+   OBJS_CLEANABLE_SUBDIRS=`read_sane_config_path_setting "clean_folders" "${CLONESBUILD_SUBDIR}"`
101
+   OUTPUT_CLEANABLE_SUBDIRS=`read_sane_config_path_setting "output_clean_folders" "${DEPENDENCY_SUBDIR}"`
102
+   DIST_CLEANABLE_SUBDIRS=`read_sane_config_path_setting "dist_clean_folders" "${CLONES_SUBDIR}
103
+.bootstrap.auto"`
104
+
68 105
    clean
69 106
 }
70 107
 
... ...
@@ -37,8 +37,8 @@
37 37
 #
38 38
 COMMAND=${1:-"install"}
39 39
 
40
-. mulle-bootstrap-local-environment.sh
41 40
 . mulle-bootstrap-warn-scripts.sh
41
+. mulle-bootstrap-local-environment.sh
42 42
 
43 43
 
44 44
 if [ "${MULLE_BOOTSTRAP}" = "mulle-bootstrap" ]
... ...
@@ -287,6 +287,7 @@ git_command()
287 287
 
288 288
    if [ "${COMMAND}" = "install" ]
289 289
    then
290
+      log_info "Cloning ${C_WHITE}${src}${C_INFO} ..."
290 291
       git clone "${src}" "${dst}" || exit 1
291 292
    else
292 293
       ( cd "${dst}" ; git pull ) || exit 1
... ...
@@ -294,12 +295,14 @@ git_command()
294 295
 
295 296
    if [ "${tag}" != "" ]
296 297
    then
298
+      log_info "Checking out ${C_MAGENTA}${tag}${C_INFO} ..."
297 299
       (cd "${dst}" ; git checkout "${tag}" )
300
+
298 301
       if [ $? -ne 0 ]
299 302
       then
300
-         echo "Checkout failed, moving ${dst} to ${dst}.failed" >&2
301
-         echo "You need to fix this manually and them move it back." >&2
302
-         echo "Hint: check ${BOOTSTRAP_SUBDIR}/`basename "${dst}"`/TAG" >&2
303
+         log_error "Checkout failed, moving ${C_CYAN}${dst}${C_ERROR} to {C_CYAN}${dst}.failed${C_ERROR}"
304
+         log_error "You need to fix this manually and then move it back."
305
+         log_info "Hint: check ${BOOTSTRAP_SUBDIR}/`basename "${dst}"`/TAG" >&2
303 306
 
304 307
          rm -rf "${dst}.failed" 2> /dev/null
305 308
          mv "${dst}" "${dst}.failed"
... ...
@@ -325,9 +328,12 @@ bootstrap_recurse()
325 328
    # contains own bootstrap ? and not a symlink
326 329
    if [ ! -d "${dst}/.bootstrap" ] # -a ! -L "${dst}" ]
327 330
    then
331
+      log_fluff "no .bootstrap folder in ${dst} found"
328 332
       return 1
329 333
    fi
330 334
 
335
+   log_info "Recursively acquiring ${dstname} .bootstrap settings ..."
336
+
331 337
    # prepare auto folder if it doesn't exist yet
332 338
    if [ ! -d "${BOOTSTRAP_SUBDIR}.auto" ]
333 339
    then
... ...
@@ -457,7 +463,16 @@ clone_repositories()
457 463
                chmod -h "${permission}" "${dstname}"
458 464
             fi
459 465
 
460
-            log_info "Checking ${clone} in ${dstname} ..."
466
+            local info
467
+
468
+            if [ -L "${clone}" ]
469
+            then
470
+               info="symlinked"
471
+            else
472
+               info=" "
473
+            fi
474
+
475
+            log_fluff "Checking${info}${clone} in ${dstname} ..."
461 476
 
462 477
             case "${cmd}" in
463 478
                install)
... ...
@@ -41,12 +41,63 @@ then
41 41
 fi
42 42
 
43 43
 
44
+C_ERROR="${C_RED}"
45
+log_error()
46
+{
47
+   echo "${C_ERROR}$*${C_RESET}" >&2
48
+}
49
+
50
+
51
+C_WARNING="${C_YELLOW}"
52
+log_warning()
53
+{
54
+   if [ "$MULLE_BOOTSTRAP_TERSE" != "YES" ]
55
+   then
56
+      echo "${C_WARNING}$*${C_RESET}" >&2
57
+   fi
58
+}
59
+
60
+
61
+C_INFO="${C_CYAN}"
62
+log_info()
63
+{
64
+   if [ "$MULLE_BOOTSTRAP_TERSE" != "YES" ]
65
+   then
66
+      echo "${C_INFO}$*${C_RESET}" >&2
67
+   fi
68
+}
69
+
70
+
71
+C_FLUFF="${C_GREEN}"
72
+log_fluff()
73
+{
74
+   if [ "$MULLE_BOOTSTRAP_VERBOSE" = "YES"  ]
75
+   then
76
+      echo "${C_FLUFF}$*${C_RESET}" >&2
77
+   fi
78
+}
79
+
80
+
81
+C_TRACE="${C_FLUFF}"
82
+log_trace()
83
+{
84
+  echo "${C_TRACE}$*${C_RESET}" >&2
85
+}
86
+
87
+
88
+C_TRACE2="${C_WHITE}"
89
+log_trace2()
90
+{
91
+  echo "${C_TRACE2}$*${C_RESET}" >&2
92
+}
93
+
94
+
44 95
 #
45 96
 # some common functions
46 97
 #
47 98
 fail()
48 99
 {
49
-   echo "${C_RED}$*${C_RESET}" >&2
100
+   log_error "$@"
50 101
    exit 1
51 102
 }
52 103
 
... ...
@@ -148,6 +199,12 @@ path_depth()
148 199
 }
149 200
 
150 201
 
202
+relative_path_between()
203
+{
204
+   python -c "import os.path; print os.path.relpath(\'$1\', \'$2\')"
205
+}
206
+
207
+
151 208
 compute_relative()
152 209
 {
153 210
    local depth
... ...
@@ -304,27 +361,13 @@ assert_sane_path()
304 361
 {
305 362
    case "$1"  in
306 363
       \$*|~/.|..|./|../|/*)
307
-         echo "refuse unsafe path $1" >&2
364
+         log_error "refuse unsafe path ${C_WHITE}$1"
308 365
          exit 1
309 366
       ;;
310 367
    esac
311 368
 }
312 369
 
313 370
 
314
-
315
-clean_asserted_folder()
316
-{
317
-   if [ -d "$1" ]
318
-   then
319
-      assert_sane_path "$1"
320
-      exekutor rm -rf "$1"
321
-   fi
322
-   set +x
323
-}
324
-
325
-
326
-
327
-
328 371
 # http://askubuntu.com/questions/152001/how-can-i-get-octal-file-permissions-from-command-line
329 372
 lso()
330 373
 {
... ...
@@ -332,47 +375,3 @@ lso()
332 375
    awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print }' | \
333 376
    awk '{print $1}'
334 377
 }
335
-
336
-
337
-
338
-C_WARNING="${C_YELLOW}"
339
-log_warning()
340
-{
341
-   if [ "$MULLE_BOOTSTRAP_TERSE" != "YES" ]
342
-   then
343
-      echo "${C_WARNING}$*${C_RESET}" >&2
344
-   fi
345
-}
346
-
347
-C_INFO="${C_GREEN}"
348
-log_info()
349
-{
350
-   if [ "$MULLE_BOOTSTRAP_TERSE" != "YES" ]
351
-   then
352
-      echo "${C_INFO}$*${C_RESET}" >&2
353
-   fi
354
-}
355
-
356
-C_FLUFF="${C_CYAN}"
357
-log_fluff()
358
-{
359
-   if [ "$MULLE_BOOTSTRAP_TERSE" != "YES" ]
360
-   then
361
-      echo "${C_FLUFF}$*${C_RESET}" >&2
362
-   fi
363
-}
364
-
365
-C_TRACE="${C_FLUFF}"
366
-log_trace()
367
-{
368
-  echo "${C_TRACE}$*${C_RESET}" >&2
369
-}
370
-
371
-
372
-C_TRACE2="${C_WHITE}"
373
-log_trace2()
374
-{
375
-  echo "${C_TRACE2}$*${C_RESET}" >&2
376
-}
377
-
378
-
... ...
@@ -56,11 +56,6 @@ then
56 56
    CLONES_FETCH_SUBDIR="${CLONES_SUBDIR}"
57 57
 fi
58 58
 
59
-OBJECTS_CLEANABLE_SUBDIRS=`read_sane_config_path_setting "objects_clean_folders" "${CLONESBUILD_SUBDIR}"`
60
-BUILD_CLEANABLE_SUBDIRS=`read_sane_config_path_setting "build_clean_folders" "${DEPENDENCY_SUBDIR}"`
61
-DIST_CLEANABLE_SUBDIRS=`read_sane_config_path_setting "dist_clean_folders" "${CLONES_SUBDIR}
62
-.bootstrap.auto"`
63
-
64 59
 #
65 60
 #
66 61
 #
... ...
@@ -84,3 +79,22 @@ fi
84 79
 [ -z "${CLONES_RELATIVE}" ]      && internal_fail "variable CLONES_RELATIVE is empty"
85 80
 [ -z "${CLONESBUILD_RELATIVE}" ] && internal_fail "CLONESBUILD_RELATIVE is empty"
86 81
 
82
+
83
+case "${MULLE_BOOTSTRAP_TRACE}" in
84
+	VERBOSE)
85
+		MULLE_BOOTSTRAP_VERBOSE="YES"
86
+	   MULLE_BOOTSTRAP_TRACE_SETTINGS="YES"
87
+	   MULLE_BOOTSTRAP_TRACE="YES"
88
+	   ;;
89
+	FULL)
90
+      MULLE_BOOTSTRAP_TRACE_ACCESS_SETTINGS="YES"
91
+	   MULLE_BOOTSTRAP_TRACE_SETTINGS="YES"
92
+		MULLE_BOOTSTRAP_VERBOSE="YES"
93
+	   MULLE_BOOTSTRAP_TRACE="YES"
94
+	   ;;
95
+	1848)
96
+		set -x
97
+	   MULLE_BOOTSTRAP_TRACE="YES"
98
+	   ;;
99
+esac
100
+
... ...
@@ -34,29 +34,44 @@
34 34
 
35 35
 warn_user_setting()
36 36
 {
37
-   local name
37
+   local file
38 38
 
39 39
    file="$1"
40
-   if [ "${DONT_WARN_RECURSION}" = "" -a "$MULLE_BOOTSTRAP_WARN_LOCAL_SETTINGS" = "YES" ]
40
+   if [ "$MULLE_BOOTSTRAP_NO_WARN_USER_SETTINGS" != "YES" ]
41 41
    then
42
-      echo "Using `dirname "${file}"` for `basename "${file}"`" >& 2
42
+      log_warning "Using `dirname "${file}"` for `basename "${file}"`"
43 43
    fi
44 44
 }
45 45
 
46 46
 
47 47
 warn_local_setting()
48
+{
49
+   local file
50
+
51
+   file="$1"
52
+   if [ "$MULLE_BOOTSTRAP_NO_WARN_LOCAL_SETTINGS" != "YES" ]
53
+   then
54
+      log_warning "Using `dirname "${file}"` for `basename "${file}"`"
55
+   fi
56
+}
57
+
58
+
59
+warn_environment_setting()
48 60
 {
49 61
    local name
50 62
 
51 63
    name="$1"
52
-   if [ "${DONT_WARN_RECURSION}" = "" -a "$MULLE_BOOTSTRAP_WARN_LOCAL_SETTINGS" = "YES" ]
64
+   if [ "$MULLE_BOOTSTRAP_NO_WARN_ENVIRONMENT_SETTINGS" != "YES" ]
53 65
    then
54
-      echo "Using `dirname "${file}"` for `basename "${file}"`" >& 2
66
+      log_warning "Using environment variable \"${name}\""
55 67
    fi
56 68
 }
57 69
 
58 70
 
59
-read_setting()
71
+#
72
+# Base functions, not be called outside of this file
73
+#
74
+_read_setting()
60 75
 {
61 76
    local file
62 77
    local value
... ...
@@ -81,7 +96,7 @@ read_setting()
81 96
    then
82 97
       log_trace "setting `basename "${file}"` found in `dirname "${file}"` as \"${value}\""
83 98
    fi
84
-   set +x
99
+
85 100
    case "${file}" in
86 101
       *.local/*)
87 102
          warn_local_setting "${file}"
... ...
@@ -96,59 +111,73 @@ read_setting()
96 111
 # this knows intentionally no default, you cant have an empty
97 112
 # local setting
98 113
 #
99
-_read_local_setting()
114
+_read_environment_setting()
100 115
 {
101 116
    local name
102 117
    local value
103 118
    local envname
104 119
 
120
+   [ $# -ne 1  ] && internal_fail "parameterization error"
121
+
105 122
    name="$1"
106 123
 
107 124
    [ "$name" = "" ] && internal_fail "missing parameters in _read_local_setting"
108 125
 
109
-   envname=`echo "${name}" | tr '[:lower:]' '[:upper:]'`
110
-   value=`printenv "MULLE_BOOTSTRAP_${envname}"`
126
+   envname="MULLE_BOOTSTRAP_`echo "${name}" | tr '[:lower:]' '[:upper:]'`"
111 127
 
112
-   if [ "${value}" != "" ]
128
+   if [ "$MULLE_BOOTSTRAP_TRACE_ACCESS_SETTINGS" = "YES" ]
113 129
    then
114
-      echo "${value}"
115
-      return 1
116
-   else
117
-      value="`read_setting "${BOOTSTRAP_SUBDIR}.local/${name}"`"
118
-      if [ $? -ne 0 ]
119
-      then
120
-         value="`read_setting "${HOME}/.mulle-bootstrap/${name}"`"
121
-         if [ $? -ne 0 ]
122
-         then
123
-             warn_user_setting "${HOME}/.mulle-bootstrap/${name}"
124
-         fi
125
-      fi
130
+      log_trace2 "Looking for setting ${name} as environment variable ${envname}"
131
+   fi
132
+
133
+   value=`printenv "${envname}"`
134
+   if [ "${value}" = "" ]
135
+   then
136
+      return 2
137
+   fi
138
+
139
+   if [ "$MULLE_BOOTSTRAP_TRACE_SETTINGS" = "YES" ]
140
+   then
141
+      log_trace "setting ${name} found in environment variable ${envname} as \"${value}\""
126 142
    fi
143
+
144
+   warn_environment_setting "${envname}"
145
+
127 146
    echo "${value}"
147
+   return 0
128 148
 }
129 149
 
130 150
 
131
-read_local_setting()
151
+_read_local_setting()
132 152
 {
133 153
    local name
134 154
    local value
135 155
    local default
136 156
 
137
-   [ $# -lt 1 -o $# -gt 2 ] && internal_fail "parameterization error"
157
+   [ $# -ne 1  ] && internal_fail "parameterization error"
138 158
 
139 159
    name="$1"
140
-   default="$2"
141 160
 
142
-   value=`_read_local_setting "$name"`
143
-   if [ "${value}" = "" ]
161
+   [ "$name" = "" ] && internal_fail "missing parameters in _read_local_setting"
162
+
163
+   if [ "$MULLE_BOOTSTRAP_TRACE_ACCESS_SETTINGS" = "YES" ]
144 164
    then
145
-      value="${default}"
165
+      log_trace2 "Looking for setting ${name} in ~/.mulle-bootstrap"
146 166
    fi
147 167
 
148
-   echo "$value"
168
+   value="`_read_setting "${HOME}/.mulle-bootstrap/${name}"`"
169
+   if [ $? -ne 0 ]
170
+   then
171
+      return 2
172
+   fi
149 173
 
150
-   [ "${value}" = "${default}" ]
151
-   return $?
174
+   if [ "$MULLE_BOOTSTRAP_TRACE_SETTINGS" = "YES" ]
175
+   then
176
+      log_trace "setting ${name} found in ~/.mulle-bootstrap as \"${value}\""
177
+   fi
178
+   warn_user_setting "${HOME}/.mulle-bootstrap/${name}"
179
+
180
+   echo "$value"
152 181
 }
153 182
 
154 183
 
... ...
@@ -159,7 +188,6 @@ _read_bootstrap_setting()
159 188
 {
160 189
    local name
161 190
    local value
162
-   local default
163 191
    local suffix1
164 192
    local suffix2
165 193
    local suffix3
... ...
@@ -168,63 +196,52 @@ _read_bootstrap_setting()
168 196
    suffix1="$2"
169 197
    suffix2="$3"
170 198
    suffix3="$4"
171
-   default="$5"
172 199
 
173
-   [ $# -lt 4 -o $# -gt 5 ] && internal_fail "parameterization error"
200
+   [ $# -ne 4 ] && internal_fail "parameterization error"
174 201
    [ "$name" = "" ] && internal_fail "missing parameters in _read_bootstrap_setting"
175 202
 
176
-   value="`read_setting "${BOOTSTRAP_SUBDIR}${suffix1}/${name}"`"
203
+   value="`_read_setting "${BOOTSTRAP_SUBDIR}${suffix1}/${name}"`"
177 204
    if [ $? -ne 0 ]
178 205
    then
179
-      value="`read_setting "${BOOTSTRAP_SUBDIR}${suffix2}/${name}"`"
206
+      value="`_read_setting "${BOOTSTRAP_SUBDIR}${suffix2}/${name}"`"
180 207
       if [ $? -ne 0 ]
181 208
       then
182
-         value="`read_setting "${BOOTSTRAP_SUBDIR}${suffix3}/${name}"`"
209
+         value="`_read_setting "${BOOTSTRAP_SUBDIR}${suffix3}/${name}"`"
183 210
          if [ $? -ne 0 ]
184 211
          then
185
-            if [ $# -eq 4 ]
186
-            then
187
-               return 2
188
-            fi
189
-            value="${default}"
212
+            return 2
190 213
          fi
191 214
       fi
192 215
    fi
193 216
 
194 217
    echo "$value"
195
-
196
-   [ "${value}" = "${default}" ]
197
-   return $?
198 218
 }
199 219
 
200 220
 
201
-read_repo_setting()
221
+_read_repo_setting()
202 222
 {
203 223
    local name
204
-   local value
205
-   local default
206
-   local value
207
-
208
-   [ $# -lt 2 -o $# -gt 3 ] && internal_fail "parameterization error"
224
+   local package
209 225
 
210 226
    package="$1"
211 227
    name="$2"
212
-   default="$3"
213 228
 
214 229
    [ "$name" = "" -o "$package" = "" ] && internal_fail "missing parameters in read_repo_setting"
215 230
 
216 231
    # need to conserve return value 2 if empty
217
-   if [ $# -eq 2 ]
218
-   then
219
-      _read_bootstrap_setting  "settings/${package}/${name}" ".local" "" ".auto"
220
-   else
221
-      _read_bootstrap_setting  "settings/${package}/${name}" ".local" "" ".auto" "${default}"
222
-   fi
232
+   _read_bootstrap_setting  "settings/${package}/${name}" ".local" "" ".auto"
233
+}
234
+
235
+
236
+_read_build_setting()
237
+{
238
+   _read_bootstrap_setting "$1" ".local/settings" "/settings" ".auto/settings"
223 239
 }
224 240
 
225 241
 
242
+####
226 243
 #
227
-# the default
244
+# Functions building on _read_ functions
228 245
 #
229 246
 read_config_setting()
230 247
 {
... ...
@@ -237,10 +254,18 @@ read_config_setting()
237 254
    name="$1"
238 255
    default="$2"
239 256
 
240
-   value=`_read_bootstrap_setting "${name}" ".local/config" "config" ".auto/config"`
241
-   if [ "${value}" = "" ]
257
+   value="`_read_environment_setting "${name}"`"
258
+   if [ $? -ne 0 ]
242 259
    then
243
-      value=`read_local_setting "${name}" "${default}"`
260
+      value=`_read_bootstrap_setting "${name}" ".local/config" "/config" ".auto/config"`
261
+      if [ $? -ne 0 ]
262
+      then
263
+         value=`_read_local_setting "${name}"`
264
+         if [ $? -ne 0 ]
265
+         then
266
+            value="${default}"
267
+         fi
268
+      fi
244 269
    fi
245 270
 
246 271
    echo "$value"
... ...
@@ -250,46 +275,54 @@ read_config_setting()
250 275
 }
251 276
 
252 277
 
253
-read_fetch_setting()
278
+read_build_setting()
254 279
 {
255
-   _read_bootstrap_setting "$1" ".auto" ".local" "" "$2"
256
-}
280
+   local name
281
+   local value
282
+   local default
283
+   local package
257 284
 
285
+   [ $# -lt 2 -o $# -gt 3 ] && internal_fail "parameterization error"
258 286
 
259
-_read_build_setting()
260
-{
261
-   _read_bootstrap_setting "$1" ".local/settings" "/settings" ".auto/settings" "$2"
287
+   package="$1"
288
+   name="$2"
289
+   default="$3"
290
+
291
+   value=`_read_repo_setting "${package}" "${name}"`
292
+   if [ $? -ne 0 ]
293
+   then
294
+      value=`_read_build_setting "${name}"`
295
+      if [ $? -ne 0 ]
296
+      then
297
+         value="${default}"
298
+      fi
299
+   fi
300
+   echo "$value"
301
+
302
+   [ "${value}" = "${default}" ]
303
+   return $?
262 304
 }
263 305
 
264 306
 
265
-read_build_setting()
307
+read_repo_setting()
266 308
 {
267
-   local name
268 309
    local value
310
+   local name
269 311
    local default
312
+   local package
313
+
314
+   [ $# -lt 2 -o $# -gt 3 ] && internal_fail "parameterization error"
270 315
 
271 316
    package="$1"
272 317
    name="$2"
273 318
    default="$3"
274 319
 
275
-   [ $# -lt 2 -o $# -gt 3 ] && internal_fail "parameterization error"
276
-   [ "$name" = "" -o "$package" = "" ] && internal_fail "empty parameters in read_build_setting"
277
-
278
-   value=`read_repo_setting "${package}" "${name}"`
279
-   if [ $? -gt 1 ]
320
+   value="`_read_repo_setting "${package}" "${name}"`"
321
+   if [ $? -ne 0 ]
280 322
    then
281
-      if [ $# -eq 2 ]
282
-      then
283
-          value=`_read_build_setting "${name}"`
284
-      else
285
-          value=`_read_build_setting "${name}" "${default}"`
286
-      fi
287
-
288
-      if [ $? -gt 1 ]
289
-      then
290
-         return 2
291
-      fi
323
+      value="${default}"
292 324
    fi
325
+
293 326
    echo "$value"
294 327
 
295 328
    [ "${value}" = "${default}" ]
... ...
@@ -299,10 +332,53 @@ read_build_setting()
299 332
 
300 333
 read_build_root_setting()
301 334
 {
302
-   _read_build_setting "$@"
335
+   local value
336
+   local name
337
+   local default
338
+
339
+   [ $# -lt 1 -o $# -gt 2 ] && internal_fail "parameterization error"
340
+
341
+   name="$1"
342
+   default="$2"
343
+
344
+   value="`_read_build_setting "${name}" ".auto" ".local" ""`"
345
+   if [ $? -ne 0 ]
346
+   then
347
+      value="${default}"
348
+   fi
349
+
350
+   echo "$value"
351
+
352
+   [ "${value}" = "${default}" ]
353
+   return $?
303 354
 }
304 355
 
305 356
 
357
+read_fetch_setting()
358
+{
359
+   local value
360
+   local default
361
+   local name
362
+
363
+   name="$1"
364
+   default="$2"
365
+
366
+   value="`_read_bootstrap_setting "${name}" ".auto" ".local" ""`"
367
+   if [ $? -ne 0 ]
368
+   then
369
+      value="${default}"
370
+   fi
371
+
372
+   echo "$value"
373
+
374
+   [ "${value}" = "${default}" ]
375
+   return $?
376
+}
377
+
378
+
379
+####
380
+# Functions building on read_ functions
381
+#
306 382
 read_yes_no_build_setting()
307 383
 {
308 384
    local value
... ...
@@ -311,6 +387,8 @@ read_yes_no_build_setting()
311 387
    is_yes "$value" "$1/$2"
312 388
 }
313 389
 
390
+
391
+
314 392
 read_sane_config_path_setting()
315 393
 {
316 394
    local name
... ...
@@ -321,7 +399,7 @@ read_sane_config_path_setting()
321 399
    default="$2"
322 400
 
323 401
    value=`read_config_setting "${name}"`
324
-   if [ "$?" -ne 0 ]
402
+   if [ $? -ne 0 ]
325 403
    then
326 404
       assert_sane_path "${value}"
327 405
    else
... ...
@@ -337,6 +415,7 @@ read_sane_config_path_setting()
337 415
    return $?
338 416
 }
339 417
 
418
+
340 419
 all_build_flag_keys()
341 420
 {
342 421
    local keys1
... ...
@@ -373,3 +452,9 @@ ${keys6}" | sort | sort -u | egrep -v '^[ ]*$'
373 452
    return 0
374 453
 }
375 454
 
455
+
456
+# read some config stuff now
457
+
458
+MULLE_BOOTSTRAP_NO_WARN_LOCAL_SETTINGS="`read_config_setting "no_warn_local_setting"`"
459
+MULLE_BOOTSTRAP_NO_WARN_USER_SETTINGS="`read_config_setting "no_warn_user_setting"`"
460
+MULLE_BOOTSTRAP_NO_WARN_ENVIRONMENT_SETTINGS="`read_config_setting "no_warn_environment_setting"`"
... ...
@@ -229,12 +229,8 @@ patch_xcode_project()
229 229
 
230 230
    check_for_mod_pbxproj
231 231
 
232
-   configurations=`read_local_setting "configurations"`
233
-   if [ "$configurations" = "" ]
234
-   then
235
-      configurations=`read_fetch_setting "configurations" "Debug
232
+   configurations=`read_build_root_setting "configurations" "Debug
236 233
 Release"`
237
-   fi
238 234
 
239 235
    default=`echo "${configurations}" | tail -1 | sed 's/^[ \t]*//;s/[ \t]*$//'`
240 236
 
... ...
@@ -269,7 +265,14 @@ Release"
269 265
    local library_search_paths
270 266
    local framework_search_paths
271 267
 
272
-   dependencies_dir='$(PROJECT_DIR)'"/${DEPENDENCY_SUBDIR}"
268
+   #  figure out a way to make this nicer
269
+   local absolute
270
+   local relative_subdir
271
+
272
+   absolute="`readlink -f "${project}"`"
273
+   relative_subdir=`relative_path_between "${absolute}" "$(PWD)"/${DEPENDENCY_SUBDIR}`
274
+
275
+   dependencies_dir='$(PROJECT_DIR)'"${relative_subdir}"
273 276
 
274 277
    header_search_paths="\$(DEPENDENCIES_DIR)${HEADER_PATH}"
275 278
    header_search_paths="${header_search_paths} /usr/local/include"