Browse code

Renamed gits to repositories, before it's too late :) That's needed for svn supprot. Make things a little bit less colorful. Always give cmake the sdk as a cmake parameter, because it means less pain, with misconfigurations. Fix various bugs.

Nat! authored on 18-10-2015 18:59:51 • Nat! committed on 21-10-2015 16:30:22
Showing 25 changed files
... ...
@@ -40,7 +40,7 @@ ls -FARG .bootstrap
40 40
 sleep 1
41 41
 cat .bootstrap/settings/zlib/dispense_headers_path
42 42
 cat .bootstrap/settings/Finch/xcode_public_headers
43
-cat .bootstrap/gits
43
+cat .bootstrap/repositories
44 44
 sleep 2
45 45
 
46 46
 echo "#" > /dev/null
... ...
@@ -9,7 +9,7 @@ ls -FARG
9 9
 
10 10
 cd B
11 11
 mulle-bootstrap -a init
12
-echo "A" > .bootstrap/gits
12
+echo "A" > .bootstrap/repositories
13 13
 ls -FARG .bootstrap/
14 14
 rm -rf .bootstrap/brews .bootstrap/settings/MulleScion.example/
15 15
 ls -FARG .bootstrap/
... ...
@@ -28,18 +28,18 @@ mulle-bootstrap -y xcode add
28 28
 xcodebuild
29 29
 
30 30
 git init
31
-git add .bootstrap/gits .bootstrap/settings/A/xcode_public_headers src/B.? B.xcodeproj/project.pbxproj CMakeLists.txt
31
+git add .bootstrap/repositories .bootstrap/settings/A/xcode_public_headers src/B.? B.xcodeproj/project.pbxproj CMakeLists.txt
32 32
 git commit -m "mercyful release"
33 33
 
34 34
 cd ../C
35 35
 cat src/C.h
36 36
 mulle-bootstrap -a init
37
-echo "B" > .bootstrap/gits
37
+echo "B" > .bootstrap/repositories
38 38
 rm -rf .bootstrap/brews .bootstrap/settings/MulleScion.example/
39 39
 mkdir -p .bootstrap/settings/B
40 40
 echo "/usr/local/include/B" > .bootstrap/settings/B/xcode_public_headers
41 41
 mulle-bootstrap -y
42 42
 ls -FARG  dependencies/include/
43 43
 ls -FARG .bootstrap.auto
44
-cat .bootstrap.auto/gits
44
+cat .bootstrap.auto/repositories
45 45
 cat .bootstrap.auto/settings/A/xcode_public_headers
46 46
\ No newline at end of file
... ...
@@ -9,15 +9,17 @@ Or rather, stuff I would ask, if I hadn't written it myself :)
9 9
 information recursively collected from dependent repostiories, that have their
10 10
 own .bootstrap folder.
11 11
 * `.bootstrap.local` contains local settings you can use to override settings
12
-in .bootstrap and .bootstrap.auto. You create it manually.
12
+in .bootstrap and .bootstrap.auto. You may create it manually, but you don't
13
+have to.
13 14
 * `~/.mulle-bootstrap` contains some global customizations. This becomes
14 15
 autogenerated when using brew stuff.
15 16
 * `build/.repos` contains intermediate files generated by the build, which can
16
-be safely thrown away
17
+be safely thrown away at any time.
17 18
 * `dependencies` contains the produced headers, libraries and frameworks
18 19
 * `/usr/local/libexec/mulle-bootstrap` contains scripts for mulle-bootstrap
19 20
 
20 21
 
22
+
21 23
 ## Where is what in .bootstrap ?
22 24
 
23 25
 * Files in `.bootstrap` itself are used for fetching dependencies and some
... ...
@@ -26,19 +28,19 @@ configurations.
26 28
 mulle-bootstrap behavior.
27 29
 * Files in `.bootstrap/settings` are used for building dependencies. Here you
28 30
 find compiler flags, targets, sdks et.c.
29
-* Folders in `.bootstrap/repos` are build settings for individual
30
-dependencies. Optimally this folder is empty or non-existant.
31
+
32
+
31 33
 
32 34
 ## Where is what in .bootstrap.auto ?
33 35
 
34 36
 * Files in `.bootstrap.auto` are an amalgamation of .bootstrap and the contents of
35 37
 .bootstrap of the dependencies.
36 38
 * .bootstrap/config should not exist
37
-* .bootstrap/settings should not exist
38 39
 * Folders in `.bootstrap.auto/repos` are the settings inherited from
39 40
 .bootstrap.
40 41
 
41 42
 
43
+
42 44
 ### How are multiple value settings separated ?
43 45
 
44 46
 Separation is done by newline, not by space.
... ...
@@ -51,22 +53,6 @@ Release" > .bootstrap/settings/configurations # RIGHT
51 53
 ```
52 54
 
53 55
 
54
-### mulle-bootstrap does not do what I want  ?
55
-
56
-Check out the SETTINGS.md file for help  about tweaking  mulle-bootstrap.
57
-
58
-As an example, here is how to specify what target to build.
59
-
60
-Put the target name into `.bootstrap/settings/{reponame}/targets`
61
-
62
-```console
63
-mkdir -p  ".bootstrap/settings/Finch" 2> /dev/null
64
-echo "Finch Demo" > .bootstrap/Finch/targets
65
-```
66
-
67
-Use `mulle-bootstrap -V` to get an extensive trace.
68
-
69
-
70 56
 ### Can I change the build folder from build/.repos to something else  ?
71 57
 
72 58
 Better not. You can set it with "build_foldername".
... ...
@@ -79,56 +65,42 @@ so choosing `~` or `/tmp` as a build folder is not a great idea.</font>
79 65
 echo "you_have/been_warned" > ~/.bootstrap.local/build_foldername
80 66
 ```
81 67
 
82
-### What happens when I symlink a folder instead of cloning it ?
83 68
 
84
-It is assumed, that the repository link is "usable" as is. Specifically it won't
85
-be recursively bootstrapped. It also won't get any kind of .bootstrap
86
-inheritance. `mulle-bootstrap` will just **cd** there, give it the target
87
-dependency folder, ### I specified SKIP_INSTALL=YES in my Xcode project, but
69
+### I specified SKIP_INSTALL=YES in my Xcode project, but
88 70
 stuff gets installed nonetheless ?
89 71
 
90 72
 Because this SKIP_INSTALL=YES is the default unfortunately and lots of project
91 73
 maintainers forget to turn it off, **mulle-bootstrap** sets this flag to NO at
92 74
 compile time. If you know that SKIP_INSTALL is correctly set, set
93
-"proper_skip_install" to "YES".
75
+"xcode_proper_skip_install" to "YES".
94 76
 
95 77
 ```console
96 78
 mkdir -p  ".bootstrap/settings/{reponame}" 2> /dev/null
97 79
 echo "YES" > .bootstrap/settings/{reponame}/proper_skip_install
98 80
 ```
99 81
 
100
-### How can I tweak some Xcode project settings ?
101
-
102
-Lots of ways, probably the quickest is:
103
-
104
-```console
105
-mkdir -p .bootstrap/Foo 2> /dev/null
106
-echo "BrandedFoo" > .bootstrap/settings/Foo/PRODUCT_NAME
107
-```
108
-
109
-If you have lots of stuff, you may want to use your own **.xcconfig** file. This
110
-is likely to be more useful if placed into the .bootstrap folder directly.
111
-
112
-```console
113
-mkdir -p  ".bootstrap/settings" 2> /dev/null
114
-cp myconfig.xcconfig > .bootstrap/settings/xcconfig
115
-```
116 82
 
117 83
 ### I changed something in .bootstrap but it nothing happens ?
118 84
 
119
-This can happen, when you  a .bootstrap.auto was created. The easy solution
85
+This can happen, when a .bootstrap.auto was created. The easy solution
120 86
 is to say `mulle-bootstrap clean dist`.
