Browse code

0.9 with much better (working) support for Frameworks amongst other things

Nat! authored on 15-10-2015 11:55:08
Showing 9 changed files
... ...
@@ -1,3 +1,26 @@
1
+0.9
2
+===
3
+   Specifying repos with mulle-bootstrap build <repos> was broken.
4
+   Added -y option, so everything is answered YES. I use this all the time.
5
+   Log xcodebuild command line into logfile.
6
+   Fix useless errors during dry run.
7
+   ** Changed the way custom "build.sh" scripts are executed. **
8
+   You can give a xcodeproj to mulle-bootstrap xcode directly, nice for
9
+   sharing  dependencies with many subprojects.
10
+   Fixes the collection and dispensal of built frameworks.
11
+   Added logging to various 'cd' commands.
12
+   Collect and dispense symbolic links for directories too (not just for files)
13
+   Beautified output a little bit.
14
+   Respect the terse flag (-s) during mulle-bootstrap xcode add.
15
+   Add VENDOR_PREFIX to mulle-bootstrap-tag as third parameter.
16
+
17
+
18
+0.8.1
19
+===
20
+   And the fix, just minutes after the "release". warn scripts didn't
21
+   find a function, and now I have cleaned this up properly, I think.
22
+   No more duplicate functions.
23
+
1 24
 0.8
2 25
 ===
3 26
    Added dist shortcut, because I always like to type "dist-clean".
... ...
@@ -29,7 +29,7 @@
29 29
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 
32
-VERSION=0.8.1
32
+VERSION=0.9
33 33
 
34 34
 #
35 35
 # This is the main user interface to mulle-bootstrap
... ...
@@ -43,13 +43,21 @@ export PATH
43 43
 #
44 44
 # simple option handling
45 45
 #
46
-if [ "$1" = "-a" ] # silent
46
+if [ "$1" = "-a" ]
47 47
 then
48 48
    MULLE_BOOTSTRAP_ANSWER="NO"
49 49
    export MULLE_BOOTSTRAP_ANSWER
50 50
    shift
51
+else
52
+   if [ "$1" = "-y" ] #  basically auto symlink everything
53
+   then
54
+      MULLE_BOOTSTRAP_ANSWER="YES"
55
+      export MULLE_BOOTSTRAP_ANSWER
56
+      shift
57
+   fi
51 58
 fi
52 59
 
60
+
53 61
 if [ "$1" = "-n" ]
54 62
 then
55 63
    MULLE_BOOTSTRAP_DRY_RUN="YES"
... ...
@@ -95,13 +103,14 @@ fi
95 103
 usage()
96 104
 {
97 105
    cat <<EOF
98
-usage: mulle-bootstrap [-n][-v|-s][-a] [command] [--help]
106
+usage: mulle-bootstrap [-a|y][-n][-v|-s] [command] [--help]
99 107
        version ${VERSION}
100 108
 
101 109
  Specify the -h or --help option after each command to get more help.
102 110
 
103 111
  Flags (-n must be first, if present)
104 112
    -a        : always chose default answer to questions
113
+   -y        : always say yes to questions (scripts wont be checked)
105 114
    -n        : do nothing creative or destructive
106 115
    -v        : be more verbose (-V even more verbose)
107 116
    -s        : be more terse
... ...
@@ -153,7 +162,7 @@ bootstrap()
153 162
       . install.sh "$@"
154 163
       export MULLE_BOOTSTRAP=mulle-bootstrap
155 164
    else
156
-      mulle-bootstrap-warn-scripts.sh "${BOOTSTRAP_SUBDIR}"  || fail "Ok, aborted."
165
+      mulle-bootstrap-warn-scripts.sh "${BOOTSTRAP_SUBDIR}" || exit 1
157 166
    fi
158 167
 
159 168
    if [ "${DONT_RECURSE}" = "" ]
... ...
@@ -197,7 +206,7 @@ main()
197 206
          ;;
198 207
 
199 208
       fetch)
200
-         mulle-bootstrap-fetch.sh "$@" || exit 1
209
+         DONT_ASK_AFTER_WARNING=YES mulle-bootstrap-fetch.sh "$@" || exit 1
201 210
          ;;
202 211
 
203 212
       update)
... ...
@@ -73,7 +73,7 @@ dispense_headers()
73 73
    local headers
74 74
    local suffix
75 75
 
76
-   log_fluff "Consider copying headers from \"${src}\""
76
+   log_fluff "Consider copying headers from ${C_WHITE}${src}${C_FLUFF}"
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 \"${src}\" to \"${dst}\""
87
+         log_fluff "Copying ${C_WHITE}${src}${C_FLUFF} to ${C_WHITE}${dst}${C_FLUFF}"
88 88
          exekutor find -x "${src}" ! -path "${src}" -depth 1 -type d -print0 | \
89 89
             exekutor xargs -0 -J % mv -v -n % "${dst}"
90 90
          [ $? -eq 0 ]  || exit 1
... ...
@@ -118,13 +118,9 @@ dispense_binaries()
118 118
    local usrlocal
119 119
    local findtype2
120 120
 
121
-   findtype2="${findtype}"
122
-   if [ "${findtype}" = "f" ]
123
-   then
124
-      findtype2="l"
125
-   fi
121
+   findtype2="l"
126 122
 
