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 @@
0
+Use different build dir than just build.
1
+Write "doctor" command to find common problems.
2
+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 48
    mkdir -p "${bin}" 2> /dev/null
49 49
    sed "s|/usr/local/libexec/mulle-bootstrap|${libexec}|g" < "${i}" > "${bin}/$i" || exit 1
50 50
    chmod "${mode}" "${bin}/${i}" || exit 1
51
-   printf "install: ${C_MAGENTA}%s${C_RESET}\n" "$bin/$i" >&2
51
+   printf "install: ${C_MAGENTA}${C_BOLD}%s${C_RESET}\n" "$bin/$i" >&2
52 52
 done
53 53
 
54 54
 
... ...
@@ -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 239
          ;;
240 240
 
241 241
       update)
242
-         COMMAND="update" mulle-bootstrap-fetch.sh "$@" || exit 1
242
+         COMMAND="${command}" mulle-bootstrap-fetch.sh "$@" || exit 1
243 243
          ;;
244 244
 
245 245
       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 522
 
523 523
    enforce_build_sanity "${builddir}"
524 524
 
525
-   log_info "Let ${C_YELLOW}configure${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
525
+   log_info "Let ${C_CYAN}configure${C_INFO} do a ${C_MAGENTA}${configuration}${C_INFO} build of \
526 526
 ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir}\" ..."
527 527
 
528 528
 
... ...
@@ -558,6 +564,12 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} in \"${builddir
558 558
 
559 559
       logfile1="${owd}/${logfile1}"
560 560
       logfile2="${owd}/${logfile2}"
561
+
562
+      if [ "$MULLE_BOOTSTRAP_TRACE" != "" ]
563
+      then
564
+         logfile1="`tty`"
565
+         logfile2="$logfile1"
566
+      fi
561 567
       if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
562 568
       then
563 569
          logfile1="/dev/null"
... ...
@@ -771,17 +783,19 @@ build_xcodebuild()
771 771
    info=""
772 772
    if [ ! -z "${targetname}" ]
773 773
    then
774
-      info="Target ${C_MAGENTA}${targetname}${C_INFO}"
774
+      info=" Target ${C_MAGENTA}${targetname}${C_INFO}"
775 775
    fi
776 776
 
777 777
    if [ ! -z "${schemename}" ]
778 778
    then
779
-      info="Scheme ${C_MAGENTA}${schemename}${C_INFO}"
779
+      info=" Scheme ${C_MAGENTA}${schemename}${C_INFO}"
780 780
    fi
781 781
 
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}\" ..."
782
+   log_info "Let ${C_CYAN}xcodebuild${C_INFO} do a \
783
+${C_MAGENTA}${configuration}${C_INFO} build of \
784
+${C_MAGENTA}${name}${C_INFO} for SDK \
785
+${C_MAGENTA}${sdk}${C_INFO}${info} in \
786
+\"${builddir}\" ..."
785 787
 
786 788
    local projectname
787 789
 
... ...
@@ -891,7 +905,7 @@ ${info} in \"${builddir}\" ..."
891 891
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
892 892
 
893 893
    logfile="`build_log_name "xcodebuild" "${name}" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`"
894
-   log_info "Build log will be in ${C_RESET}\"${logfile}\""
894
+   log_info "Build log will be in: ${C_RESET_BOLD}${logfile}${C_INFO}"
895 895
 
896 896
    set -f
897 897
 
... ...
@@ -955,6 +969,11 @@ ${info} in \"${builddir}\" ..."
955 955
 
956 956
 
957 957
       logfile="${owd}/${logfile}"
958
+
959
+      if [ "${MULLE_BOOTSTRAP_TRACE}" != "" ]
960
+      then
961
+         logfile="`tty`"
962
+      fi
958 963
       if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
959 964
       then
960 965
          logfile="/dev/null"
... ...
@@ -1134,12 +1153,13 @@ build_script()
1134 1134
    name="$5"
1135 1135
    sdk="$6"
1136 1136
 
1137
+
1137 1138
    local logfile
1138 1139
 
1139 1140
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
1140
-   logfile="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.script.log"
1141 1141
 
1142
-   log_info "Build log will be in \"${logfile}\""
1142
+   logfile="${BUILDLOG_SUBDIR}/${name}-${configuration}-${sdk}.script.log"
1143
+   log_info "Build log will be in: ${C_RESET_BOLD}${logfile}${C_INFO}"
1143 1144
 
1144 1145
    local owd
1145 1146
 
... ...
@@ -1147,12 +1167,17 @@ build_script()
1147 1147
    exekutor cd "${srcdir}" || exit 1
1148 1148
 
1149 1149
       logfile="${owd}/${logfile}"
