Browse code

Some more fixes in 0.20

Nat! authored on 05-04-2016 11:03:10
Showing 9 changed files
... ...
@@ -6,4 +6,5 @@ build/
6 6
 .bootstrap.auto/
7 7
 dependencies/
8 8
 .bootstrap.local/
9
-mulle-bootstrap.sublime-workspace
10 9
\ No newline at end of file
10
+mulle-bootstrap.sublime-workspace
11
+mulle-project
... ...
@@ -1,5 +1,6 @@
1 1
 0.20
2 2
 ===
3
+
3 4
 *  Replace CLONES_FETCH_SUBDIR with CLONESFETCH_SUBDIR
4 5
 *  mulle-bootstrap now uses the zombie repository detection to actually bury
5 6
    unused repositories. Check out "tests/refresh/refresh.sh" how this
... ...
@@ -14,6 +15,11 @@
14 15
    `mulle-bootstrap clone` is now `mulle-bootstrap project clone
15 16
 *  Better deep fetch and refresh avoids redoing repositories (could be
16 17
    better though still)
18
+*  Don't append to log files, overwrite them.
19
+*  script build shows better info on failure
20
+*  Fix recursive repository agglomeration to not output duplicate lines
21
+*  Grep those lines with an exact line match
22
+
17 23
 
18 24
 0.19
19 25
 ===
... ...
@@ -1,2 +1,5 @@
1 1
 Use different build dir than just build.
2 2
 Write "doctor" command to find common problems.
3
+XCodebuild somehow resolves the symbolic link, which makes it use the wrong
4
+dependency library. MUST use absolute paths.
5
+Changes in .repositories should not need to make clean.
3 6
\ No newline at end of file
... ...
@@ -144,7 +144,7 @@ bootstrap_auto_update()
144 144
             tmpfile="${BOOTSTRAP_SUBDIR}.auto/${i}.tmp"
145 145
 
146 146
             exekutor mv "${dstfile}" "${tmpfile}" || exit 1
147
-            exekutor cat "${srcfile}" "${tmpfile}" > "${dstfile}"  || exit 1
147
+            exekutor merge_settings_in_front "${srcfile}" "${tmpfile}" > "${dstfile}"  || exit 1
148 148
             exekutor rm "${tmpfile}" || exit 1
149 149
          else
150 150
             exekutor cp "${srcfile}" "${dstfile}" || exit 1
... ...
@@ -500,9 +500,9 @@ ${other_cppflags}" \
500 500
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
501 501
 -F${relative}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
502 502
 ${other_ldflags}" \
503
-"${relative}/${srcdir}" >> "${logfile1}" || build_fail "${logfile1}" "cmake"
503
+"${relative}/${srcdir}" > "${logfile1}" || build_fail "${logfile1}" "cmake"
504 504
 
505
-      logging_exekutor make VERBOSE=1 install >> "${logfile2}" || build_fail "${logfile2}" "make"
505
+      logging_exekutor make VERBOSE=1 install > "${logfile2}" || build_fail "${logfile2}" "make"
506 506
 
507 507
       set +f
508 508
 
... ...
@@ -613,7 +613,7 @@ ${other_cppflags} \
613 613
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${configuration} \
614 614
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
615 615
 ${other_ldflags} \
616
--isysroot ${sdkpath}\"" >> "${logfile1}"
616
+-isysroot ${sdkpath}\"" > "${logfile1}"
617 617
 
618 618
 
619 619
        DEPENDENCIES_DIR="'${owd}/${REFERENCE_DEPENDENCY_SUBDIR}'" \
... ...
@@ -644,7 +644,7 @@ ${other_ldflags} \
644 644
           --prefix "${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local" >> "${logfile1}" \
645 645
       || build_fail "${logfile1}" "configure"
646 646
 
647
-      logging_exekutor make install >> "${logfile2}" \
647
+      logging_exekutor make install > "${logfile2}" \
648 648
       || build_fail "${logfile2}" "make"
649 649
 
650 650
       set +f
... ...
@@ -1076,7 +1076,7 @@ HEADER_SEARCH_PATHS='${dependencies_header_search_path}' \
1076 1076
 LIBRARY_SEARCH_PATHS='${dependencies_lib_search_path}' \
1077 1077
 FRAMEWORK_SEARCH_PATHS='${dependencies_framework_search_path}'"
1078 1078
 
1079
-      logging_eval_exekutor "${cmdline}" >> "${logfile}" \
1079
+      logging_eval_exekutor "${cmdline}" > "${logfile}" \
1080 1080
       || build_fail "${logfile}" "xcodebuild"
1081 1081
 
1082 1082
       set +f
... ...
@@ -1145,6 +1145,37 @@ build_xcodebuild_schemes_or_target()
1145 1145
 }
1146 1146
 
1147 1147
 
1148
+run_build_script()
1149
+{
1150
+   local script
1151
+
1152
+   script="$1"
1153
+   shift
1154
+
1155
+   [ ! -z "$script" ] || internal_fail "script is empty"
1156
+
1157
+   if [ -x "${script}" ]
1158
+   then
1159
+      log_fluff "Executing script \"${script}\" $1"
1160
+      exekutor "${script}" "$@"
1161
+   else
1162
+      if [ ! -e "${script}" ]
1163
+      then
1164
+         fail "script \"${script}\" not found ($PWD)"
1165
+      else
1166
+         fail "script \"${script}\" not executable"
1167
+      fi
1168
+   fi
1169
+}
1170
+
1171
+
1172
+run_log_build_script()
1173
+{
1174
+   echo "$@"
1175
+   run_build_script "$@"
1176
+}
1177
+
1178
+
1148 1179
 build_script()
1149 1180
 {
1150 1181
    local script
... ...
@@ -1198,13 +1229,13 @@ ${C_MAGENTA}${C_BOLD}${name}${C_INFO} for SDK \
1198 1229
 ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1199 1230
 \"${builddir}\" ..."
1200 1231
 
1201
-      run_log_script "${owd}/${script}" \
1232
+      run_log_build_script "${owd}/${script}" \
1202 1233
          "${configuration}" \
1203 1234
          "${owd}/${srcdir}" \
1204 1235
          "${owd}/${builddir}" \
1205 1236
          "${owd}/${BUILD_DEPENDENCY_SUBDIR}" \
1206 1237
          "${name}" \
1207
-         "${sdk}" >> "${logfile}" \
1238
+         "${sdk}" > "${logfile}" \
1208 1239
       || build_fail "${logfile}" "build.sh"
1209 1240
 
1210 1241
    exekutor cd "${owd}"
... ...
@@ -303,7 +303,7 @@ link_command()
303 303
          src="${real}"
304 304
       fi
305 305
 
306
-      log_info "Symlinking ${C_MAGENTA}${C_BOLD}${src}${C_INFO} ..."
306
+      log_info "Symlinking ${C_MAGENTA}${C_BOLD}`basename -- ${src}`${C_INFO} ..."
307 307
       exekutor ln -s -f "$src" "$dst" || fail "failed to setup symlink \"$dst\" (to \"$src\")"
308 308
 
309 309
       if [ "$tag" != "" ]
... ...
@@ -331,9 +331,22 @@ ask_symlink_it()
331 331
       fail "You need to check out ${clone} yourself, as it's not there."
332 332
    fi
333 333
 
334
+   #
334 335
    # check if checked out
336
+   #
335 337
    if [ -d "${clone}"/.git ]
336 338
    then
339
+      local is_bare
340
+
341
+       # if bare repo, we can only clone anyway
342
+      is_bare=`( cd "${clone}"; git rev-parse --is-bare-repository )`
343
+      if [ "${is_bare}" = "true" ]
344
+      then
345
+         log_info "${clone} is a bare git repository. So cloning"
346
+         log_info "is the only way to go."
347
+         return 1
348
+      fi
349
+
337 350
       flag=1  # mens clone it
338 351
       if [ "${SYMLINK_FORBIDDEN}" != "YES" ]
339 352
       then
... ...
@@ -345,14 +358,6 @@ ask_symlink_it()
345 358
       return $?
346 359
    fi
347 360
 
348
-    # if bare repo, we can only clone anyway
349
-   if [ -f "${clone}"/HEAD -a -d "${clone}/refs" ]
350
-   then
351
-      log_info "${clone} looks like a bare git repository. So cloning"
352
-      log_info "is the only way to go."
353
-      return 1
354
-   fi
355
-
356 361
    # can only symlink because not a .git repo yet
357 362
    if [ "${SYMLINK_FORBIDDEN}" != "YES" ]
358 363
    then
... ...
@@ -421,10 +426,14 @@ checkout()
421 426
 
422 427
    if [ -e "${DEPENDENCY_SUBDIR}" -o -e "${CLONESBUILD_SUBDIR}" ]
423 428
    then
424
-      log_error "Stale folders \"${DEPENDENCY_SUBDIR}\" and/or \"${CLONESBUILD_SUBDIR}\" found."
425
-      log_error "Please remove them before continuing."
426
-      log_info  "Suggested command: ${C_RESET_BOLD}mulle-bootstrap clean output${C_INFO}"
427
-      exit 1
429
+      # if this is a "refetch" don't bother to warn
430
+      if [ ! -e "${BOOTSTRAP_SUBDIR}.auto" ]
431
+      then
432
+         log_error "Stale folders \"${DEPENDENCY_SUBDIR}\" and/or \"${CLONESBUILD_SUBDIR}\" found."
433
+         log_error "Please remove them before continuing."
434
+         log_info  "Suggested command: ${C_RESET_BOLD}mulle-bootstrap clean output${C_INFO}"
435
+         exit 1
436
+      fi
428 437
    fi
429 438
 
430 439
    local operation
... ...
@@ -644,7 +653,7 @@ clone_repositories()
644 653
             IFS="${old}"
645 654
 
646 655
             # avoid superflous updates
647
-            match="`echo "${fetched}" | grep "${clone}"`"
656
+            match="`echo "${fetched}" | grep -x "${clone}"`"
648 657
             # could remove prefixes here https:// http://
649 658
 
650 659
             if [ "${match}" != "${clone}" ]
... ...
@@ -655,6 +664,7 @@ ${clone}"
655 664
                name="`canonical_name_from_clone "${clone}"`"
656 665
                url="`url_from_clone "${clone}"`"
657 666
                clone_repository "${name}" "${url}"
667
+
658 668
                if [ $? -eq 1 ]
659 669
                then
660 670
                   stop=0
... ...
@@ -613,3 +613,4 @@ ensure_clones_directory()
613 613
       mkdir_if_missing "${CLONESFETCH_SUBDIR}"
614 614
    fi
615 615
 }
616
+
... ...
@@ -115,7 +115,7 @@ refresh_repositories_settings()
115 115
             IFS="${old}"
116 116
 
117 117
             # avoid superflous updates
118
-            match="`echo "${refreshed}" | grep "${clone}"`"
118
+            match="`echo "${refreshed}" | grep -x "${clone}"`"
119 119
             # could remove prefixes here https:// http://
120 120
 
121 121
             if [ "${match}" != "${clone}" ]
... ...
@@ -513,6 +513,37 @@ read_sane_config_path_setting()
513 513
 
514 514
 
515 515
 
516
+
517
+merge_settings_in_front()
518
+{
519
+   local settings1
520
+   local settings2
521
+   local result
522
+
523
+   settings1="`_read_setting "$1"`"
524
+   settings2="`_read_setting "$2"`"
525
+
526
+   result="${settings2}"
527
+
528
+   local old
529
+   local line1
530
+
531
+   old="${IFS:-" "}"
532
+   IFS="
533
+"
534
+   for line in $settings1
535
+   do
536
+      result="`echo "${result}" | grep -v -x "${line}"`"
537
+      result="${line}
538
+${result}"
539
+   done
540
+
541
+   IFS="${old}"
542
+
543
+   echo "${result}"
544
+}
545
+
546
+
516 547
 ###
517 548
 #
518 549
 #