127
-   log_fluff "Consider copying binaries from \"${src}\" for type \"${findtype}/${findtype2}\""
123
+   log_fluff "Consider copying binaries from ${C_WHITE}${src}${C_FLUFF} for type \"${findtype}/${findtype2}\""
128 124
 
129 125
    if [ -d "${src}" ]
130 126
    then
... ...
@@ -132,7 +128,7 @@ dispense_binaries()
132 128
       then
133 129
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${subpath}${subdir}"
134 130
 
135
-         log_fluff "Copying \"${src}\" to \"${dst}\""
131
+         log_fluff "Copying ${C_WHITE}${src}${C_FLUFF} to ${C_WHITE}${dst}${C_FLUFF}"
136 132
          mkdir_if_missing "${dst}"
137 133
          exekutor find -x "${src}" ! -path "${src}" \( -type "${findtype}" -o -type "${findtype2}" \) -depth 1 -print0 | \
138 134
             exekutor xargs -0 -J % mv -v -n % "${dst}"
... ...
@@ -160,7 +156,13 @@ collect_and_dispense_product()
160 156
    local  dst
161 157
    local  src
162 158
 
163
-   log_info "Collecting and dispensing \"${name}\" \"`basename "${subdir}"`\" products "
159
+   if read_yes_no_config_setting "skip_collect_and_dispense" "NO"
160
+   then
161
+      log_info "Skipped collection and dispensal on request"
162
+      return 0
163
+   fi
164
+
165
+   log_info "Collecting and dispensing ${C_WHITE}{name}${C_INFO} ${C_MAGENTA}`basename "${subdir}"`${C_INFO} products "
164 166
    #
165 167
    # probably should use install_name_tool to hack all dylib paths that contain .ref
166 168
    # (will this work with signing stuff ?)
... ...
@@ -181,8 +183,11 @@ collect_and_dispense_product()
181 183
       src="${BUILD_DEPENDENCY_SUBDIR}/lib${subdir}"
182 184
       dispense_binaries "${name}" "${src}" "f" "/${LIBRARY_DIR_NAME}"
183 185
 
186
+      src="${BUILD_DEPENDENCY_SUBDIR}/Library/Frameworks${subdir}"
187
+      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
188
+
184 189
       src="${BUILD_DEPENDENCY_SUBDIR}/Frameworks${subdir}"
185
-      dispense_binaries "${name}" "${src}" "d" "${FRAMEWORK_PATH}"
190
+      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
186 191
    else
187 192
       log_fluff "Choosing cmake/configure dispense path"
188 193
 
... ...
@@ -192,9 +197,15 @@ collect_and_dispense_product()
192 197
       src="${BUILD_DEPENDENCY_SUBDIR}/usr/local/lib"
193 198
       dispense_binaries "${name}" "${src}" "f" "/${LIBRARY_DIR_NAME}"
194 199
 
195
-      # coming from Cmake and configure
200
+      # coming from Cmake and configure ?
196 201
       src="${BUILD_DEPENDENCY_SUBDIR}/usr/local/Frameworks"
197
-      dispense_binaries "${name}" "${src}" "d" "${FRAMEWORK_PATH}"
202
+      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
203
+
204
+      src="${BUILD_DEPENDENCY_SUBDIR}/Library/Frameworks"
205
+      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
206
+
207
+      src="${BUILD_DEPENDENCY_SUBDIR}/Frameworks"
208
+      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
198 209
    fi
199 210
 
200 211
    #
... ...
@@ -236,7 +247,7 @@ collect_and_dispense_product()
236 247
       then
237 248
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${usrlocal}"
238 249
 
239
-         log_fluff "Copying \"${src}/*\" to \"${dst}\""
250
+         log_fluff "Copying everything from ${C_WHITE}${src}${C_FLUFF} to ${C_WHITE}${dst}${C_FLUFF}"
240 251
          exekutor find -x "${src}" ! -path "${src}" -depth 1 -print0 | \
241 252
                exekutor xargs -0 -J % mv -v -n % "${dst}"
242 253
          [ $? -eq 0 ]  || fail "moving files from ${src} to ${dst} failed"
... ...
@@ -246,7 +257,7 @@ collect_and_dispense_product()
246 257
       then
247 258
          if dir_has_files "${BUILD_DEPENDENCY_SUBDIR}"
248 259
          then
249
-            log_fluff "Directory \"${BUILD_DEPENDENCY_SUBDIR}\" contained files after collect and dispense"
260
+            log_fluff "Directory ${C_WHITE}${BUILD_DEPENDENCY_SUBDIR}${C_FLUFF} contained files after collect and dispense"
250 261
             log_fluff "--------------------"
251 262
             ( cd "${BUILD_DEPENDENCY_SUBDIR}" ; ls -lR >&2 )
252 263
             log_fluff "--------------------"
... ...
@@ -270,7 +281,7 @@ enforce_build_sanity()
270 281
    # these must not exist
271 282
    if [ -d "${BUILD_DEPENDENCY_SUBDIR}" ]
272 283
    then
273
-      fail "A previous build left ${BUILD_DEPENDENCY_SUBDIR}, can't continue"
284
+      fail "A previous build left ${C_WHITE}${BUILD_DEPENDENCY_SUBDIR}${C_ERROR}, can't continue"
274 285
    fi
