Browse code

Fix problems on white Console and some other output ugliness. The -v option now removes use of the build log, which is nicer to see compile errors.

Nat! authored on 17-01-2016 00:08:32
Showing 10 changed files
... ...
@@ -1,3 +1,9 @@
1
+0.14
2
+===
3
+   Fix various uglies.
4
+   Make white terminals more happening with color choices.
5
+   -v circumvents building into a logfile, which is sometimes more convenient.
6
+
1 7
 0.13
2 8
 ===
3 9
    Fix colorization by using printf, instead of echo.
4 10
new file mode 100644
... ...
@@ -0,0 +1,3 @@
1
+Use different build dir than just build.
2
+Write "doctor" command to find common problems.
3
+Check that files in .auto aren't older than  in .bootstrap.
... ...
@@ -10,10 +10,13 @@ then
10 10
          # Escape sequence and resets
11 11
          C_RESET="\033[0m"
12 12
 
13
-         # Foreground colours
14
-         C_BLACK="\033[0;30m"   C_RED="\033[0;31m"    C_GREEN="\033[0;32m"
15
-         C_YELLOW="\033[0;33m"  C_BLUE="\033[0;34m"   C_MAGENTA="\033[0;35m"
16
-         C_CYAN="\033[0;36m"    C_WHITE="\033[0;37m"  C_BR_BLACK="\033[0;90m"
13
+         # Useable Foreground colours, for black/white white/black
14
+         C_RED="\033[0;31m"     C_GREEN="\033[0;32m"
15
+         C_BLUE="\033[0;34m"    C_MAGENTA="\033[0;35m"
16
+         C_CYAN="\033[0;36m"    
17
+
18
+         C_BR_RED="\033[0;91m" C_BR_YELLOW="\033[0;93m"
19
+         C_BOLD="\033[1m" 
17 20
 
18 21
          #
19 22
          # restore colors if stuff gets wonky
... ...
@@ -48,7 +51,7 @@ do
48 51
    mkdir -p "${bin}" 2> /dev/null
49 52
    sed "s|/usr/local/libexec/mulle-bootstrap|${libexec}|g" < "${i}" > "${bin}/$i" || exit 1
50 53
    chmod "${mode}" "${bin}/${i}" || exit 1
51
-   printf "install: ${C_MAGENTA}%s${C_RESET}\n" "$bin/$i" >&2
54
+   printf "install: ${C_MAGENTA}${C_BOLD}%s${C_RESET}\n" "$bin/$i" >&2
52 55
 done
53 56
 
54 57
 
... ...
@@ -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.13
32
+VERSION=0.14
33 33
 
34 34
 #
35 35
 # This is the main user interface to mulle-bootstrap
... ...
@@ -223,7 +223,11 @@ main()
223 223
          ;;
224 224
 
225 225
       build)
226
-         mulle-bootstrap-build.sh "$@" || exit 1
226
+         COMMAND="${command}" mulle-bootstrap-build.sh "$@" || exit 1
227
+         ;;
228
+
229
+      ibuild)
230
+         COMMAND="${command}" mulle-bootstrap-build.sh "$@" || exit 1
227 231
          ;;
228 232
 
229 233
       clean)
... ...
@@ -239,7 +243,7 @@ main()
239 243
          ;;
240 244
 
241 245
       update)
242
-         COMMAND="update" mulle-bootstrap-fetch.sh "$@" || exit 1
246
+         COMMAND="${command}" mulle-bootstrap-fetch.sh "$@" || exit 1
243 247
          ;;
244 248
 
245 249
       convert-pre-0.10)
... ...
@@ -414,7 +414,7 @@ build_cmake()
414 414
 
415 415
    enforce_build_sanity "${builddir}"
416 416
 
417
-   log_info "Let ${C_YELLOW}cmake${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
417
+   log_info "Let ${C_CYAN}cmake${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
418 418
 ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir}\" ..."
419 419
 
420 420
    local sdkparameter
... ...
@@ -456,6 +456,12 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir
456 456
 
457 457
       logfile1="${owd}/${logfile1}"
458 458
       logfile2="${owd}/${logfile2}"
459
+
460
+      if [ "$MULLE_BOOTSTRAP_VERBOSE" != "" ]
461
+      then
462
+         logfile1="`tty`"
463
+         logfile2="$logfile1"
464
+      fi
459 465
       if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
460 466
       then
461 467
          logfile1="/dev/null"
... ...
@@ -522,7 +528,7 @@ build_configure()
522 528
 
523 529
    enforce_build_sanity "${builddir}"
524 530
 
525
-   log_info "Let ${C_YELLOW}configure${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
531
+   log_info "Let ${C_CYAN}configure${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
526 532
 ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir}\" ..."
527 533
 
528 534
 
... ...
@@ -558,6 +564,12 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir
558 564
 
