Browse code

with 1848 trace turn of -x inside settings, because it's boring fix mulle-bootstrap-xcode which was broken.

Nat! authored on 05-10-2015 19:25:21
Showing 4 changed files
... ...
@@ -202,9 +202,76 @@ path_depth()
202 202
 }
203 203
 
204 204
 
205
+#
206
+# stolen from:
207
+# http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
208
+# ----
209
+#
210
+_prepend_path_if_relative()
211
+{
212
+   case "$2" in
213
+      /* )
214
+         echo "$2"
215
+         ;;
216
+      * )
217
+         echo "$1/$2"
218
+         ;;
219
+   esac
220
+}
221
+
222
+
223
+resolve_symlinks()
224
+{
225
+   local dir_context path
226
+
227
+   path="`readlink "$1"`"
228
+   if [ $? -eq 0 ]
229
+   then
230
+      dir_context=`dirname "$1"`
231
+      resolve_symlinks "`_prepend_path_if_relative "$dir_context" "$path"`"
232
+   else
233
+      echo "$1"
234
+   fi
235
+}
236
+
237
+
238
+_canonicalize_dir_path()
239
+{
240
+    (cd "$1" 2>/dev/null && pwd -P)
241
+}
242
+
243
+
244
+_canonicalize_file_path()
245
+{
246
+    local dir file
247
+
248
+    dir="` dirname "$1"`"
249
+    file="`basename "$1"`"
250
+    (cd "${dir}" 2>/dev/null && echo "`pwd -P`/${file}")
251
+}
252
+
253
+
254
+canonicalize_path()
255
+{
256
+   if [ -d "$1" ]
257
+   then
258
+      _canonicalize_dir_path "$1"
259
+   else
260
+      _canonicalize_file_path "$1"
261
+   fi
262
+}
263
+
264
+
265
+realpath()
266
+{
267
+   canonicalize_path "`resolve_symlinks "$1"`"
268
+}
269
+
270
+# ----
271
+
205 272
 relative_path_between()
206 273
 {
207
-   python -c "import os.path; print os.path.relpath(\'$1\', \'$2\')"
274
+   python -c "import os.path; print os.path.relpath( '$1', '$2')"
208 275
 }
209 276
 
210 277
 
... ...
@@ -56,6 +56,7 @@ case "${MULLE_BOOTSTRAP_TRACE}" in
56 56
       log_trace "FULL trace started"
57 57
       ;;
58 58
    1848)
59
+      MULLE_BOOTSTRAP_SETTINGS_FLIP_X="YES"
59 60
       MULLE_BOOTSTRAP_TRACE_SETTINGS="NO"
60 61
       MULLE_BOOTSTRAP_VERBOSE="YES"
61 62
       MULLE_BOOTSTRAP_TRACE="YES"
... ...
@@ -253,8 +253,12 @@ _read_build_setting()
253 253
 #
254 254
 read_config_setting()
255 255
 {
256
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
257
+   then
258
+      set +x
259
+   fi
260
+
256 261
    local name
257
-   local value
258 262
    local default
259 263
 
260 264
    [ $# -lt 1 -o $# -gt 2 ] && internal_fail "parameterization error"
... ...
@@ -262,6 +266,8 @@ read_config_setting()
262 266
    name="$1"
263 267
    default="$2"
264 268
 
269
+   local value
270
+
265 271
    value="`_read_environment_setting "${name}"`"
266 272
    if [ $? -ne 0 ]
267 273
    then
... ...
@@ -278,6 +284,11 @@ read_config_setting()
278 284
 
279 285
    echo "$value"
280 286
 
287
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
288
+   then
289
+      set -x
290
+   fi
291
+
281 292
    [ "${value}" = "${default}" ]
282 293
    return $?
283 294
 }
... ...
@@ -285,8 +296,12 @@ read_config_setting()
285 296
 
286 297
 read_build_setting()
287 298
 {
299
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
300
+   then
301
+      set +x
302
+   fi
303
+
288 304
    local name
289
-   local value
290 305
    local default
291 306
    local package
292 307
 
... ...
@@ -296,6 +311,8 @@ read_build_setting()
296 311
    name="$2"
297 312
    default="$3"
298 313
 
314
+   local value
315
+
299 316
    value=`_read_repo_setting "${package}" "${name}"`
300 317
    if [ $? -ne 0 ]
301 318
    then
... ...
@@ -307,6 +324,11 @@ read_build_setting()
307 324
    fi
308 325
    echo "$value"
309 326
 
327
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
328
+   then
329
+      set -x
330
+   fi
331
+
310 332
    [ "${value}" = "${default}" ]
311 333
    return $?
312 334
 }
... ...
@@ -314,7 +336,11 @@ read_build_setting()
314 336
 
315 337
 read_repo_setting()
316 338
 {
317
-   local value
339
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
340
+   then
341
+      set +x
342
+   fi
343
+
318 344
    local name
319 345
    local default
320 346
    local package
... ...
@@ -325,6 +351,8 @@ read_repo_setting()
325 351
    name="$2"
326 352
    default="$3"
327 353
 
354
+   local value
355
+
328 356
    value="`_read_repo_setting "${package}" "${name}"`"
329 357
    if [ $? -ne 0 ]
330 358
    then
... ...
@@ -333,6 +361,11 @@ read_repo_setting()
333 361
 
334 362
    echo "$value"
335 363
 
364
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
365
+   then
366
+      set -x
367
+   fi
368
+
336 369
    [ "${value}" = "${default}" ]
337 370
    return $?
338 371
 }
... ...
@@ -340,6 +373,11 @@ read_repo_setting()
340 373
 
341 374
 read_build_root_setting()
342 375
 {
376
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
377
+   then
378
+      set +x
379
+   fi
380
+
343 381
    local value
344 382
    local name
345 383
    local default
... ...
@@ -357,6 +395,11 @@ read_build_root_setting()
357 395
 
358 396
    echo "$value"
359 397
 
398
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
399
+   then
400
+      set -x
401
+   fi
402
+
360 403
    [ "${value}" = "${default}" ]
361 404
    return $?
362 405
 }
... ...
@@ -364,6 +407,11 @@ read_build_root_setting()
364 407
 
365 408
 read_fetch_setting()
366 409
 {
410
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
411
+   then
412
+      set +x
413
+   fi
414
+
367 415
    local value
368 416
    local default
369 417
    local name
... ...
@@ -379,6 +427,11 @@ read_fetch_setting()
379 427
 
380 428
    echo "$value"
381 429
 
430
+   if [ "{MULLE_BOOTSTRAP_SETTINGS_FLIP_X}" = "YES" ]
431
+   then
432
+      set -x
433
+   fi
434
+
382 435
    [ "${value}" = "${default}" ]
383 436
    return $?
384 437
 }
... ...
@@ -277,12 +277,15 @@ Release"
277 277
 
278 278
    #  figure out a way to make this nicer
279 279
    local absolute
280
+   local absolute2
280 281
    local relative_subdir
281 282
 
282
-   absolute="`readlink -f "${project}"`"
283
-   relative_subdir=`relative_path_between "${absolute}" "$(PWD)"/${DEPENDENCY_SUBDIR}`
283
+   absolute="`realpath "${project}"`"
284
+   absolute="`dirname "${absolute}"`"
285
+   absolute2="`pwd -P`/${DEPENDENCY_SUBDIR}"
286
+   relative_subdir="`relative_path_between "${absolute2}" "${absolute}" `"
284 287
 
285
-   dependencies_dir='$(PROJECT_DIR)'"${relative_subdir}"
288
+   dependencies_dir='$(PROJECT_DIR)/'"${relative_subdir}"
286 289
 
287 290
    header_search_paths="\$(DEPENDENCIES_DIR)/${HEADER_DIR_NAME}"
288 291
    header_search_paths="${header_search_paths} /usr/local/include"