275 286
 }
276 287
 
... ...
@@ -348,9 +359,12 @@ create_dummy_dirs_against_warnings()
348 359
 
349 360
 build_fail()
350 361
 {
351
-   printf "${C_RED}"
352
-   grep -A5 "error:" "${1}" >&2
353
-   printf "${C_RESET}"
362
+   if [ -f "${1}" ]
363
+   then
364
+      printf "${C_RED}"
365
+      grep -A5 "error:" "${1}" >&2
366
+      printf "${C_RESET}"
367
+   fi
354 368
 
355 369
    fail "$2 failed"
356 370
 }
... ...
@@ -399,12 +413,14 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
399 413
 
400 414
    create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}" "${relative}"
401 415
 
402
-   local logfile
416
+   local logfile1
417
+   local logfile2
403 418
 
404 419
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
405
-   logfile="${BUILDLOG_SUBDIR}/${name}"
420
+   logfile1="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.cmake.log"
421
+   logfile2="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.make.log"
406 422
 
407
-   log_info "Logs in \"${logfile}.cmake\" and \"${logfile}.make\""
423
+   log_info "Build logs will be in ${C_WHITE}${logfile1}${C_INFO} and ${C_WHITE}${logfile2}{C_INFO}"
408 424
 
409 425
    owd="${PWD}"
410 426
    mkdir_if_missing "${builddir}"
... ...
@@ -415,9 +431,15 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
415 431
       #
416 432
       set -f
417 433
 
418
-      logfile="${owd}/${logfile}"
434
+      logfile1="${owd}/${logfile}"
435
+      logfile2="${owd}/${logfile}"
436
+      if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
437
+      then
438
+         logfile1="/dev/null"
439
+         logfile2="/dev/null"
440
+      fi
419 441
 
420
-      exekutor cmake "-DCMAKE_BUILD_TYPE=${mapped}" \
442
+      logging_exekutor cmake "-DCMAKE_BUILD_TYPE=${mapped}" \
421 443
 "-DCMAKE_INSTALL_PREFIX:PATH=${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local"  \
422 444
 "-DCMAKE_C_FLAGS=\
423 445
 -I${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
... ...
@@ -442,9 +464,9 @@ ${sdk}" \
442 464
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
443 465
 ${other_ldflags} \
444 466
 ${sdk}" \
445
-"${relative}/${srcdir}" > "${logfile}.cmake" || build_fail "${logfile}.cmake" "cmake"
467
+"${relative}/${srcdir}" >> "${logfile1}" || build_fail "${logfile1}" "cmake"
446 468
 
447
-      exekutor make all install > "${logfile}.make" || build_fail "${logfile}.make" "make"
469
+      logging_exekutor make all install >> "${logfile2}" || build_fail "${logfile2}" "make"
448 470
 
449 471
       set +f
450 472
 
... ...
@@ -498,12 +520,14 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
498 520
 
499 521
    create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}" "${relative}"
500 522
 
501
-   local logfile
523
+   local logfile1
524
+   local logfile2
502 525
 
503 526
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
504
-   logfile="${BUILDLOG_SUBDIR}/${name}"
527
+   logfile1="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.configure.log"
528
+   logfile2="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.make.log"
505 529
 
506
-   log_info "Logs in \"${logfile}.configure\" and \"${logfile}.make\""
530
+   log_info "Build logs will be in ${C_WHITE}${logfile1}${C_INFO} and ${C_WHITE}${logfile2}{C_INFO}"
507 531
 
508 532
    owd="${PWD}"
509 533
    mkdir_if_missing "${builddir}"
... ...
@@ -511,10 +535,16 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
511 535
 
512 536
        set -f
513 537
 
514
-      logfile="${owd}/${logfile}"
538
+      logfile1="${owd}/${logfile}"
539
+      logfile2="${owd}/${logfile}"
540
+      if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
541
+      then
542
+         logfile1="/dev/null"
543
+         logfile2="/dev/null"
544
+      fi
515 545
 
516 546
       # use absolute paths for configure, safer (and easier to read IMO)
517
-      CFLAGS="\
547
+      logging_exekutor CFLAGS="\
518 548
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
519 549
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
520 550
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
... ...
@@ -537,9 +567,12 @@ ${sdk}" \
537 567
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
538 568
 ${other_ldflags} \
539 569
 ${sdk}" \
540
-      exekutor "${owd}/${srcdir}/configure" --prefix "${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local" > "${logfile}.configure" || build_fail "${logfile}.configure" "configure"
570
+       "${owd}/${srcdir}/configure" \
571
+          --prefix "${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local" >> "${logfile1}" \
572
+      || build_fail "${logfile1}" "configure"
541 573
 
542
-      exekutor make all install > "${logfile}.make" || build_fail "${logfile}.make" "make"
574
+      logging_exekutor make all install >> "${logfile2}" \
575
+      || build_fail "${logfile2}" "make"
543 576
 
544 577
       set +f
545 578
 
... ...
@@ -558,8 +591,7 @@ xcode_get_setting()
558 591
 
559 592
    eval "xcodebuild -showBuildSettings $*" | \
560 593
    egrep "^[ ]*${key}" | \