559 565
       logfile1="${owd}/${logfile1}"
560 566
       logfile2="${owd}/${logfile2}"
567
+
568
+      if [ "$MULLE_BOOTSTRAP_TRACE" != "" ]
569
+      then
570
+         logfile1="`tty`"
571
+         logfile2="$logfile1"
572
+      fi
561 573
       if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
562 574
       then
563 575
          logfile1="/dev/null"
... ...
@@ -771,17 +783,19 @@ build_xcodebuild()
771 783
    info=""
772 784
    if [ ! -z "${targetname}" ]
773 785
    then
774
-      info="Target ${C_MAGENTA}${targetname}${C_INFO}"
786
+      info=" Target ${C_MAGENTA}${targetname}${C_INFO}"
775 787
    fi
776 788
 
777 789
    if [ ! -z "${schemename}" ]
778 790
    then
779
-      info="Scheme ${C_MAGENTA}${schemename}${C_INFO}"
791
+      info=" Scheme ${C_MAGENTA}${schemename}${C_INFO}"
780 792
    fi
781 793
 
782
-   log_info "Let ${C_YELLOW}xcodebuild${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
783
-${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} \
784
-${info} in \"${builddir}\" ..."
794
+   log_info "Let ${C_CYAN}xcodebuild${C_INFO} do a \
795
+${C_MAGENTA}${configuration}${C_INFO} build of \
796
+${C_MAGENTA}${name}${C_INFO} for SDK \
797
+${C_MAGENTA}${sdk}${C_INFO}${info} in \
798
+\"${builddir}\" ..."
785 799
 
786 800
    local projectname
787 801
 
... ...
@@ -891,7 +905,7 @@ ${info} in \"${builddir}\" ..."
891 905
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
892 906
 
893 907
    logfile="`build_log_name "xcodebuild" "${name}" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`"
894
-   log_info "Build log will be in ${C_RESET}\"${logfile}\""
908
+   log_info "Build log will be in: ${C_RESET_BOLD}${logfile}${C_INFO}"
895 909
 
896 910
    set -f
897 911
 
... ...
@@ -955,6 +969,11 @@ ${info} in \"${builddir}\" ..."
955 969
 
956 970
 
957 971
       logfile="${owd}/${logfile}"
972
+
973
+      if [ "${MULLE_BOOTSTRAP_TRACE}" != "" ]
974
+      then
975
+         logfile="`tty`"
976
+      fi
958 977
       if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
959 978
       then
960 979
          logfile="/dev/null"
... ...
@@ -1134,12 +1153,13 @@ build_script()
1134 1153
    name="$5"
1135 1154
    sdk="$6"
1136 1155
 
1156
+
1137 1157
    local logfile
1138 1158
 
1139 1159
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
1140
-   logfile="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.script.log"
1141 1160
 
1142
-   log_info "Build log will be in \"${logfile}\""
1161
+   logfile="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.script.log"
1162
+   log_info "Build log will be in: ${C_RESET_BOLD}${logfile}${C_INFO}"
1143 1163
 
1144 1164
    local owd
1145 1165
 
... ...
@@ -1147,12 +1167,17 @@ build_script()
1147 1167
    exekutor cd "${srcdir}" || exit 1
1148 1168
 
1149 1169
       logfile="${owd}/${logfile}"
1170
+
1171
+      if [ "$MULLE_BOOTSTRAP_TRACE" != "" ]
1172
+      then
1173
+         logfile="`tty`"
1174
+      fi
1150 1175
       if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
1151 1176
       then
1152 1177
          logfile="/dev/null"
1153 1178
       fi
1154 1179
 
1155
-      log_info "Running build script for ${C_MAGENTA}${configuration}${C_INFO}"
1180
+      log_info "Running build script for ${C_MAGENTA}${C_BOLD}${configuration}${C_INFO}"
1156 1181
       run_log_script "${owd}/${script}" \
1157 1182
          "${configuration}" \
1158 1183
          "${owd}/${srcdir}" \
... ...
@@ -1331,7 +1356,7 @@ build_wrapper()
1331 1356
 
1332 1357
    log_fluff "Setting up BUILD_DEPENDENCY_SUBDIR as \"${BUILD_DEPENDENCY_SUBDIR}\""
1333 1358
 
1334
-   if [ -d "${BUILD_DEPENDENCY_SUBDIR}" ]
1359
+   if [ "${COMMAND}" != "ibuild" -a -d "${BUILD_DEPENDENCY_SUBDIR}" ]
1335 1360
    then
1336 1361
       log_info "Cleaning up orphaned \"${BUILD_DEPENDENCY_SUBDIR}\""
1337 1362
       rmdir_safer "${BUILD_DEPENDENCY_SUBDIR}"
... ...
@@ -1350,12 +1375,16 @@ build_wrapper()
1350 1375
 