121 87
 
88
+
89
+
122 90
 ### My Xcode project's headers do not show up ?
123 91
 
124 92
 Check that your Xcode project has a **Header Phase** and that the header files
125 93
 are in "public".
126 94
 
95
+
96
+
127 97
 ### I have a depencency on another library in the same project. The headers of
128 98
 the dependency library are in `dependencies/usr/local/include`. What now ?
129 99
 
130 100
 **mulle-bootstrap*+ can't manage xcodebuild dependencies, so you have to help
131
-it. Specify the targets you want to build.
101
+it. Specify the targets you want to build or set the proper dependencies in the
102
+xcode project.
103
+
132 104
 
133 105
 
134 106
 ### I build an aggregate target and the headers end up in the wrong place
... ...
@@ -143,6 +115,25 @@ echo "MulleScion (iOS Library)
143 115
 MulleScion (iOS Framework)" > .bootstrap/settings/MulleScion/targets"
144 116
 ```
145 117
 
118
+
119
+
120
+### mulle-bootstrap does not do what I want  ?
121
+
122
+Check out the SETTINGS.md file for help about tweaking mulle-bootstrap.
123
+
124
+As an example, here is how to specify what target to build.
125
+
126
+Put the target name into `.bootstrap/settings/{reponame}/targets`
127
+
128
+```console
129
+mkdir -p  ".bootstrap/settings/Finch" 2> /dev/null
130
+echo "Finch Demo" > .bootstrap/Finch/targets
131
+```
132
+
133
+Use `mulle-bootstrap -V` to get an extensive trace.
134
+
135
+
136
+
146 137
 ### It's not working as I expect now what ?
147 138
 
148 139
 Try to use some of the debug facilities. Each of these environment variables need to be
... ...
@@ -154,8 +145,17 @@ MULLE_BOOTSTRAP_VERBOSE               | turn on a little more output. If you set
154 145
 MULLE_BOOTSTRAP_TRACE                 | traces shell commands as they are executed
155 146
 MULLE_BOOTSTRAP_TRACE_SETTINGS        | traces settings accesses
156 147
 
148
+It's easiest to use the three verbosity options though:
157 149
 
150
+```console
151
+mulle-bootstrap -v
152
+mulle-bootstrap -V
153
+mulle-bootstrap -t
154
+```
158 155
 
159 156
 
157
+### Can I get some help ?
160 158
 
159
+Try http://stackoverflow.com and create a question with the tag "mulle-bootstrap".
160
+I am subscribed to that and should get an email.
161 161
 
... ...
@@ -2,12 +2,14 @@ SCRIPTS=install.sh \
2 2
 mulle-bootstrap-brew.sh \
3 3
 mulle-bootstrap-build.sh \
4 4
 mulle-bootstrap-clean.sh \
5
+mulle-bootstrap-convert-pre-0.10.sh \
5 6
 mulle-bootstrap-fetch.sh \
6 7
 mulle-bootstrap-functions.sh \
7 8
 mulle-bootstrap-gcc.sh \
8 9
 mulle-bootstrap-init.sh \
9 10
 mulle-bootstrap-local-environment.sh \
10 11
 mulle-bootstrap-settings.sh \
12
+mulle-bootstrap-scm.sh \
11 13
 mulle-bootstrap-scripts.sh \
12 14
 mulle-bootstrap-tag.sh \
13 15
 mulle-bootstrap-warn-scripts.sh \
... ...
@@ -18,10 +18,10 @@ installs to `./dependencies`
18 18
 
19 19
 So you need a bunch of first and third party repositories to build your own
20 20
 project ? **mulle-bootstrap init** does the initial setup of the `.bootstrap`
21
-folder. Lets put the git repository URLs in a file called `.bootstrap/gits`.
21
+folder. Lets put the git repository URLs in a file called `.bootstrap/repositories`.
22 22
 
23 23
 ```console
24
-cat > .bootstrap/gits
24
+cat > .bootstrap/repositories
25 25
 git@github.com:mulle-nat/MulleScion.git
26 26
 git@github.com:mulle-nat/UISS.git
27 27
 git@github.com:mulle-nat/Finch.git
... ...
@@ -87,7 +87,7 @@ Compiles the required libraries contained in the `.repos` folder into
87 87
 
88 88
 This is the first action. It sets up a `.bootstrap` folder in your project
89 89
 directory root (e.g. alongside .git). At this point you should edit
90
-`.bootstrap/gits` to add git projects dependencies.
90
+`.bootstrap/repositories` to add git projects dependencies.
91 91
 
92 92
 For each repository add a line like
93 93
 
... ...
@@ -1,14 +1,27 @@
1 1
 0.10
2 2
 ===
3 3
    Fetch settings can be platform specific by using the `uname` as a file
4
-   extension. e.g. gits.Darwin. Other settings may follow, if the need arises.
4
+   extension. e.g. repositories.Darwin. Other settings may follow, if the need arises.
5 5
    So far it hasn't.
6 6
 
7
-   Added "subgits" for those special moments, where you don't want to link
8
-   another project, but just steal a few files. These gits are installed in
9
-   your projects root and they are not built. You can not symlink them into
7
+   Added "embedded_repositories" for those special moments, where you don't want
8
+   to link another project, but just steal a few files. These gits are installed
9
+   in your projects root and they are not built. You can not symlink them into
10 10
    your project, just clone them.
11 11
 
12
+   Because I needed ancient and dying svn for MulleScion,  you can now remap
13
+   from the default git to svn, by creating a file <reponame>.scm. That contains
14
+   the string "svn" then.
15
+
16
+   *** Renamed "gits" to "repositories" ***
17
+
18
+   Use mulle-bootstrap convert-pre.0.10 ~/src to convert all .bootstrap folders
19
+   that `find` can find.
20
+
21
+   Do `mulle-bootstrap -n -v convert-pre-0.10 ${HOME}` to check what it's doing.
22
+
23
+   Install dummy dirs for xcodebuild too, to avoid boring compiler warnings.
24
+
12 25
 0.9.8
13 26
 ===
14 27
    Brings more Linux fixes
... ...
@@ -27,6 +27,7 @@ build_order             | repositories to build in that order.  |
27 27
 configurations          | configurations to build               | Debug\nRelease
28 28
 sdks                    | SDKs to build                         | Default
29 29
 
30
+
30 31
 Build Settings
31 32
 ===================
32 33
 
... ...
@@ -95,6 +96,7 @@ project        | build,xcode   | The Xcode project file to use
95 96
 schemes        | build         | The Xcode schemes to build
96 97
 targets        | build         | The Xcode targets to build
97 98
 
99
+
98 100
 Fetch Settings
99 101
 ===================
100 102
 
... ...
@@ -103,14 +105,15 @@ Fetch Settings
103 105
 3. ./bootstrap/settings
104 106
 
105 107
 
106
-Setting Name       |  Description
107
-brews              | Homebrew formulae to install
108
-gems               | Ruby packages to install with gem
109
-gits               | Repositories to clone, specify the URLs
110
-pips               | Python packages to install with pip
111
-taps               | Homebrew taps to install
112
-tarballs           | Tarballs to install (currently filesystem only)
108
+Setting Name          |  Description
109
+----------------------|----------------------------------------
110
+brews                 | Homebrew formulae to install
111
+gems                  | Ruby packages to install with gem
112
+repositories          | Repositories to clone, specify the URLs
113
+embedded_repositories | Repositories to embed, specify the URLs
114
+pips                  | Python packages to install with pip
115
+taps                  | Homebrew taps to install
116
+tarballs              | Tarballs to install (currently filesystem only)
113 117
 
114 118
 
115 119
 
... ...
@@ -133,11 +136,11 @@ in the environment.
133 136
 
134 137
 Setting Name                    |  Description                                  | Default