561
-   sed 's/^[^=]*=[ ]*\(.*\)/\1/' || \
562
-   exit 1
594
+   sed 's/^[^=]*=[ ]*\(.*\)/\1/' || exit 1
563 595
 }
564 596
 
565 597
 
... ...
@@ -834,9 +866,9 @@ ${info} ..."
834 866
    local logfile
835 867
 
836 868
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
837
-   logfile="${BUILDLOG_SUBDIR}/${name}"
869
+      logfile="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}-${targetname}${schemename}"
838 870
 
839
-   log_info "Log in \"${logfile}.xcodebuild\""
871
+   log_info "Build log will be in ${C_WHITE}${logfile}.xcodebuild.log${C_INFO}"
840 872
 
841 873
    set -f
842 874
 
... ...
@@ -863,7 +895,7 @@ ${info} ..."
863 895
    fi
864 896
 
865 897
    owd=`pwd`
866
-   cd "${srcdir}" || exit 1
898
+   exekutor cd "${srcdir}" || exit 1
867 899
 
868 900
 
869 901
       logfile="${owd}/${logfile}"
... ...
@@ -947,11 +979,12 @@ HEADER_SEARCH_PATHS='${dependencies_header_search_path}' \
947 979
 LIBRARY_SEARCH_PATHS='${dependencies_lib_search_path}' \
948 980
 FRAMEWORK_SEARCH_PATHS='${dependencies_framework_search_path}'"
949 981
 
950
-      eval_exekutor "${cmdline}" > "${logfile}.xcodebuild" || build_fail "${logfile}.xcodebuild" "xcodebuild"
982
+      logging_eval_exekutor "${cmdline}" >> "${logfile}.xcodebuild.log" \
983
+      || build_fail "${logfile}.xcodebuild.log" "xcodebuild"
951 984
 
952 985
       set +f
953 986
 
954
-   cd "${owd}"
987
+   exekutor cd "${owd}"
955 988
 
956 989
    collect_and_dispense_product "${name}" "${suffix}" "YES" || exit 1
957 990
 }
... ...
@@ -1015,6 +1048,70 @@ build_xcodebuild_schemes_or_target()
1015 1048
 }
1016 1049
 
1017 1050
 
1051
+build_script()
1052
+{
1053
+   local script
1054
+
1055
+   script="$1"
1056
+   shift
1057
+
1058
+   local configuration
1059
+   local srcdir
1060
+   local builddir
1061
+   local relative
1062
+   local name
1063
+   local sdk
1064
+   local project
1065
+   local schemename
1066
+   local targetname
1067
+
1068
+   configuration="$1"
1069
+   srcdir="$2"
1070
+   builddir="$3"
1071
+   relative="$4"
1072
+   name="$5"
1073
+   sdk="$6"
1074
+
1075
+   local logfile
1076
+
1077
+   mkdir_if_missing "${BUILDLOG_SUBDIR}"
1078
+   logfile="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.script.log"
1079
+
1080
+   log_info "Build log will be in ${C_WHITE}${logfile}${C_INFO}"
1081
+
1082
+   local owd
1083
+
1084
+   owd=`pwd`
1085
+   exekutor cd "${srcdir}" || exit 1
1086
+
1087
+      logfile="${owd}/${logfile}"
1088
+      if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
1089
+      then
1090
+         logfile="/dev/null"
1091
+      fi
1092
+
1093
+      log_info "Running build script for ${C_MAGENTA}${configuration}${C_INFO}"
1094
+      run_log_script "${owd}/${script}" \
1095
+         "${configuration}" \
1096
+         "${owd}/${srcdir}" \
1097
+         "${owd}/${builddir}" \
1098
+         "${owd}/${BUILD_DEPENDENCY_SUBDIR}" \
1099
+         "${name}" \
1100
+         "${sdk}" >> "${logfile}" \
1101
+      || build_fail "${logfile}" "build.sh"
1102
+
1103
+   exekutor cd "${owd}"
1104
+
1105
+   local suffix
1106
+
1107
+   suffix="`determine_suffix "${configuration}" "${sdk}"`"
1108
+   collect_and_dispense_product "${name}" "${suffix}" || internal_fail "collect failed silently"
1109
+
1110
+   return $rval
1111
+}
1112
+
1113
+
1114
+
1018 1115
 build()