1351 1376
    run_repo_settings_script "${name}" "${srcdir}" "post-build" "$@" || exit 1
1352 1377
 
1353
-   log_fluff "Remove \"${BUILD_DEPENDENCY_SUBDIR}\""
1378
+   if [ "${COMMAND}" != "ibuild"  ]
1379
+   then
1380
+      log_fluff "Remove \"${BUILD_DEPENDENCY_SUBDIR}\""
1381
+   fi
1354 1382
 
1355 1383
    rmdir_safer "${BUILD_DEPENDENCY_SUBDIR}"
1356 1384
 
1357 1385
    DEPENDENCY_SUBDIR="${REFERENCE_DEPENDENCY_SUBDIR}"
1358 1386
 
1387
+   # for mulle-bootstrap developers
1359 1388
    REFERENCE_DEPENDENCY_SUBDIR="WRONG_DONT_USE_REFERENCE_DEPENDENCY_SUBDIR_AFTER_BUILD"
1360 1389
    BUILD_DEPENDENCY_SUBDIR="WRONG_DONT_USE_BUILD_DEPENDENCY_SUBDIR_AFTER_BUILD"
1361 1390
 }
... ...
@@ -982,7 +982,7 @@ update()
982 982
    log_info "Updating \"${dstdir}\""
983 983
    if [ ! -L "${dstdir}"  ]
984 984
    then
985
-      run_repo_settings_script "${name}" "${dstdir}" "pre-update" "%@"
985
+      run_repo_settings_script "${name}" "${dstdir}" "pre-update" "$@"
986 986
 
987 987
       script="`find_repo_setting_file "${name}" "bin/update.sh"`"
988 988
       if [ ! -z "${script}" ]
... ...
@@ -992,7 +992,7 @@ update()
992 992
          "${operation}" "${dstdir}" "${tag}"
993 993
       fi
994 994
 
995
-      run_repo_settings_script "${name}" "${dstdir}" "post-update" "%@"
995
+      run_repo_settings_script "${name}" "${dstdir}" "post-update" "$@"
996 996
    fi
997 997
 }
998 998
 
... ...
@@ -1204,7 +1204,7 @@ main()
1204 1204
    #
1205 1205
    # Run prepare scripts if present
1206 1206
    #
1207
-   run_fetch_settings_script "post-${COMMAND}" "%@"
1207
+   run_fetch_settings_script "post-${COMMAND}" "$@"
1208 1208
 
1209 1209
    if read_yes_no_config_setting "update_gitignore" "YES"
1210 1210
    then
... ...
@@ -37,27 +37,29 @@ then
37 37
       Darwin|Linux|FreeBSD)
38 38
          C_RESET="\033[0m"
39 39
 
40
-         # Foreground colours
41
-         C_BLACK="\033[0;30m"   C_RED="\033[0;31m"    C_GREEN="\033[0;32m"
42
-         C_YELLOW="\033[0;33m"  C_BLUE="\033[0;34m"   C_MAGENTA="\033[0;35m"
43
-         C_CYAN="\033[0;36m"    C_WHITE="\033[0;37m"  C_BR_BLACK="\033[0;90m"
40
+         # Useable Foreground colours, for black/white white/black
41
+         C_RED="\033[0;31m"     C_GREEN="\033[0;32m"
42
+         C_BLUE="\033[0;34m"    C_MAGENTA="\033[0;35m"
43
+         C_CYAN="\033[0;36m"    
44 44
 
45 45
          C_BR_RED="\033[0;91m" C_BR_YELLOW="\033[0;93m"
46
+         C_BOLD="\033[1m" 
46 47
 
48
+         C_RESET_BOLD="${C_RESET}${C_BOLD}"
47 49
          trap 'printf "${C_RESET}"' TERM EXIT
48 50
          ;;
49 51
    esac
50 52
 fi
51 53
 
52 54
 
53
-C_ERROR="${C_RED}"
55
+C_ERROR="${C_RED}${C_BOLD}"
54 56
 log_error()
55 57
 {
56 58
    printf "${C_ERROR}%b${C_RESET}\n" "$*" >&2
57 59
 }
58 60
 
59 61
 
60
-C_WARNING="${C_YELLOW}"
62
+C_WARNING="${C_MAGENTA}${C_BOLD}"
61 63
 log_warning()
62 64
 {
63 65
    if [ "${MULLE_BOOTSTRAP_TERSE}" != "YES" ]
... ...
@@ -67,7 +69,7 @@ log_warning()
67 69
 }
68 70
 
69 71
 
70
-C_INFO="${C_CYAN}"
72
+C_INFO="${C_CYAN}${C_BOLD}"
71 73
 log_info()