135 138
 --------------------------------|-----------------------------------------------|--------------
136
-repos_foldername                |  Where to place cloned repositories           | .repos
137
-output_foldername               |  DSTROOT, --prefix of headers and libraries   | dependencies
138
-build_foldername                |  OBJROOT, build root for intermediate files   |
139
-                                |  like .o                                      | build/.repos
139
+repos_foldername                | Where to place cloned repositories            | .repos
140
+output_foldername               | DSTROOT, --prefix of headers and libraries    | dependencies
140 141
 trace                           | see MULLE_BOOTSTRAP_TRACE for more info       | NO
142
+terse                           | set output to less verbose                    | NO
143
+verbose                         | set output to more verbose                    | NO
141 144
 no_warn_environment_setting     | don't warn when a setting is defined by       |
142 145
                                 | environment                                   | NO
143 146
 no_warn_local_setting           | don't warn when a setting is defined by       |
... ...
@@ -150,7 +153,9 @@ no_warn_user_setting            | don't warn when a setting is defined by
150 153
 
151 154
 Setting Name                    |  Description                                  | Default
152 155
 --------------------------------|-----------------------------------------------|--------------
156
+absolute_symlinks               | Use absolute symlinks instead of relatives    | NO
153 157
 symlink_forbidden               | mulle-bootstrap will not attempt to symlink   | NO
158
+update_gitignore                | add cleanable directories to .gitignore       | YES
154 159
 
155 160
 
156 161
 Build Config Settings
... ...
@@ -160,6 +165,9 @@ Setting Name                    |  Description
160 165
 build_preferences               | list order of preferred build tools. Will be  |
161 166
                                 | used in deciding if to use cmake or           |
162 167
                                 | xcodebuild, if both are available             | script\nxcodebuild\ncmake\nconfigure
168
+build_foldername                | OBJROOT, build root for intermediate files    |
169
+                                | like .o                                       | build/.repos
170
+build_log_foldername            | name of the output folder for logs            | build/.repos/.logs
163 171
 clean_before_build              | should mulle-bootstrap clean before building  | YES
164 172
 clean_dependencies_before_build | usually before a build, mulle-bootstrap       |
165 173
                                 | cleans dependencies to avoid surprising       |
... ...
@@ -169,6 +177,7 @@ header_dir_name                 | name of the headers folder in dependencies.
169 177
                                 | e.g. You dislike "include" and favor          |
170 178
                                 | "headers".                                    | include
171 179
 library_dir_name                | as above, but for libraries                   | lib
180
+skip_collect_and_dispense       | don't collect and dispense products           | NO
172 181
 xcodebuild                      | tool to use instead of xcodebuild (xctool ?)  | xcodebuild
173 182
 
174 183
 
... ...
@@ -181,9 +190,10 @@ create_default_files            | if mulle-bootstrap init should populate
181 190
 create_example_files            | if mulle-bootstrap init should populate       |
182 191
                                 | .bootstrap with some example files            | YES
183 192
 editor                          | the editor mulle-bootstrap init should use    |
184
-                                | to edit gits                                  | EDITOR environment variable
185
-open_gits_file                  | if mulle-bootstrap init should open an editor |
186
-                                | to edit gits (YES/NO/ASK)                     | ASK
193
+                                | to edit repositories                          | EDITOR environment variable
194
+open_repositories_file          | if mulle-bootstrap init should open an editor |
195
+                                | to edit repositories (YES/NO/ASK)             | ASK
196
+
187 197
 
188 198
 ##### Clean Config Settings
189 199
 
... ...
@@ -2,3 +2,7 @@
2 2
 git://git.savannah.gnu.org/readline.git
3 3
 # A cmake project
4 4
 https://github.com/madler/zlib
5
+# An Xcode project
6
+https://github.com/mulle-nat/Finch.git
7
+# git@github.com:mulle-nat/Finch.git
8
+
5 9
new file mode 100644
... ...
@@ -0,0 +1,4 @@
1
+# A configure project
2
+git://git.savannah.gnu.org/readline.git
3
+# A cmake project
4
+https://github.com/madler/zlib
... ...
@@ -22,13 +22,13 @@ There is very little configuration needed to get this result. The
22 22
 
23 23
 Folder                     | Files                 | Folders
24 24
 ---------------------------|-----------------------|---------------
25
-.bootstrap						| gits                  | settings/
25
+.bootstrap						| repositories          | settings/
26 26
 .bootstrap/settings			|                       | Finch/	zlib/
27 27
 .bootstrap/settings/Finch	| xcode_public_headers  |
28 28
 .bootstrap/settings/zlib	| dispense_headers_path |
29 29
 
30 30
 