1019 1116
 {
1020 1117
    local srcdir
... ...
@@ -1067,7 +1164,7 @@ Release"`"
1067 1164
    do
1068 1165
       for configuration in ${configurations}
1069 1166
       do
1070
-         if [ "$/{configuration}" = "/${LIBRARY_DIR_NAME}" -o "/${configuration}" = "${HEADER_DIR_NAME}" -o "/${configuration}" = "${FRAMEWORK_PATH}" ]
1167
+         if [ "$/{configuration}" = "/${LIBRARY_DIR_NAME}" -o "/${configuration}" = "${HEADER_DIR_NAME}" -o "/${configuration}" = "${FRAMEWORK_DIR_NAME}" ]
1071 1168
          then
1072 1169
             fail "You are just asking for trouble."
1073 1170
          fi
... ...
@@ -1090,9 +1187,11 @@ Release"`"
1090 1187
                script="`find_build_setting_file "${name}" "bin/build.sh"`"
1091 1188
                if [ -x "${script}" ]
1092 1189
                then
1093
-                  run_script "${script}" "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}" || exit 1
1190
+                  build_script "${script}" "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}" || exit 1
1094 1191
                   hasbuilt=yes
1095 1192
                   break
1193
+               else
1194
+                  [ ! -e "${script}" ] || fail "script ${script} is not executable"
1096 1195
                fi
1097 1196
             fi
1098 1197
 
... ...
@@ -1173,6 +1272,8 @@ build_wrapper()
1173 1272
       rmdir_safer "${BUILD_DEPENDENCY_SUBDIR}"
1174 1273
    fi
1175 1274
 
1275
+   export BUILD_DEPENDENCY_SUBDIR
1276
+   export REFERENCE_DEPENDENCY_SUBDIR
1176 1277
    #
1177 1278
    # move dependencies we have so far away into safety,
1178 1279
    # need that path for includes though
... ...
@@ -1288,7 +1389,7 @@ build_clones()
1288 1389
 
1289 1390
          if [ -d "${dstdir}" ]
1290 1391
          then
1291
-            build_if_readable "${clone}" "${name}" || exit 1
1392
+            build_if_readable "${dstdir}" "${name}" || exit 1
1292 1393
          else
1293 1394
             fail "unknown repo ${name}"
1294 1395
          fi
... ...
@@ -1319,7 +1420,7 @@ install_tars()
1319 1420
          then
1320 1421
             fail "tarball \"$tar\" not found"
1321 1422
          else
1322
-            log_info "Installing tarball \"${tar}\""
1423
+            log_info "Installing tarball ${C_WHITE}${tar}${C_INFO}"
1323 1424
             exekutor tar -xz -C "${DEPENDENCY_SUBDIR}" -f "${tar}" || fail "failed to extract ${tar}"
1324 1425
          fi
1325 1426
       done
... ...
@@ -1352,7 +1453,7 @@ main()
1352 1453
          rmdir_safer "${DEPENDENCY_SUBDIR}"
1353 1454
       fi
1354 1455
    else
1355
-      log_fluff "Keep \"${DEPENDENCY_SUBDIR}\" intact, as this is a partial build"
1456
+      log_fluff "Keeping \"${DEPENDENCY_SUBDIR}\" intact, as this is a partial build."
1356 1457
    fi
1357 1458
 
1358 1459
    # if present then we didnt't want to clean and we do nothing special
... ...
@@ -1361,16 +1462,18 @@ main()
1361 1462
       mkdir_if_missing "${DEPENDENCY_SUBDIR}/usr/local/include"
1362 1463
       exekutor ln -s "usr/local/include" "${DEPENDENCY_SUBDIR}/include" || fail "failed to symlink future usr/local/include"
1363 1464
       install_tars "$@"
1465
+   else
1466
+      log_warning "Tars have not been installed, as ${C_WHITE}${DEPENDENCY_SUBDIR}${C_WARNING} already exists."
1364 1467
    fi
1365 1468
 
1366 1469
    build_clones "$@"
1367 1470
 
1368 1471
    if [ $# -eq 0 ]
1369 1472
    then
1370
-      if [ "${clean}" = "YES" ]
1473
+      if [ "${clean}" = "YES" -a -d "${DEPENDENCY_SUBDIR}" ]
1371 1474
       then
1372
-         log_info "Write-protecting \"${DEPENDENCY_SUBDIR}\" to avoid spurious header edits"
1373
-         chmod -R a-w "${DEPENDENCY_SUBDIR}"
1475
+         log_info "Write-protecting ${C_WHITE}${DEPENDENCY_SUBDIR}${C_INFO} to avoid spurious header edits"
1476
+         exekutor chmod -R a-w "${DEPENDENCY_SUBDIR}"
1374 1477
       fi
1375 1478
    fi
1376 1479
 }
... ...
@@ -35,7 +35,6 @@
35 35
 # You can also specify a list of "brew" dependencies. That
36 36
 # will be third party libraries, you don't tag or debug
37 37
 #
38
-. mulle-bootstrap-warn-scripts.sh
39 38
 . mulle-bootstrap-local-environment.sh
40 39
 . mulle-bootstrap-brew.sh
41 40
 . mulle-bootstrap-scripts.sh
... ...
@@ -163,7 +162,7 @@ install_brews()
163 162
 
164 163
 #
165 164
 # future, download tarballs...
166
-#
165
+# we check for existance during fetch, but install during build
167 166
 check_tars()
168 167
 {
169 168
    local tarballs
... ...
@@ -688,7 +687,7 @@ Use it ?"
688 687
       esac
689 688
 
690 689
       "${operation}" "${srcname}" "${dstname}" "${tag}"
691
-       warn_scripts "${dstname}/.bootstrap" "${dstname}" || fail "Ok, aborted"  #sic
690
+      mulle-bootstrap-warn-scripts.sh "${dstname}/.bootstrap" "${dstname}" || fail "Ok, aborted"  #sic
692 691
    fi
693 692
 }
694 693
 
... ...
@@ -823,7 +822,7 @@ update()
823 822
    tag="$4"
824 823
 
825 824
    [ ! -z "$clone" ] ||internal_fail "clone is empty"
826
-   [ -d "$dstname" ] || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
825
+   exekutor [ -d "$dstname" ] || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
827 826
    [ ! -z "$name" ]  || internal_fail "name is empty"
828 827
 
829 828
    local script
... ...
@@ -937,7 +936,7 @@ append_dir_to_gitignore_if_needed()
937 936
    grep -s -x "$1/" .gitignore > /dev/null 2>&1
938 937
    if [ $? -ne 0 ]
939 938
    then
940
-      echo "$1/" >> .gitignore || fail "Couldn't append to .gitignore"
939
+      exekutor echo "$1/" >> .gitignore || fail "Couldn't append to .gitignore"
941 940
       log_info "Added ${C_MAGENTA}$1/${C_INFO} to ${C_CYAN}.gitignore${C_INFO}"
942 941
    fi
943 942
 }