72 74
 {
73 75
    if [ "${MULLE_BOOTSTRAP_TERSE}" != "YES" ]
... ...
@@ -430,7 +432,7 @@ user_say_yes()
430 432
   x=`read_config_setting "answer" "ASK"`
431 433
   while [ "$x" != "Y" -a "$x" != "YES" -a  "$x" != "N"  -a  "$x" != "NO"  -a "$x" != "" ]
432 434
   do
433
-     printf "${C_BR_YELLOW}%b ${C_YELLOW}(${C_RESET}y${C_YELLOW}/${C_GREEN}N${C_YELLOW})${C_RESET} > " "$*" >&2
435
+     printf "${C_WARNING}%b${C_RESET} (y/${C_GREEN}N${C_RESET}) > " "$*" >&2
434 436
      read x
435 437
      x=`echo "${x}" | tr '[:lower:]' '[:upper:]'`
436 438
   done
... ...
@@ -122,7 +122,7 @@ run_build_root_settings_script()
122 122
    script="`find_build_root_setting_file "bin/${scriptname}.sh"`"
123 123
    if [ ! -z "${script}" ]
124 124
    then
125
-      run_script "${script}" "%@"
125
+      run_script "${script}" "$@"
126 126
    fi
127 127
 }
128 128
 
... ...
@@ -40,21 +40,27 @@ warn_scripts()
40 40
    local phases
41 41
    local ack
42 42
    local i
43
+   local old
43 44
 
44 45
    if [ -d "$1" ]
45 46
    then
46
-      scripts=`find "$1" -name "*.sh" \( -perm +u+x -o -perm +g+x -o -perm +o+x \) -type f -print`
47
+      scripts="`find "$1" -name "*.sh" \( -perm +u+x -o -perm +g+x -o -perm +o+x \) -type f -print`"
47 48
       if [ ! -z "${scripts}" ]
48 49
       then
49
-         echo "this .bootstrap contains shell scripts:" >&2
50
-         echo $scripts | while read i
50
+         log_warning "this .bootstrap contains shell scripts:" 
51
+         old="${IFS:-" "}"         
52
+         IFS="
53
+"
54
+         echo "${C_BOLD}--------------------------------------------------------${C_RESET}" >&2
55
+         for i in $scripts
51 56
          do
52
-            echo "$i:" >&2
53
-            echo "--------------------------------------------------------" >&2
57
+            echo "${C_BOLD}$i:${C_RESET}" >&2
58
+            echo "${C_BOLD}--------------------------------------------------------${C_RESET}" >&2
54 59
             cat "$i" >&2
55
-            echo "--------------------------------------------------------" >&2
60
+            echo "${C_BOLD}--------------------------------------------------------${C_RESET}" >&2
56 61
          done
57 62
          echo "" >&2
63
+         IFS="${old}"
58 64
       fi
59 65
    fi
60 66
 
... ...
@@ -64,10 +70,10 @@ warn_scripts()
64 70
 
65 71
       if dir_has_files "$2"
66 72
       then
67
-         phases=`(find "$2"/* -name "project.pbxproj" -exec grep -q 'PBXShellScriptBuildPhase' '{}'  \; -print)`
73
+         phases="`(find "$2"/* -name "project.pbxproj" -exec grep -q 'PBXShellScriptBuildPhase' '{}'  \; -print)`"
68 74
          if [ ! -z "${phases}" ]
69 75
          then
70
-            echo "this repository contains xcode projects with shellscript phases" >&2
76
+            log_warning "this repository contains xcode projects with shellscript phases" 
71 77
 
72 78
             ack=`which ack`
73 79
             if [ -z "${ack}" ]
... ...
@@ -110,7 +116,7 @@ main()
110 116
    then
111 117
       warn_scripts "$@"
112 118
    else
113
-      log_warning "Script checking by autoanswer YES disabled"
119
+      log_fluff "Script checking by autoanswer YES disabled"
114 120
    fi
115 121
 }
116 122
 
... ...
@@ -349,9 +349,9 @@ Release"
349 349
          printf  "-----------------------------------------------------------${C_RESET}\n"  >&2
350 350
       fi
351 351
 
352
-      query="Add ${C_CYAN}${DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${C_YELLOW} and friends to search paths of ${C_MAGENTA}${projectname}${C_YELLOW} ?"
352
+      query="Add ${C_CYAN}${DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${C_MAGENTA} and friends to search paths of ${C_MAGENTA}${projectname}${C_YELLOW} ?"
353 353
    else
354
-      query="Remove ${C_CYAN}${DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${C_YELLOW} and friends from search paths of ${C_MAGENTA}${projectname}${C_YELLOW} ?"
354
+      query="Remove ${C_CYAN}${DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${C_MAGENTA} and friends from search paths of ${C_MAGENTA}${projectname}${C_YELLOW} ?"
355 355
    fi
356 356
 
357 357
    user_say_yes "$query"