1150
+
1151
+      if [ "$MULLE_BOOTSTRAP_TRACE" != "" ]
1152
+      then
1153
+         logfile="`tty`"
1154
+      fi
1150 1155
       if [ "$MULLE_BOOTSTRAP_DRY_RUN" = "YES" ]
1151 1156
       then
1152 1157
          logfile="/dev/null"
1153 1158
       fi
1154 1159
 
1155
-      log_info "Running build script for ${C_MAGENTA}${configuration}${C_INFO}"
1160
+      log_info "Running build script for ${C_MAGENTA}${C_BOLD}${configuration}${C_INFO}"
1156 1161
       run_log_script "${owd}/${script}" \
1157 1162
          "${configuration}" \
1158 1163
          "${owd}/${srcdir}" \
... ...
@@ -1331,7 +1356,7 @@ build_wrapper()
1331 1331
 
1332 1332
    log_fluff "Setting up BUILD_DEPENDENCY_SUBDIR as \"${BUILD_DEPENDENCY_SUBDIR}\""
1333 1333
 
1334
-   if [ -d "${BUILD_DEPENDENCY_SUBDIR}" ]
1334
+   if [ "${COMMAND}" != "ibuild" -a -d "${BUILD_DEPENDENCY_SUBDIR}" ]
1335 1335
    then
1336 1336
       log_info "Cleaning up orphaned \"${BUILD_DEPENDENCY_SUBDIR}\""
1337 1337
       rmdir_safer "${BUILD_DEPENDENCY_SUBDIR}"
... ...
@@ -1350,12 +1375,16 @@ build_wrapper()
1350 1350
 
1351 1351
    run_repo_settings_script "${name}" "${srcdir}" "post-build" "$@" || exit 1
1352 1352
 
1353
-   log_fluff "Remove \"${BUILD_DEPENDENCY_SUBDIR}\""
1353
+   if [ "${COMMAND}" != "ibuild"  ]
1354
+   then
1355
+      log_fluff "Remove \"${BUILD_DEPENDENCY_SUBDIR}\""
1356
+   fi
1354 1357
 
1355 1358
    rmdir_safer "${BUILD_DEPENDENCY_SUBDIR}"
1356 1359
 
1357 1360
    DEPENDENCY_SUBDIR="${REFERENCE_DEPENDENCY_SUBDIR}"
1358 1361
 
1362
+   # for mulle-bootstrap developers
1359 1363
    REFERENCE_DEPENDENCY_SUBDIR="WRONG_DONT_USE_REFERENCE_DEPENDENCY_SUBDIR_AFTER_BUILD"
1360 1364
    BUILD_DEPENDENCY_SUBDIR="WRONG_DONT_USE_BUILD_DEPENDENCY_SUBDIR_AFTER_BUILD"
1361 1365
 }
... ...
@@ -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 67
 }
68 68
 
69 69
 
70
-C_INFO="${C_CYAN}"
70
+C_INFO="${C_CYAN}${C_BOLD}"
71 71
 log_info()
72 72
 {
73 73
    if [ "${MULLE_BOOTSTRAP_TERSE}" != "YES" ]
... ...
@@ -430,7 +432,7 @@ user_say_yes()
430 430
   x=`read_config_setting "answer" "ASK"`
431 431
   while [ "$x" != "Y" -a "$x" != "YES" -a  "$x" != "N"  -a  "$x" != "NO"  -a "$x" != "" ]
432 432
   do
433
-     printf "${C_BR_YELLOW}%b ${C_YELLOW}(${C_RESET}y${C_YELLOW}/${C_GREEN}N${C_YELLOW})${C_RESET} > " "$*" >&2
433
+     printf "${C_WARNING}%b${C_RESET} (y/${C_GREEN}N${C_RESET}) > " "$*" >&2
434 434
      read x
435 435
      x=`echo "${x}" | tr '[:lower:]' '[:upper:]'`
436 436
   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 64
 
65 65
       if dir_has_files "$2"
66 66
       then
67
-         phases=`(find "$2"/* -name "project.pbxproj" -exec grep -q 'PBXShellScriptBuildPhase' '{}'  \; -print)`
67
+         phases="`(find "$2"/* -name "project.pbxproj" -exec grep -q 'PBXShellScriptBuildPhase' '{}'  \; -print)`"
68 68
          if [ ! -z "${phases}" ]
69 69
          then
70
-            echo "this repository contains xcode projects with shellscript phases" >&2
70
+            log_warning "this repository contains xcode projects with shellscript phases" 
71 71
 
72 72
             ack=`which ack`
73 73
             if [ -z "${ack}" ]
... ...
@@ -110,7 +116,7 @@ main()
110 110
    then
111 111
       warn_scripts "$@"
112 112
    else
113
-      log_warning "Script checking by autoanswer YES disabled"
113
+      log_fluff "Script checking by autoanswer YES disabled"
114 114
    fi
115 115
 }
116 116
 
... ...
@@ -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"