... ...
@@ -127,6 +127,13 @@ eval_exekutor()
127 127
 }
128 128
 
129 129
 
130
+logging_eval_exekutor()
131
+{
132
+   echo "$@"
133
+   eval_exekutor "$@"
134
+}
135
+
136
+
130 137
 exekutor()
131 138
 {
132 139
    if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" -o "$MULLE_BOOTSTRAP_TRACE" = "YES" ]
... ...
@@ -141,6 +148,13 @@ exekutor()
141 148
 }
142 149
 
143 150
 
151
+logging_exekutor()
152
+{
153
+   echo "$@"
154
+   exekutor "$@"
155
+}
156
+
157
+
144 158
 is_yes()
145 159
 {
146 160
    local s
... ...
@@ -485,7 +499,7 @@ run_script()
485 499
 
486 500
    if [ -x "${script}" ]
487 501
    then
488
-      log_info "Executing script ${script}"
502
+      log_info "Executing script ${C_WHITE}${script}${C_INFO}"
489 503
       exekutor "${script}" "$@" || fail "script \"${script}\" did not run successfully"
490 504
    else
491 505
       if [ ! -e "${script}" ]
... ...
@@ -496,3 +510,10 @@ run_script()
496 510
       fi
497 511
    fi
498 512
 }
513
+
514
+
515
+run_log_script()
516
+{
517
+   echo "$@"
518
+   run_script "$@"
519
+}
... ...
@@ -160,7 +160,7 @@ run_repo_settings_script()
160 160
    scriptname="$1"
161 161
    shift
162 162
 
163
-   [ -d "$dstname" ]      || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
163
+   exekutor [ -d "$dstname" ]      || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
164 164
    [ ! -z "$name" ]       || internal_fail "name is empty"
165 165
    [ ! -z "$scriptname" ] || internal_fail "scriptname is empty"
166 166
 
... ...
@@ -187,7 +187,7 @@ run_build_settings_script()
187 187
    scriptname="$1"
188 188
    shift
189 189
 
190
-   [ -d "$dstname" ]      || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
190
+   exekutor [ -d "$dstname" ]      || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
191 191
    [ ! -z "$name" ]       || internal_fail "name is empty"
192 192
    [ ! -z "$scriptname" ] || internal_fail "scriptname is empty"
193 193
 
... ...
@@ -38,13 +38,18 @@
38 38
 . mulle-bootstrap-local-environment.sh
39 39
 . mulle-bootstrap-scripts.sh
40 40
 
41
+
42
+name=`basename "${PWD}"`
43
+
44
+
41 45
 usage()
42 46
 {
43 47
    cat <<EOF
44
-usage: tag [tag] [vendortag]
48
+usage: tag [tag] [vendortag] [vendorprefix]
45 49
 
46
-   tag       : the tag for your repository ($PWD)
47
-   vendortag : the tag used for tagging the fetched repositories
50
+   tag          : the tag for your repository ($name)
51
+   vendortag    : the tag used for tagging the fetched repositories
52
+   vendorprefix : prefix for the vendortag, if vendortag is "-"
48 53
 EOF
49 54
 }
50 55
 
... ...
@@ -59,8 +64,6 @@ check_and_usage_and_help()
59 64
 }
60 65
 
61 66
 
62
-name=`basename "${PWD}"`
63
-
64 67
 project=`find_xcodeproj "${name}"`
65 68
 AGVTAG=
66 69
 
... ...
@@ -87,17 +90,31 @@ shift
87 90
 VENDOR_TAG="$1"
88 91
 shift
89 92
 
90
-if [ -z "${VENDOR_TAG}" ]
93
+VENDOR_PREFIX="$1"
94
+shift
95
+
96
+
97
+if [ -z "${VENDOR_TAG}" -o "${VENDOR_TAG}" = "-" ]
91 98
 then
92
-   prefix=`basename "${PWD}"`
93
-   prefix="${prefix%%.*}"  # remove vile extension :)
99
+   if [ -z "${VENDOR_PREFIX}" ]
100
+   then
101
+      VENDOR_PREFIX=`basename "${PWD}"`
102
+      VENDOR_PREFIX="${VENDOR_PREFIX%%.*}"  # remove vile extension :)
103
+   fi
94 104
 