31
-`.bootstrap/gits` defines the repositories to fetch
31
+`.bootstrap/repositories` defines the repositories to fetch
32 32
 ```
33 33
 # A configure project
34 34
 git://git.savannah.gnu.org/readline.git
... ...
@@ -1,4 +1,4 @@
1
-#! /bin/sh +x
1
+#! /bin/sh
2 2
 #
3 3
 #   Copyright (c) 2015 Nat! - Mulle kybernetiK
4 4
 #   All rights reserved.
... ...
@@ -204,7 +204,10 @@ bootstrap()
204 204
 main()
205 205
 {
206 206
 
207
-   if [ ! -d "${BOOTSTRAP_SUBDIR}" -a "${command}" != "init" -a "${command}" != "version" ]
207
+   if [ ! -d "${BOOTSTRAP_SUBDIR}" -a \
208
+      "${command}" != "init" -a \
209
+      "${command}" != "version"  -a \
210
+      "${command}" != "convert-pre-0.10" ]
208 211
    then
209 212
       echo "there is no ${BOOTSTRAP_SUBDIR} here, can't continue" >&2
210 213
       exit 1
... ...
@@ -239,6 +242,10 @@ main()
239 242
          COMMAND="update" mulle-bootstrap-fetch.sh "$@" || exit 1
240 243
          ;;
241 244
 
245
+      convert-pre-0.10)
246
+         mulle-bootstrap-convert-pre-0.10.sh "$@" || exit 1
247
+         ;;
248
+
242 249
       init)
243 250
          mulle-bootstrap-init.sh "$@" || exit 1
244 251
          ;;
245 252
old mode 100755
246 253
new mode 100644
... ...
@@ -73,7 +73,7 @@ dispense_headers()
73 73
    local headers
74 74
    local suffix
75 75
 
76
-   log_fluff "Consider copying headers from ${C_RESET}${src}${C_FLUFF}"
76
+   log_fluff "Consider copying headers from \"${src}\""
77 77
 
78 78
    if [ -d "${src}" ]
79 79
    then
... ...
@@ -84,7 +84,7 @@ dispense_headers()
84 84
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${headers}"
85 85
          mkdir_if_missing "${dst}"
86 86
 
87
-         log_fluff "Copying ${C_RESET}${src}${C_FLUFF} to ${C_RESET}${dst}${C_FLUFF}"
87
+         log_fluff "Copying \"${src}\" to \"${dst}\""
88 88
          exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 -type d -print0 | \
89 89
             exekutor xargs -0 -I % mv ${COPYMOVEFLAGS} -n % "${dst}"
90 90
          [ $? -eq 0 ]  || exit 1
... ...
@@ -120,7 +120,7 @@ dispense_binaries()
120 120
 
121 121
    findtype2="l"
122 122
 
123
-   log_fluff "Consider copying binaries from ${C_RESET}${src}${C_FLUFF} for type \"${findtype}/${findtype2}\""
123
+   log_fluff "Consider copying binaries from \"${src}\" for type \"${findtype}/${findtype2}\""
124 124
 
125 125
    if [ -d "${src}" ]
126 126
    then
... ...
@@ -128,7 +128,7 @@ dispense_binaries()
128 128
       then
129 129
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${subpath}${subdir}"
130 130
 
131
-         log_fluff "Copying ${C_RESET}${src}${C_FLUFF} to ${C_RESET}${dst}${C_FLUFF}"
131
+         log_fluff "Copying \"${src}\" to \"${dst}\""
132 132
          mkdir_if_missing "${dst}"
133 133
          exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 \( -type "${findtype}" -o -type "${findtype2}" \) -print0 | \
134 134
             exekutor xargs -0 -I % mv ${COPYMOVEFLAGS} -n % "${dst}"
... ...
@@ -162,7 +162,7 @@ collect_and_dispense_product()
162 162
       return 0
163 163
    fi
164 164
 
165
-   log_info "Collecting and dispensing ${C_RESET}${name}${C_INFO} ${C_MAGENTA}`basename "${subdir}"`${C_INFO} products "
165
+   log_fluff "Collecting and dispensing \"${name}\" \"`basename "${subdir}"`\" products "
166 166
    #
167 167
    # probably should use install_name_tool to hack all dylib paths that contain .ref
168 168
    # (will this work with signing stuff ?)
... ...
@@ -247,7 +247,7 @@ collect_and_dispense_product()
247 247
       then
248 248
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${usrlocal}"
249 249
 
250
-         log_fluff "Copying everything from ${C_RESET}${src}${C_FLUFF} to ${C_RESET}${dst}${C_FLUFF}"
250
+         log_fluff "Copying everything from \"${src}\" to \"${dst}\""
251 251
          exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 -print0 | \
252 252
                exekutor xargs -0 -I % mv -v -n % "${dst}"
253 253
          [ $? -eq 0 ]  || fail "moving files from ${src} to ${dst} failed"
... ...
@@ -257,7 +257,7 @@ collect_and_dispense_product()
257 257
       then
258 258
          if dir_has_files "${BUILD_DEPENDENCY_SUBDIR}"
259 259
          then
260
-            log_fluff "Directory ${C_RESET}${BUILD_DEPENDENCY_SUBDIR}${C_FLUFF} contained files after collect and dispense"
260
+            log_fluff "Directory \"${dst}\" contained files after collect and dispense"
261 261
             log_fluff "--------------------"
262 262
             ( cd "${BUILD_DEPENDENCY_SUBDIR}" ; ls -lR >&2 )
263 263
             log_fluff "--------------------"
... ...
@@ -281,7 +281,7 @@ enforce_build_sanity()
281 281
    # these must not exist
282 282
    if [ -d "${BUILD_DEPENDENCY_SUBDIR}" ]
283 283
    then
284
-      fail "A previous build left ${C_RESET}${BUILD_DEPENDENCY_SUBDIR}${C_ERROR}, can't continue"
284
+      fail "A previous build left \"${BUILD_DEPENDENCY_SUBDIR}\", can't continue"
285 285
    fi
286 286
 }
287 287
 
... ...
@@ -316,6 +316,7 @@ cmake_sdk_parameter()
316 316
    sdkpath=`gcc_sdk_parameter "$1"`
317 317
    if [ "${sdkpath}" != "" ]
318 318
    then
319
+      log_fluff "Set cmake -DCMAKE_OSX_SYSROOT to \"${sdkpath}\""
319 320
       echo '-DCMAKE_OSX_SYSROOT='"${sdkpath}"
320 321
    fi
321 322
 }
... ...
@@ -329,30 +330,23 @@ create_dummy_dirs_against_warnings()
329 330
    builddir="$1"
330 331
    configuration="$2"
331 332
    suffix="$3"
332
-   relative="$4"
333 333
 
334 334
    local owd
335 335
 
336 336
    owd="${PWD}"
337 337
 
338 338
    # to avoid warnings make sure directories are all there
339
-   [ ! -e "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}" ]  &&  \
340
-      mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}"
341
-   [ ! -e "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration}" ]  &&  \
339
+   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}"
340
+   if [ ! -z "${configuration}" ]
341
+   then
342
+      mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${configuration}"
342 343
       mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration}"
343
-   [ ! -e "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix}" ]  &&  \
344
-      mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix}"
345
-
346
-
347
-   mkdir_if_missing "${builddir}"
348
-   exekutor cd "${builddir}" ||  fail "failed to enter ${builddir}"
349
-
350
-      # check that relative is right
351
-   exekutor [ -d "${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}" ] || internal_fail "${relative} is wrong"
352
-   exekutor [ -d "${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration}" ] || internal_fail "${relative} is wrong"
353
-   exekutor [ -d "${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix}" ] || internal_fail "${relative} is wrong"
354
-
355
-   exekutor cd "${owd}" ||  fail "failed to enter ${owd}"
344
+   fi
345
+   if [ ! -z "${suffix}" ]
346
+   then
347
+       mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${suffix}"
348
+       mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix}"
349
+   fi
356 350
 }
357 351
 
358 352
 
... ...
@@ -408,7 +402,6 @@ build_cmake()
408 402
    local relative
409 403
    local name
410 404
    local sdk
411
-   local mapped
412 405
 
413 406
    configuration="$1"
414 407
    srcdir="$2"
... ...
@@ -419,12 +412,16 @@ build_cmake()
419 412
 
420 413
    enforce_build_sanity "${builddir}"
421 414
 
422
-   log_info "Do a cmake ${C_MAGENTA}${configuration}${C_INFO} build of \
423
-${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
415
+   log_info "Let ${C_YELLOW}cmake${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
416
+${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir}\" ..."
417
+
418
+   local sdkparameter
419
+   local suffix
420
+   local mapped
424 421
 
425 422
    mapped="`read_build_setting "$name" "cmake-${configuration}.map" "${configuration}"`"
426 423
    suffix="`determine_suffix "${configuration}" "${sdk}"`"
427
-   sdk="`cmake_sdk_parameter "${sdk}"`"
424
+   sdkparameter="`cmake_sdk_parameter "${sdk}"`"
428 425
 
429 426
    local other_cflags
430 427
    local other_cppflags
... ...
@@ -434,8 +431,7 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
434 431
    other_cppflags="`gcc_cppflags_value "${name}"`"
435 432
    other_ldflags="`gcc_ldflags_value "${name}"`"
436 433
 
437
-
438
-   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}" "${relative}"
434
+   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}"
439 435
 
440 436
    local logfile1
441 437
    local logfile2
... ...
@@ -445,7 +441,7 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
445 441
    logfile1="`build_log_name "cmake" "${name}" "${configuration}" "${sdk}"`"
446 442
    logfile2="`build_log_name "make" "${name}" "${configuration}" "${sdk}"`"
447 443
 
448
-   log_info "Build logs will be in ${C_RESET}${logfile1}${C_INFO} and ${C_RESET}${logfile2}${C_INFO}"
444
+   log_info "Build logs will be in \"${logfile1}\" and \"${logfile2}\""
449 445
 
450 446
    owd="${PWD}"
451 447
    mkdir_if_missing "${builddir}"
... ...
@@ -465,21 +461,20 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
465 461
       fi
466 462
 
467 463
       logging_exekutor cmake "-DCMAKE_BUILD_TYPE=${mapped}" \
464
+"${sdkparameter}" \
468 465
 "-DCMAKE_INSTALL_PREFIX:PATH=${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local"  \
469 466
 "-DCMAKE_C_FLAGS=\
470 467
 -I${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
471 468
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
472 469
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
473 470
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
474
-${other_cflags} \
475
-${sdk}" \
471
+${other_cflags}" \
476 472
 "-DCMAKE_CXX_FLAGS=\
477 473
 -I${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
478 474
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
479 475
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
480 476
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
481
-${other_cppflags} \
482
-${sdk}" \
477
+${other_cppflags}" \
483 478
 "-DCMAKE_LD_FLAGS=\
484 479
 -L${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${suffix} \
485 480
 -L${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${configuration} \
... ...
@@ -487,11 +482,10 @@ ${sdk}" \
487 482
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
488 483
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
489 484
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
490
-${other_ldflags} \
491
-${sdk}" \
485
+${other_ldflags}" \
492 486
 "${relative}/${srcdir}" >> "${logfile1}" || build_fail "${logfile1}" "cmake"
493 487
 
494
-      logging_exekutor make VERBOSE=1 all install >> "${logfile2}" || build_fail "${logfile2}" "make"
488
+      logging_exekutor make VERBOSE=1 install >> "${logfile2}" || build_fail "${logfile2}" "make"
495 489
 
496 490
       set +f
497 491
 
... ...
@@ -526,8 +520,8 @@ build_configure()
526 520
 
527 521
    enforce_build_sanity "${builddir}"
528 522
 
529
-   log_info "Do a configure ${C_MAGENTA}${configuration}${C_INFO} build of \
530
-${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
523
+   log_info "Let ${C_YELLOW}configure${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
524
+${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir}\" ..."
531 525
 
532 526
 
533 527
    mapped="`read_build_setting "$name" "configure-${configuration}.map" "${configuration}"`"
... ...
@@ -542,7 +536,7 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
542 536
    other_cppflags="`gcc_cppflags_value "${name}"`"
543 537
    other_ldflags="`gcc_ldflags_value "${name}"`"
544 538
 
545
-   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}" "${relative}"
539
+   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}"
546 540
 
547 541
    local logfile1
548 542
    local logfile2
... ...
@@ -552,7 +546,7 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
552 546
    logfile1="`build_log_name "configure" "${name}" "${configuration}" "${sdk}"`"
553 547
    logfile2="`build_log_name "make" "${name}" "${configuration}" "${sdk}"`"
554 548
 
555
-   log_info "Build logs will be in ${C_RESET}${logfile1}${C_INFO} and ${C_RESET}${logfile2}${C_INFO}"
549
+   log_info "Build logs will be in \"${logfile1}\" and \"${logfile2}\""
556 550
 
557 551
    owd="${PWD}"
558 552
    mkdir_if_missing "${builddir}"
... ...
@@ -621,7 +615,7 @@ ${sdk}" \
621 615
           --prefix "${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local" >> "${logfile1}" \
622 616
       || build_fail "${logfile1}" "configure"
623 617
 
624
-      logging_exekutor make all install >> "${logfile2}" \
618
+      logging_exekutor make install >> "${logfile2}" \
625 619
       || build_fail "${logfile2}" "make"
626 620
 
627 621
       set +f
... ...
@@ -783,9 +777,9 @@ build_xcodebuild()
783 777
       info="Scheme ${C_MAGENTA}${schemename}${C_INFO}"
784 778
    fi
785 779
 
786
-   log_info "Do a xcodebuild ${C_MAGENTA}${configuration}${C_INFO} of \
780
+   log_info "Let ${C_YELLOW}xcodebuild${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
787 781
 ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} \
788
-${info} ..."
782
+${info} in \"${builddir}\" ..."
789 783
 
790 784
    local projectname
791 785
 
... ...
@@ -895,7 +889,7 @@ ${info} ..."
895 889
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
896 890
 
897 891
    logfile="`build_log_name "xcodebuild" "${name}" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`"
898
-   log_info "Build log will be in ${C_RESET}${logfile}${C_INFO}"
892
+   log_info "Build log will be in \"${logfile}\""
899 893
 
900 894
    set -f
901 895
 
... ...
@@ -921,6 +915,8 @@ ${info} ..."
921 915
       arguments="${arguments} -configuration \"${mapped}\""
922 916
    fi
923 917
 
918
+   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}"
919
+
924 920
    owd=`pwd`
925 921
    exekutor cd "${srcdir}" || exit 1
926 922
 
... ...
@@ -1108,7 +1104,7 @@ build_script()
1108 1104
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
1109 1105
    logfile="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.script.log"
1110 1106
 
1111
-   log_info "Build log will be in ${C_RESET}${logfile}${C_INFO}"
1107
+   log_info "Build log will be in \"${logfile}\""
1112 1108
 
1113 1109
    local owd
1114 1110
 
... ...
@@ -1344,12 +1340,12 @@ build_if_alive()
1344 1340
    zombie="`dirname "${srcdir}"`/.zombies/${name}"
1345 1341
    if [ -e "${zombie}" ]
1346 1342
    then
1347
-      log_warning "Ignoring zombie repo ${name} as ${C_RESET}${zombie}${C_WARNING} exists"
1343
+      log_warning "Ignoring zombie repo ${name} as \"${zombie}${C_WARNING} exists"
1348 1344
    else
1349 1345
       xdone="`/bin/echo "${BUILT}" | grep -x "${name}"`"
1350 1346
       if [ "$xdone" = "" ]
1351 1347
       then
1352
-         build_wrapper "${name}" "${srcdir}" 
1348
+         build_wrapper "${name}" "${srcdir}"
1353 1349
          BUILT="${name}
1354 1350
 ${BUILT}"
1355 1351
       else
... ...
@@ -1365,6 +1361,9 @@ build_clones()
1365 1361
    local xdone
1366 1362
    local name
1367 1363
    local srcdir
1364
+   local old
1365
+
1366
+   old="${IFS:-" "}"
1368 1367
 
1369 1368
    for clone in ${CLONES_SUBDIR}/*.failed
1370 1369
    do
... ...
@@ -1387,8 +1386,12 @@ build_clones()
1387 1386
    then
1388 1387
       BUILT="`read_build_root_setting "build_ignore"`"
1389 1388
 
1390
-      for clone in `read_build_root_setting "build_order"`
1389
+      clones="`read_build_root_setting "build_order"`"
1390
+      IFS="
1391
+"
1392
+      for clone in ${clones}
1391 1393
       do
1394
+         IFS="$old"
1392 1395
          name="`canonical_clone_name "${clone}"`"
1393 1396
          srcdir="${CLONES_SUBDIR}/${name}"
1394 1397
 
... ...
@@ -1399,16 +1402,21 @@ build_clones()
1399 1402
             fail "build_order contains unknown repo \"${clone}\" (\"${srcdir}\")"
1400 1403
          fi
1401 1404
       done
1405
+      IFS="$old"
1402 1406
 
1403 1407
       #
1404
-      # otherwise compile in gits order
1408
+      # otherwise compile in repositories order
1405 1409
       #
1406
-      clones="`read_fetch_setting "gits"`"
1410
+      clones="`read_fetch_setting "repositories"`"
1407 1411
       if [ "${clones}" != "" ]
1408 1412
       then
1413
+         IFS="
1414
+"
1409 1415
          for clone in ${clones}
1410 1416
          do
1411
-            name="`canonical_clone_name "${clone}"`"
1417
+            IFS="$old"
1418
+
1419
+            name="`canonical_name_from_clone "${clone}"`"
1412 1420
             srcdir="${CLONES_SUBDIR}/${name}"
1413 1421
 
1414 1422
             if [ -d "${srcdir}" ]
... ...
@@ -1433,6 +1441,8 @@ build_clones()
1433 1441
       done
1434 1442
    fi
1435 1443
 
1444
+   IFS="$old"
1445
+
1436 1446
    run_build_root_settings_script "post-build" "$@"
1437 1447
 }
1438 1448
 
... ...
@@ -1442,27 +1452,28 @@ install_tars()
1442 1452
    local tarballs
1443 1453
    local tar
1444 1454
 
1445
-
1446 1455
    tarballs=`read_fetch_setting "tarballs" | sort | sort -u`
1447
-   if [ "${tarballs}" != "" ]
1456
+   if [ "${tarballs}" = "" ]
1448 1457
    then
1449
-      local old
1458
+      return 0
1459
+   fi
1450 1460
 
1451
-      old="${IFS:-" "}"
1452
-      IFS="
1461
+   local old
1462
+
1463
+   old="${IFS:-" "}"
1464
+   IFS="
1453 1465
 "
1454
-      for tar in ${tarballs}
1455
-      do
1456
-         if [ ! -f "$tar" ]
1457
-         then
1458
-            fail "tarball \"$tar\" not found"
1459
-         else
1460
-            log_info "Installing tarball ${C_RESET}${tar}${C_INFO}"
1461
-            exekutor tar -xz -C "${DEPENDENCY_SUBDIR}" -f "${tar}" || fail "failed to extract ${tar}"
1462
-         fi
1463
-      done
1464
-      IFS="${old}"
1465
-   fi
1466
+   for tar in ${tarballs}
1467
+   do
1468
+      if [ ! -f "$tar" ]
1469
+      then
1470
+         fail "tarball \"$tar\" not found"
1471
+      else
1472
+         log_info "Installing tarball \"${tar}\""
1473
+         exekutor tar -xz -C "${DEPENDENCY_SUBDIR}" -f "${tar}" || fail "failed to extract ${tar}"
1474
+      fi
1475
+   done
1476
+   IFS="${old}"
1466 1477
 }
1467 1478
 
1468 1479
 
... ...
@@ -1477,7 +1488,7 @@ main()
1477 1488
    #
1478 1489
    if [ ! -d "${CLONES_SUBDIR}" ]
1479 1490
    then
1480
-      log_info "No repos fetched, so nothing to build."
1491
+      log_info "No repositories in \"${CLONES_SUBDIR}\", so nothing to build."
1481 1492
       return 0
1482 1493
    fi
1483 1494
 
... ...
@@ -1490,7 +1501,8 @@ main()
1490 1501
          rmdir_safer "${DEPENDENCY_SUBDIR}"
1491 1502
       fi
1492 1503
    else
1493
-      log_fluff "Keeping \"${DEPENDENCY_SUBDIR}\" intact, as this is a partial build."
1504
+      log_fluff "Unprotecting \"${DEPENDENCY_SUBDIR}\" (as this is a partial build)."
1505
+      exekutor chmod -R u+w "${DEPENDENCY_SUBDIR}"
1494 1506
    fi
1495 1507
 
1496 1508
    # if present then we didnt't want to clean and we do nothing special
... ...
@@ -1500,7 +1512,7 @@ main()
1500 1512
       exekutor ln -s "usr/local/include" "${DEPENDENCY_SUBDIR}/include" || fail "failed to symlink future usr/local/include"
1501 1513
       install_tars "$@"
1502 1514
    else
1503
-      log_warning "Tars have not been installed, as ${C_RESET}${DEPENDENCY_SUBDIR}${C_WARNING} already exists."
1515
+      log_warning "Tars have not been installed, as \"${DEPENDENCY_SUBDIR}\" already exists."
1504 1516
    fi
1505 1517
 
1506 1518
    build_clones "$@"
... ...
@@ -1509,7 +1521,7 @@ main()
1509 1521
    then
1510 1522
       if [ "${clean}" = "YES" -a -d "${DEPENDENCY_SUBDIR}" ]
1511 1523
       then
1512
-         log_info "Write-protecting ${C_RESET}${DEPENDENCY_SUBDIR}${C_INFO} to avoid spurious header edits"
1524
+         log_info "Write-protecting \"${DEPENDENCY_SUBDIR}\" to avoid spurious header edits"
1513 1525
          exekutor chmod -R a-w "${DEPENDENCY_SUBDIR}"
1514 1526
       fi
1515 1527
    fi
... ...
@@ -40,19 +40,19 @@ DIST_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "dist_clean_folders" "${C
40 40
 CLEAN_EMPTY_PARENTS="`read_config_setting "clean_empty_parent_folders" "YES"`"
41 41
 
42 42
 
43
-subgits()
43
+embedded_repositories()
44 44
 {
45 45
    local clones
46 46
    local clone
47 47
    local dir
48 48
    local name
49 49
 
50
-   clones="`read_fetch_setting "subgits"`"
50
+   clones="`read_fetch_setting "embedded_repositories"`"
51 51
    if [ "${clones}" != "" ]
52 52
    then
53 53
       for clone in ${clones}
54 54
       do
55
-         name="`basename "${clone}" .git`"
55
+         name="`extension_less_basename "${clone}"`"
56 56
          dir="${name}"
57 57
          echo "${dir}"
58 58
       done
... ...
@@ -61,7 +61,7 @@ subgits()
61 61
 
62 62
 
63 63
 DIST_CLEANABLE_SUBDIRS="${DIST_CLEANABLE_SUBDIRS}
64
-`subgits`"
64
+`embedded_repositories`"
65 65
 
66 66
 
67 67
 usage()
68 68
new file mode 100755
... ...
@@ -0,0 +1,80 @@
1
+#! /bin/sh
2
+#
3
+#   Copyright (c) 2015 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
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+
32
+. mulle-bootstrap-local-environment.sh
33
+
34
+
35
+move_it()
36
+{
37
+   local dir
38
+   local src
39
+   local dst
40
+
41
+   dir="$1"
42
+   src="$2"
43
+   dst="$3"
44
+
45
+   ( cd "${dir}" ; git ls-files "$src" --error-unmatch 2> /dev/null 1>&2 )
46
+
47
+   if [ $? -eq 0 ]
48
+   then
49
+       ( exekutor cd "${dir}" ;  exekutor git mv "$src" "$dst" )
50
+   else
51
+       ( exekutor cd "${dir}" ; exekutor mv "$src" "$dst" )
52
+   fi
53
+}
54
+
55
+
56
+main()
57
+{
58
+   local dir
59
+
60
+   find "$@" -name "${BOOTSTRAP_SUBDIR}" -type d -print | while read -r dir
61
+   do
62
+      if [ -f "${dir}/gits" ]
63
+      then
64
+         move_it "${dir}" gits repositories
65
+      fi
66
+
67
+      if [ -f "${dir}/subgits" ]
68
+      then
69
+         move_it "${dir}" subgits embedded_repositories
70
+      fi
71
+   done
72
+}
73
+
74
+
75
+if [ $# -eq 0 ]
76
+then
77
+   main "."
78
+else
79
+   main "$@"
80
+fi
... ...
@@ -37,6 +37,7 @@
37 37
 #
38 38
 . mulle-bootstrap-local-environment.sh
39 39
 . mulle-bootstrap-brew.sh
40
+. mulle-bootstrap-scm.sh
40 41
 . mulle-bootstrap-scripts.sh
41 42
 
42 43
 
... ...
@@ -275,7 +276,7 @@ link_command()
275 276
 
276 277
    if [ ! -e "${dstdir}/${src}" ]
277 278
    then
278
-      fail "${C_RESET}${dstdir}/${src}${C_ERROR} does not exist ($PWD)"
279
+      fail "\"${dstdir}/${src}${C_ERROR} does not exist ($PWD)"
279 280
    fi
280 281
 
281 282
    if [ "${COMMAND}" = "install" ]
... ...
@@ -290,7 +291,7 @@ link_command()
290 291
          local real
291 292
 
292 293
          real="`( cd "${dstdir}" ; realpath "${src}")`"
293
-         log_fluff "Converted symlink ${C_RESET}${src}${C_FLUFF} to ${C_RESET}${real}${C_FLUFF}"
294
+         log_fluff "Converted symlink \"${src}\" to \"${real}\""
294 295
          src="${real}"
295 296
       fi
296 297
 
... ...
@@ -354,109 +355,45 @@ ask_symlink_it()
354 355
 }
355 356
 
356 357
 
357
-git_checkout_tag()
358
-{
359
-   local dst
360
-   local tag
361
-
362
-   dst="$1"
363
-   tag="$2"
364
-
365
-   log_info "Checking out ${C_MAGENTA}${tag}${C_INFO} ..."
366
-   ( exekutor cd "${dst}" ; exekutor git checkout ${GITFLAGS} "${tag}" )
367
-
368
-   if [ $? -ne 0 ]
369
-   then
370
-      log_error "Checkout failed, moving ${C_CYAN}${dst}${C_ERROR} to {C_CYAN}${dst}.failed${C_ERROR}"
371
-      log_error "You need to fix this manually and then move it back."
372
-      log_info "Hint: check ${BOOTSTRAP_SUBDIR}/`basename "${dst}"`/TAG" >&2
373
-
374
-      rmdir_safer "${dst}.failed"
375
-      exekutor mv "${dst}" "${dst}.failed"
376
-      exit 1
377
-   fi
378
-}
379
-
380
-
381
-git_clone()
382
-{
383
-   local src
384
-   local dst
385
-   local tag
386
-
387
-   src="$1"
388
-   dst="$2"
389
-   tag="$3"
390
-
391
-   [ ! -z "$src" ] || internal_fail "src is empty"
392
-   [ ! -z "$dst" ] || internal_fail "dst is empty"
393
-
394
-   log_info "Cloning ${C_MAGENTA}${src}${C_INFO} ..."
395
-   exekutor git clone ${GITFLAGS} "${src}" "${dst}" || fail "git clone of \"${src}\" into \"${dst}\" failed"
396
-
397
-   if [ "${tag}" != "" ]
398
-   then
399
-      git_checkout_tag "${dst}" "${tag}"
400
-   fi
401
-}
402
-
403
-
404
-git_pull()
405
-{
406
-   local dst
407
-   local tag
408
-
409
-   dst="$1"
410
-   tag="$2"
411
-
412
-   [ ! -z "$dst" ] || internal_fail "dst is empty"
413
-
414
-   log_info "Updating ${C_RESET}${dst}${C_INFO} ..."
415
-   ( exekutor cd "${dst}" ; exekutor git pull ${GITFLAGS} ) || fail "git pull of \"${dst}\" failed"
416
-
417
-   if [ "${tag}" != "" ]
418
-   then
419
-      git_checkout_tag "${dst}" "${tag}"
420
-   fi
421
-}
422
-
423
-
424
-INHERIT_SETTINGS="taps brews gits pips gems settings/build_order settings/build_ignore"
425
-
358
+INHERIT_SETTINGS='taps brews repositories pips gems settings/build_order settings/build_ignore'
426 359
 
427 360
 bootstrap_auto_update()
428 361
 {
429
-   local dst
430
-
431
-   dst="$1"
362
+   local name
363
+   local url
364
+   local dir
432 365
 
433
-   [ ! -z "${dst}" ] || internal_fail "dst was empty"
434
-   [ "${PWD}" != "${dst}" ] || internal_fail "configuration error"
366
+   name="$1"
367
+   url="$2"
368
+   dir="$3"
435 369
 
436
-   local name
370
+   [ ! -z "${dir}" ]        || internal_fail "src was empty"
371
+   [ "${PWD}" != "${dir}" ] || internal_fail "configuration error"
437 372
 
438
-   name="`basename "${dst}"`"
439 373
 
440 374
    # contains own bootstrap ? and not a symlink
441
-   if [ ! -d "${dst}/.bootstrap" ] # -a ! -L "${dst}" ]
375
+   if [ ! -d "${dir}/.bootstrap" ] # -a ! -L "${dst}" ]
442 376
    then
443
-      log_fluff "no .bootstrap folder in \"${dst}\" found"
377
+      log_fluff "no .bootstrap folder in \"${dir}\" found"
444 378
       return 1
445 379
    fi
446 380
 
447
-   log_info "Recursively acquiring ${dstdir} .bootstrap settings ..."
381
+   log_info "Recursively acquiring ${dir} .bootstrap settings ..."
448 382
 
383
+   #
449 384
    # prepare auto folder if it doesn't exist yet
385
+   # means copy our own files to .auto first
386
+   #
450 387
    if [ ! -d "${BOOTSTRAP_SUBDIR}.auto" ]
451 388
    then
452
-      log_info "Found a .bootstrap folder for `basename "${dst}"` will set up ${BOOTSTRAP_SUBDIR}.auto"
389
+      log_info "Found a .bootstrap folder for \"${name}\" will set up ${BOOTSTRAP_SUBDIR}.auto"
453 390
 
454 391
       mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto/settings"
455 392
       for i in $INHERIT_SETTINGS
456 393
       do
457 394
          if [ -f "${BOOTSTRAP_SUBDIR}.local/${i}" ]
458 395
          then
459
-            exekutor cp "${BOOTSTRAP_SUBDIR}}.local/${i}" "${BOOTSTRAP_SUBDIR}.auto/${i}" || exit 1
396
+            exekutor cp "${BOOTSTRAP_SUBDIR}.local/${i}" "${BOOTSTRAP_SUBDIR}.auto/${i}" || exit 1
460 397
          else
461 398
             if [ -f "${BOOTSTRAP_SUBDIR}/${i}" ]
462 399
             then
... ...
@@ -464,6 +401,8 @@ bootstrap_auto_update()
464 401
             fi
465 402
          fi
466 403
       done
404
+
405
+      # leave .scm files behind
467 406
    fi
468 407
 
469 408
    #
... ...
@@ -476,7 +415,7 @@ bootstrap_auto_update()
476 415
 
477 416
    for i in $INHERIT_SETTINGS
478 417
    do
479
-      srcfile="${dst}/.bootstrap/${i}"
418
+      srcfile="${dir}/.bootstrap/${i}"
480 419
       dstfile="${BOOTSTRAP_SUBDIR}.auto/${i}"
481 420
       if [ -f "${srcfile}" ]
482 421
       then
... ...
@@ -498,28 +437,34 @@ bootstrap_auto_update()
498 437
       fi
499 438
    done
500 439
 
440
+   # link scm files over, that we find
441
+   local relative
442
+
443
+   relative="`compute_relative "${BOOTSTRAP_SUBDIR}"`"
444
+   exekutor find "${dir}/.bootstrap" -xdev -mindepth 1 -maxdepth 1 -name "*.scm" -type f -print0 | \
445
+         exekutor xargs -0 -I % ln -s -f "${relative}/../"% "${BOOTSTRAP_SUBDIR}.auto/${name}"
446
+
501 447
    #
502 448
    # link up other non-inheriting settings
503 449
    #
504
-   if dir_has_files "${dst}/.bootstrap/settings"
450
+   if dir_has_files "${dir}/.bootstrap/settings"
505 451
    then
506 452
       local relative
507 453
 
508 454
       log_fluff "Link up build settings of \"${name}\" to \"${BOOTSTRAP_SUBDIR}.auto/settings/${name}\""
509 455
 
510 456
       mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
511
-      relative="`compute_relative "${BOOTSTRAP_SUBDIR}"`"
512
-      exekutor find "${dst}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type f -print0 | \
457
+      exekutor find "${dir}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type f -print0 | \
513 458
          exekutor xargs -0 -I % ln -s -f "${relative}/../../"% "${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
514 459
 
515
-      if [ -e "${dst}/.bootstrap/settings/bin"  ]
460
+      if [ -e "${dir}/.bootstrap/settings/bin"  ]
516 461
       then
517
-         exekutor ln -s -f "${relative}/../../${dst}/.bootstrap/settings/bin" "${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
462
+         exekutor ln -s -f "${relative}/../../${dir}/.bootstrap/settings/bin" "${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
518 463
       fi
519 464
 
520 465
       # flatten other folders into our own settings
521 466
       # don't force though, keep first
522
-      exekutor find "${dst}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type d -print0 | \
467
+      exekutor find "${dir}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type d -print0 | \
523 468
          exekutor xargs -0 -I % ln -s "${relative}/../"% "${BOOTSTRAP_SUBDIR}.auto/settings"
524 469
    fi
525 470
 
... ...
@@ -537,11 +482,6 @@ ensure_clones_directory()
537 482
       fi
538 483
       mkdir_if_missing "${CLONES_FETCH_SUBDIR}"
539 484
    fi
540
-
541
-   if [ -d "${BOOTSTRAP_SUBDIR}.auto" ]
542
-   then
543
-      log_warning "Folder ${C_RESET}${BOOTSTRAP_SUBDIR}.auto${C_WARNING} already exists!"
544
-   fi
545 485
 }
546 486
 
547 487
 
... ...
@@ -582,7 +522,6 @@ mark_alive()
582 522
    name="$1"
583 523
    dstdir="$2"
584 524
 
585
-   local permission
586 525
    local zombie
587 526
 
588 527
    zombie="`dirname "${dstdir}"`/.zombies/${name}"
... ...
@@ -592,14 +531,14 @@ mark_alive()
592 531
    then
593 532
       if [ -e "${zombie}" ]
594 533
       then
595
-         log_fluff "Mark ${C_RESET}${dstdir}${C_FLUFF} as alive"
534
+         log_fluff "Mark \"${dstdir}\" as alive"
596 535
 
597 536
          exekutor rm -f "${zombie}" || fail "failed to delete zombie ${zombie}"
598 537
       else
599
-         log_fluff "Marked ${C_RESET}${dstdir}${C_FLUFF} is already alive"
538
+         log_fluff "Marked \"${dstdir}\" is already alive"
600 539
       fi
601 540
    else
602
-      log_fluff "${C_RESET}${dstdir}${C_FLUFF} is neither a symlink nor a directory"
541
+      log_fluff "\"${dstdir}\" is neither a symlink nor a directory"
603 542
    fi
604 543
 }
605 544
 
... ...
@@ -607,46 +546,42 @@ mark_alive()
607 546
 log_fetch_action()
608 547
 {
609 548
    local dstdir
610
-   local clone
549
+   local url
611 550
 
612
-   clone="$1"
551
+   url="$1"
613 552
    dstdir="$2"
614 553
 
615 554
    local info
616 555
 
617
-   if [ -L "${clone}" ]
556
+   if [ -L "${url}" ]
618 557
    then
619 558
       info=" symlinked "
620 559
    else
621 560
       info=" "
622 561
    fi
623 562
 
624
-   log_fluff "Perform ${COMMAND}${info}${clone} in ${dstdir} ..."
563
+   log_fluff "Perform ${COMMAND}${info}${url} in ${dstdir} ..."
625 564
 }
626 565
 
627 566
 
628 567
 checkout()
629 568
 {
630
-   local clone
569
+   local url
631 570
    local name
632
-   local tag
633 571
    local dstdir
572
+   local tag
634 573
 
635
-   clone="$1"
636
-   name="$2"
574
+   name="$1"
575
+   url="$2"
637 576
    dstdir="$3"
638 577
    tag="$4"
639 578
 
640
-   [ ! -z "$clone" ]  || internal_fail "clone is empty"
641 579
    [ ! -z "$name" ]   || internal_fail "name is empty"
580
+   [ ! -z "$url" ]    || internal_fail "url is empty"
642 581
    [ ! -z "$dstdir" ] || internal_fail "dstdir is empty"
643 582
 
644
-   local srcname
645
-   local operation
646
-   local flag
647
-   local found
648
-   local name2
649 583
    local relative
584
+   local name2
650 585
 
651 586
    relative="`dirname "${dstdir}"`"
652 587
    relative="`compute_relative "${relative}"`"
... ...
@@ -654,7 +589,7 @@ checkout()
654 589
    then
655 590
       relative="${relative}/"
656 591
    fi
657
-   name2="`basename "${clone}"`"
592
+   name2="`basename "${url}"`"  # only works for git really
658 593
 
659 594
    #
660 595
    # this implicitly ensures, that these folders are
... ...
@@ -663,23 +598,43 @@ checkout()
663 598
 
664 599
    if [ -e "${DEPENDENCY_SUBDIR}" -o -e "${CLONESBUILD_SUBDIR}" ]
665 600
    then
666
-      log_error "Stale folders ${C_RESET}${DEPENDENCY_SUBDIR}${C_ERROR} and/or ${C_RESET}${CLONESBUILD_SUBDIR}${C_ERROR} found."
601
+      log_error "Stale folders \"${DEPENDENCY_SUBDIR}\" and/or \"${CLONESBUILD_SUBDIR}\" found."
667 602
       log_error "Please remove them before continuing."
668 603
       log_info  "Suggested command: ${C_RESET}mulle-bootstrap clean output${C_INFO}"
669 604
       exit 1
670 605
    fi
671 606
 
672
-   srcname="${clone}"
607
+   local operation
608
+   local map
609
+
610
+   map="`read_fetch_setting "${name}.scm"`"
611
+   case "${map}" in
612
+      git|"" )
613
+         operation="git_clone"
614
+         ;;
615
+      svn)
616
+         operation="svn_checkout"
617
+         ;;
618
+
619
+      *)
620
+         fail "unknown scm system ${map}"
621
+         ;;
622
+   esac
623
+
624
+   local found
625
+   local src
626
+   local script
627
+
628
+   src="${url}"
673 629
    script="`find_repo_setting_file "${name}" "bin/${COMMAND}.sh"`"
674
-   operation="git_clone"
675 630
 
676 631
    if [ ! -z "${script}" ]
677 632
    then
678 633
       run_script "${script}" "$@"
679 634
    else
680
-      case "${clone}" in
635
+      case "${url}" in
681 636
          /*)
682
-            ask_symlink_it "${clone}"
637
+            ask_symlink_it "${src}"
683 638
             if [ $? -eq 0 ]
684 639
             then
685 640
                operation=link_command
... ...
@@ -687,11 +642,12 @@ checkout()
687 642
          ;;
688 643
 
689 644
          ../*|./*)
690
-            ask_symlink_it "${clone}"
645
+            src="${url}"
646
+            ask_symlink_it "${src}"
691 647
             if [ $? -eq 0 ]
692 648
             then
693 649
                operation=link_command
694
-               srcname="${relative}${clone}"
650
+               src="${relative}${url}"
695 651
             fi
696 652
          ;;
697 653
 
... ...
@@ -721,19 +677,19 @@ directory of this project.
721 677
 Use it ?"
722 678
                if [ $? -eq 0 ]
723 679
                then
724
-                  srcname="${found}"
725
-                  ask_symlink_it "${srcname}"
680
+                  src="${found}"
681
+                  ask_symlink_it "${src}"
726 682
                   if [ $? -eq 0 ]
727 683
                   then
728 684
                      operation=link_command
729
-                     srcname="${relative}${found}"
685
+                     src="${relative}${found}"
730 686
                   fi
731 687
                fi
732 688
             fi
733 689
          ;;
734 690
       esac
735 691
 
736
-      "${operation}" "${srcname}" "${dstdir}" "${tag}"
692
+      "${operation}" "${src}" "${dstdir}" "${tag}"
737 693
       mulle-bootstrap-warn-scripts.sh "${dstdir}/.bootstrap" "${dstdir}" || fail "Ok, aborted"  #sic
738 694
    fi
739 695
 }
... ...
@@ -752,8 +708,10 @@ checkout_repository()
752 708
    local dstdir
753 709
    local name
754 710
    local flag
711
+   local url
755 712
 
756
-   name="$2"
713
+   name="$1"
714
+   url="$2"
757 715
    dstdir="$3"
758 716
 
759 717
    if [ ! -e "${dstdir}" ]
... ...
@@ -763,11 +721,11 @@ checkout_repository()
763 721
 
764 722
       if [ "${COMMAND}" = "install" -a "${DONT_RECURSE}" = "" ]
765 723
       then
766