95
-   VENDOR_TAG="${prefix}-${TAG}"
96
-   log_info "Set vendortag to \"${VENDOR_TAG}\""
97
-fi
105
+   if [ "${VENDOR_PREFIX}" = "-" ]
106
+   then
107
+      VENDOR_TAG="${TAG}"
108
+   else
109
+      VENDOR_TAG="${VENDOR_PREFIX}-${TAG}"
110
+   fi
98 111
 
99
-check_and_usage_and_help
112
+   check_and_usage_and_help
100 113
 
114
+   log_info "Set vendortag to \"${VENDOR_TAG}\""
115
+else
116
+   check_and_usage_and_help
117
+fi
101 118
 
102 119
 REPO="."
103 120
 
... ...
@@ -80,17 +80,20 @@ warn_scripts()
80 80
       fi
81 81
    fi
82 82
 
83
-   if [ "$phases" != "" -o "$scripts" != "" ]
83
+   if  [ "${DONT_ASK_AFTER_WARNING}" != "YES" ]
84 84
    then
85
-      user_say_yes "You should probably inspect them before continuing.
86
-Abort now ?"
87
-      if [ $? -eq 0 ]
85
+      if [ "$phases" != "" -o "$scripts" != "" ]
88 86
       then
89
-          log_error "The bootstrap is in an inconsistent state. It would be good
87
+         user_say_yes "You should probably inspect them before continuing.
88
+Abort now ?"
89
+         if [ $? -eq 0 ]
90
+         then
91
+             log_error "The bootstrap is in an inconsistent state. It would be good
90 92
 to run
91
-        ${C_WHITE}mulle-bootstrap clean dist${C_ERROR}
93
+           ${C_WHITE}mulle-bootstrap clean dist${C_ERROR}
92 94
 now."
93
-          return 1
95
+             return 1
96
+         fi
94 97
       fi
95 98
    fi
96 99
 }
... ...
@@ -98,7 +101,15 @@ now."
98 101
 
99 102
 main()
100 103
 {
101
-   warn_scripts "$@"
104
+   local  x
105
+
106
+   x=`read_config_setting "answer" "ASK"`
107
+   if [ "$x" != "YES"  ]
108
+   then
109
+      warn_scripts "$@"
110
+   else
111
+      log_warning "Script checking by autoanswer YES disabled"
112
+   fi
102 113
 }
103 114
 
104 115
 main "$@"
... ...
@@ -39,7 +39,7 @@
39 39
 usage()
40 40
 {
41 41
    cat <<EOF
42
-xcode <add|remove>
42
+xcode <add|remove> [xcodeproj]
43 43
 
44 44
    add      : add settings to Xcode project (default)
45 45
    remove   : remove settings from Xcode project
... ...
@@ -64,16 +64,22 @@ esac
64 64
 
65 65
 COMMAND="${1:-add}"
66 66
 shift
67
+PROJECT="$1"
68
+shift
69
+
67 70
 
68 71
 check_and_usage_and_help
69 72
 
70 73
 
71 74
 list_configurations()
72 75
 {
76
+   local project
77
+
78
+   project="${1}"
73 79
   #
74 80
   # Figure out all configuration
75 81
   #
76
-   xcodebuild -list -project "$1" 2> /dev/null | \
82
+   xcodebuild -list -project "${project}" 2> /dev/null | \
77 83
    grep -A100 'Build Configurations' | \
78 84
    grep -B100 'Schemes' | \
79 85
    egrep -v 'Configurations:|Schemes:' | \
... ...
@@ -197,12 +203,24 @@ patch_xcode_project()
197 203
    local mapped
198 204
    local configurations
199 205
    local xcode_configurations
206
+   local terse
207
+
208
+
209
+   read_yes_no_config_setting "terse" "NO"
210
+   terse=$?
200 211
 
201 212
    name=`basename "${PWD}"`
202
-   project=`find_xcodeproj "${name}"`
203
-   if [ "${project}" = "" ]
213
+
214
+   if [ ! -z "${PROJECT}" ]
204 215
    then
205
-      fail "no xcodeproj found"
216
+      [ -d "${PROJECT}" ] || fail "xcodeproj ${PROJECT} not found"
217
+      project="${PROJECT}"
218
+   else
219
+   project=`find_xcodeproj "${name}"`
220
+      if [ "${project}" = "" ]
221
+      then
222
+         fail "no xcodeproj found"
223
+      fi
206 224
    fi
207 225
 
208 226
    projectname="`basename "${project}"`"
... ...
@@ -231,15 +249,23 @@ Release"
231 249
    if [ "$COMMAND" = "add" ]
232 250
    then
233 251
       flag="add"
234
-      #     012345678901234567890123456789012345678901234567890123456789
235
-      echo "${C_WHITE}Settings will be added to ${C_MAGENTA}${projectname}${C_WHITE}." >&2
236
-      echo "In the long term it may be more useful to copy/paste the following" >&2
237
-      echo "lines into a local .xcconfig file, that is inherited by all configurations.${C_RESET}" >&2
252
+
253
+      if [ $terse -ne 0 ]
254
+      then
255
+         #     012345678901234567890123456789012345678901234567890123456789
256
+         echo "${C_WHITE}Settings will be added to ${C_MAGENTA}${projectname}${C_WHITE}." >&2
257
+         echo "In the long term it may be more useful to copy/paste the following" >&2
258
+         echo "lines into a local .xcconfig file, that is inherited by all configurations.${C_RESET}" >&2
259
+      fi
238 260
    else
239 261
       flag="remove"
240
-      #     012345678901234567890123456789012345678901234567890123456789
241
-      echo "${C_WHITE}Settings will be removed from ${projectname}." >&2
242
-      echo "You may want to check afterwards, that this has worked out OK :).${C_RESET}" >&2
262
+
263
+      if [ $terse -ne 0 ]
264
+      then
265
+         #     012345678901234567890123456789012345678901234567890123456789
266
+         echo "${C_WHITE}Settings will be removed from ${projectname}." >&2
267
+         echo "You may want to check afterwards, that this has worked out OK :).${C_RESET}" >&2
268
+      fi
243 269
    fi
244 270
 
245 271
    local dependencies_dir
... ...
@@ -283,37 +309,41 @@ Release"
283 309
 
284 310
    if [ "$COMMAND" = "add" ]
285 311
    then
312
+      if [ $terse -ne 0 ]
313
+      then
314
+         local mapped
315
+         local i
286 316
 
287
-      local mapped
288
-      local i
289
-
290
-      echo  "${C_WHITE}-----------------------------------------------------------"  >&2
317
+         echo  "${C_WHITE}-----------------------------------------------------------"  >&2
291 318
 
292
-      #  make these echos easily grabable by stdout
293
-      #     012345678901234567890123456789012345678901234567890123456789
294
-      echo "// Common.xcconfig:"
295
-      echo "DEPENDENCIES_DIR=${dependencies_dir}"
296
-      echo "HEADER_SEARCH_PATHS=${header_search_paths}"
297
-      echo "LIBRARY_SEARCH_PATHS=${library_search_paths}"
298
-      echo "FRAMEWORK_SEARCH_PATHS=${framework_search_paths}"
319
+         #  make these echos easily grabable by stdout
320
+         #     012345678901234567890123456789012345678901234567890123456789
321
+         echo "// Common.xcconfig:"
322
+         echo "DEPENDENCIES_DIR=${dependencies_dir}"
323
+         echo "HEADER_SEARCH_PATHS=${header_search_paths}"
324
+         echo "LIBRARY_SEARCH_PATHS=${library_search_paths}"
325
+         echo "FRAMEWORK_SEARCH_PATHS=${framework_search_paths}"
299 326
 
300
-   local old
327
+         local old
301 328
 
302
-   old="${IFS:-" "}"
303
-   IFS="
329
+         old="${IFS:-" "}"
330
+         IFS="
304 331
 "
305
-      for i in ${xcode_configurations}
306
-      do
307
-         echo ""
308
-         echo ""
309
-         mapped=`map_configuration "${configurations}" "${i}"`
310
-         #     012345678901234567890123456789012345678901234567890123456789
311
-         echo "// ${i}.xcconfig:"
312
-         echo "#include \"Common.xcconfig\""
313
-         echo "LIBRARY_CONFIGURATION=${mapped}"
314
-      done
315
-      IFS="${old}"
316
-      echo  "-----------------------------------------------------------${C_RESET}"  >&2
332
+         for i in ${xcode_configurations}
333
+         do
334
+            mapped=`map_configuration "${configurations}" "${i}"`
335
+
336
+            echo ""
337
+            echo ""
338
+            #     012345678901234567890123456789012345678901234567890123456789
339
+            echo "// ${i}.xcconfig:"
340
+            echo "#include \"Common.xcconfig\""
341
+            echo "LIBRARY_CONFIGURATION=${mapped}"
342
+         done
343
+
344
+         IFS="${old}"
345
+         echo  "-----------------------------------------------------------${C_RESET}"  >&2
346
+      fi
317 347
 
318 348
       query="Add ${C_CYAN}\"${DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}\"${C_YELLOW}  and friends to search paths of ${C_MAGENTA}${projectname}${C_YELLOW} ?"
319 349
    else
... ...
@@ -334,18 +364,22 @@ Release"
334 364
 
335 365
    if [ "$COMMAND" = "add" ]
336 366
    then
337
-      #     012345678901234567890123456789012345678901234567890123456789
338
-      echo "${C_WHITE}"
339
-      echo "Hint:"
340
-      echo "If you add a configuration to your project, remember to edit" >&2
341
-      echo "the LIBRARY_CONFIGURATION setting for that configuration." >&2
342
-      echo "" >&2
343
-      echo "You can rerun setup-xcode at later times and it should not" >&2
344
-      echo "unduly duplicate setting contents." >&2
345
-      echo "${C_RESET}" >&2
367
+      if [ $terse -ne 0 ]
368
+      then
369
+         #     012345678901234567890123456789012345678901234567890123456789
370
+         echo "${C_WHITE}"
371
+         echo "Hint:"
372
+         echo "If you add a configuration to your project, remember to edit" >&2
373
+         echo "the LIBRARY_CONFIGURATION setting for that configuration." >&2
374
+         echo "" >&2
375
+         echo "You can rerun setup-xcode at later times and it should not" >&2
376
+         echo "unduly duplicate setting contents." >&2
377
+         echo "${C_RESET}" >&2
378
+      fi
346 379
    fi
347 380
 }
348 381
 
382
+
349 383
 main()
350 384
 {
351 385
    log_fluff "::: xcode :::"