Browse code

Lots of improvements, check the RELEASENOTES. git or svn is now specified as a fourth parameter in the repositories file. Got rid of some internal "GLOBALS" with respect to relative paths.

Nat! authored on 09-05-2016 12:26:24
Showing 8 changed files
... ...
@@ -11,6 +11,16 @@
11 11
 *  xcodebuild routine does not overwrite `INSTALL_PATH anymore.
12 12
 *  `clean has **output** as the new default
13 13
 *  Fix accidental IFS overwrite problem, resulting in git calls failing
14
+*  Install brews first, since they might load prerequisites for shell scripts.
15
+*  Allow user to specify "source_dir" build setting for projects, that do
16
+   not have CMakeLists.txt or .xcodeproj or configure in the top level.
17
+*  the Source Code Management system is no longer read from a .scm file, but
18
+   instead specified in the fourth field of repositories. The default is still
19
+   git and the only available alternative is still svn.
20
+*  Improve repository merge order again.
21
+*  Fix cmake to not always compile with DEBUG options. Allow to supply
22
+   cmake flags via "cmakeflags" root build setting.
23
+
14 24
 
15 25
 0.22
16 26
 ===
... ...
@@ -70,7 +70,7 @@ bootstrap_auto_update()
70 70
       return 1
71 71
    fi
72 72
 
73
-   log_fluff "Recursively acquiring ${directory} .bootstrap settings ..."
73
+   log_fluff "Acquiring ${directory} .bootstrap settings ..."
74 74
 
75 75
    local old
76 76
 
... ...
@@ -188,5 +188,7 @@ bootstrap_auto_update()
188 188
          exekutor xargs -0 -I % ln -s -f "${relative}/../"% "${BOOTSTRAP_SUBDIR}.auto/settings"
189 189
    fi
190 190
 
191
+   log_fluff "Acquisition of ${directory} .bootstrap settings finished"
192
+
191 193
    return 0
192 194
 }
... ...
@@ -488,16 +488,14 @@ build_cmake()
488 488
    local configuration
489 489
    local srcdir
490 490
    local builddir
491
-   local relative
492 491
    local name
493 492
    local sdk
494 493
 
495 494
    configuration="$1"
496 495
    srcdir="$2"
497 496
    builddir="$3"
498
-   relative="$4"
499
-   name="$5"
500
-   sdk="$6"
497
+   name="$4"
498
+   sdk="$5"
501 499
 
502 500
    enforce_build_sanity "${builddir}"
503 501
 
... ...
@@ -510,10 +508,12 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
510 508
    local suffix
511 509
    local mapped
512 510
    local fallback
511
+   local localcmakeflags
513 512
 
514 513
    fallback="`echo "${CONFIGURATIONS}" | tail -1`"
515
-   fallback="`read_build_setting "$name" "fallback-configuration" "${fallback}"`"
516
-   mapped="`read_build_setting "$name" "cmake-${configuration}.map" "${configuration}"`"
514
+   fallback="`read_build_setting "${name}" "fallback-configuration" "${fallback}"`"
515
+   mapped="`read_build_setting "${name}" "cmake-${configuration}.map" "${configuration}"`"
516
+   localcmakeflags="`read_build_root_setting "cmakeflags"`"
517 517
    suffix="`determine_suffix "${configuration}" "${sdk}"`"
518 518
    sdkparameter="`cmake_sdk_parameter "${sdk}"`"
519 519
 
... ...
@@ -543,7 +543,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
543 543
 
544 544
    owd="${PWD}"
545 545
 
546
-#   cmake_keep_builddir="`read_build_setting "$name" "cmake_keep_builddir" "YES"`"
546
+#   cmake_keep_builddir="`read_build_setting "${name}" "cmake_keep_builddir" "YES"`"
547 547
 #   if [ "${cmake_keep_builddir}" != "YES" ]
548 548
 #   then
549 549
 #      rmdir_safer "${builddir}"
... ...
@@ -571,9 +571,12 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
571 571
          logfile2="/dev/null"
572 572
       fi
573 573
 
574
+      local relative_srcdir
575
+
576
+      relative_srcdir="`relative_path_between "${owd}/${srcdir}" "${PWD}"`"
577
+
574 578
       logging_exekutor cmake "-DCMAKE_BUILD_TYPE=${mapped}" \
575 579
 "${sdkparameter}" \
576
-"-DCMAKE_C_FLAGS_DEBUG=-DDEBUG -g -O0" \
577 580
 "-DDEPENDENCIES_DIR=${owd}/${REFERENCE_DEPENDENCY_SUBDIR}" \
578 581
 "-DCMAKE_INSTALL_PREFIX:PATH=${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local"  \
579 582
 "-DCMAKE_C_FLAGS=\
... ...
@@ -602,8 +605,10 @@ ${other_ldflags}" \
602 605
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${fallback} \
603 606
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
604 607
 ${other_ldflags}" \
608
+"-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH};\${CMAKE_MODULE_PATH}" \
605 609
 ${CMAKE_FLAGS} \
606
-"${relative}/${srcdir}" > "${logfile1}" || build_fail "${logfile1}" "cmake"
610
+${localcmakeflags} \
611
+"${relative_srcdir}" > "${logfile1}" || build_fail "${logfile1}" "cmake"
607 612
 
608 613
       logging_exekutor make ${local_make_flags} VERBOSE=1 install > "${logfile2}" || build_fail "${logfile2}" "make"
609 614
 
... ...
@@ -626,16 +631,14 @@ build_configure()
626 631
    local configuration
627 632
    local srcdir
628 633
    local builddir
629
-   local relative
630 634
    local name
631 635
    local sdk
632 636
 
633 637
    configuration="$1"
634 638
    srcdir="$2"
635 639
    builddir="$3"
636
-   relative="$4"
637
-   name="$5"
638
-   sdk="$6"
640
+   name="$4"
641
+   sdk="$5"
639 642
 
640 643
    enforce_build_sanity "${builddir}"
641 644
 
... ...
@@ -649,11 +652,14 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
649 652
    local mapped
650 653
    local suffix
651 654
    local fallback
655
+   local configureflags
652 656
 
653 657
    fallback="`echo "${CONFIGURATIONS}" | tail -1`"
654
-   fallback="`read_build_setting "$name" "fallback-configuration" "${fallback}"`"
658
+   fallback="`read_build_setting "${name}" "fallback-configuration" "${fallback}"`"
659
+
660
+   configureflags="`read_build_setting "${name}" "configure_flags"`"
655 661
 
656
-   mapped="`read_build_setting "$name" "configure-${configuration}.map" "${configuration}"`"
662
+   mapped="`read_build_setting "${name}" "configure-${configuration}.map" "${configuration}"`"
657 663
    suffix="`determine_suffix "${configuration}" "${sdk}"`"
658 664
    sdkpath="`gcc_sdk_parameter "${sdk}"`"
659 665
    sdkpath="`echo "${sdkpath}" | sed -e 's/ /\\ /g'`"
... ...
@@ -699,36 +705,6 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
699 705
       fi
700 706
 
701 707
       # use absolute paths for configure, safer (and easier to read IMO)
702
-       echo "DEPENDENCIES_DIR=\"'${owd}/${REFERENCE_DEPENDENCY_SUBDIR}'\" \
703
-      CFLAGS=\"\
704
--I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
705
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
706
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
707
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
708
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
709
-${other_cflags} \
710
--isysroot ${sdkpath}\" \
711
-      CPPFLAGS=\"\
712
--I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
713
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
714
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
715
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
716
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
717
-${other_cppflags} \
718
--isysroot ${sdkpath}\" \
719
-      LDFLAGS=\"\
720
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
721
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration} \
722
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
723
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
724
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${suffix} \
725
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${configuration} \
726
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${fallback} \
727
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
728
-${other_ldflags} \
729
--isysroot ${sdkpath}\"" > "${logfile1}"
730
-
731
-
732 708
        DEPENDENCIES_DIR="'${owd}/${REFERENCE_DEPENDENCY_SUBDIR}'" \
733 709
        CFLAGS="\
734 710
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
... ...
@@ -757,7 +733,7 @@ ${other_cppflags} \
757 733
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
758 734
 ${other_ldflags} \
759 735
 -isysroot ${sdkpath}" \
760
-       logging_exekutor "${owd}/${srcdir}/configure" \
736
+       logging_exekutor "${owd}/${srcdir}/configure" ${configureflags} \
761 737
           --prefix "${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local" >> "${logfile1}" \
762 738
       || build_fail "${logfile1}" "configure"
763 739
 
... ...
@@ -883,7 +859,6 @@ build_xcodebuild()
883 859
    local configuration
884 860
    local srcdir
885 861
    local builddir
886
-   local relative
887 862
    local name
888 863
    local sdk
889 864
    local project
... ...
@@ -893,17 +868,15 @@ build_xcodebuild()
893 868
    configuration="$1"
894 869
    srcdir="$2"
895 870
    builddir="$3"
896
-   relative="$4"
897 871
    name="$5"
898
-   sdk="$6"
899
-   project="$7"
900
-   schemename="$8"
901
-   targetname="$9"
872
+   sdk="$5"
873
+   project="$6"
874
+   schemename="$7"
875
+   targetname="$8"
902 876
 
903 877
    [ ! -z "${configuration}" ] || internal_fail "configuration is empty"
904 878
    [ ! -z "${srcdir}" ]        || internal_fail "srcdir is empty"
905 879
    [ ! -z "${builddir}" ]      || internal_fail "builddir is empty"
906
-   [ ! -z "${relative}" ]      || internal_fail "relative is empty"
907 880
    [ ! -z "${name}" ]          || internal_fail "name is empty"
908 881
    [ ! -z "${sdk}" ]           || internal_fail "sdk is empty"
909 882
    [ ! -z "${project}" ]       || internal_fail "project is empty"
... ...
@@ -938,7 +911,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
938 911
    local fallback
939 912
 
940 913
    fallback="`echo "${CONFIGURATIONS}" | tail -1`"
941
-   fallback="`read_build_setting "$name" "fallback-configuration" "${fallback}"`"
914
+   fallback="`read_build_setting "${name}" "fallback-configuration" "${fallback}"`"
942 915
 
943 916
    mapped=`read_build_setting "${name}" "${configuration}.map" "${configuration}"`
944 917
    [ -z "${mapped}" ] && internal_fail "mapped configuration is empty"
... ...
@@ -1216,8 +1189,8 @@ build_xcodebuild_schemes_or_target()
1216 1189
    local project
1217 1190
 
1218 1191
    builddir="$3"
1219
-   name="$5"
1220
-   project="$7"
1192
+   name="$4"
1193
+   project="$6"
1221 1194
 
1222 1195
    local scheme
1223 1196
    local schemes
... ...
@@ -1302,7 +1275,6 @@ build_script()
1302 1275
    local configuration
1303 1276
    local srcdir
1304 1277
    local builddir
1305
-   local relative
1306 1278
    local name
1307 1279
    local sdk
1308 1280
    local project
... ...
@@ -1312,9 +1284,8 @@ build_script()
1312 1284
    configuration="$1"
1313 1285
    srcdir="$2"
1314 1286
    builddir="$3"
1315
-   relative="$4"
1316
-   name="$5"
1317
-   sdk="$6"
1287
+   name="$4"
1288
+   sdk="$5"
1318 1289
 
1319 1290
    local logfile
1320 1291
 
... ...
@@ -1411,7 +1382,6 @@ configure"`"
1411 1382
    [ ! -z "${sdks}" ] || fail "setting \"sdks\" must at least contain \"Default\" to build anything"
1412 1383
 
1413 1384
    local builddir
1414
-   local relative
1415 1385
    local hasbuilt
1416 1386
    local configuration
1417 1387
    local preference
... ...
@@ -1441,7 +1411,6 @@ configure"`"
1441 1411
          fi
1442 1412
 
1443 1413
          builddir="${CLONESBUILD_SUBDIR}/${configuration}/${name}"
1444
-         relative="${CLONESBUILD_RELATIVE}/../.."
1445 1414
 
1446 1415
          if [ -d "${builddir}" -a "${CLEAN_BEFORE_BUILD}" = "YES" ]
1447 1416
          then
... ...
@@ -1459,7 +1428,7 @@ configure"`"
1459 1428
                script="`find_build_setting_file "${name}" "bin/build.sh"`"
1460 1429
                if [ -x "${script}" ]
1461 1430
                then
1462
-                  build_script "${script}" "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}" || exit 1
1431
+                  build_script "${script}" "${configuration}" "${srcdir}" "${builddir}" "${name}" "${sdk}" || exit 1
1463 1432
                   hasbuilt=yes
1464 1433
                   break
1465 1434
                else
... ...
@@ -1473,7 +1442,7 @@ configure"`"
1473 1442
 
1474 1443
                if [ "$project" != "" ]
1475 1444
                then
1476
-                  build_xcodebuild_schemes_or_target "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}" "${project}"  || exit 1
1445
+                  build_xcodebuild_schemes_or_target "${configuration}" "${srcdir}" "${builddir}" "${name}" "${sdk}" "${project}"  || exit 1
1477 1446
                   hasbuilt=yes
1478 1447
                   break
1479 1448
                fi
... ...
@@ -1488,7 +1457,7 @@ configure"`"
1488 1457
                fi
1489 1458
                if [ -x "${srcdir}/configure" ]
1490 1459
                then
1491
-                  build_configure "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}"  || exit 1
1460
+                  build_configure "${configuration}" "${srcdir}" "${builddir}" "${name}" "${sdk}"  || exit 1
1492 1461
                   hasbuilt=yes
1493 1462
                   break
1494 1463
                fi
... ...
@@ -1502,7 +1471,7 @@ configure"`"
1502 1471
                   then
1503 1472
                      log_warning "Found a CMakeLists.txt, but cmake is not installed"
1504 1473
                   else
1505
-                     build_cmake "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}"  || exit 1
1474
+                     build_cmake "${configuration}" "${srcdir}" "${builddir}" "${name}" "${sdk}"  || exit 1
1506 1475
                      hasbuilt=yes
1507 1476
                      break
1508 1477
                   fi
... ...
@@ -1550,6 +1519,7 @@ build_wrapper()
1550 1519
 
1551 1520
    export BUILD_DEPENDENCY_SUBDIR
1552 1521
    export REFERENCE_DEPENDENCY_SUBDIR
1522
+
1553 1523
    #
1554 1524
    # move dependencies we have so far away into safety,
1555 1525
    # need that path for includes though
... ...
@@ -1605,12 +1575,32 @@ ${BUILT}"
1605 1575
 }
1606 1576
 
1607 1577
 
1578
+get_source_dir()
1579
+{
1580
+   local name
1581
+
1582
+   name="${1}"
1583
+
1584
+   local srcdir
1585
+   local srcsubdir
1586
+
1587
+   srcdir="${CLONES_SUBDIR}/${name}"
1588
+   srcsubdir="`read_build_setting "${name}" "source_dir"`"
1589
+   if [ ! -z "${srcsubdir}" ]
1590
+   then
1591
+      srcdir="${srcdir}/${srcsubdir}"
1592
+   fi
1593
+   echo "${srcdir}"
1594
+}
1595
+
1596
+
1608 1597
 build_clones()
1609 1598
 {
1610 1599
    local clone
1611 1600
    local xdone
1612 1601
    local name
1613 1602
    local srcdir
1603
+   local srcsubdir
1614 1604
    local old
1615 1605
 
1616 1606
    old="${IFS:-" "}"
... ...
@@ -1643,8 +1633,7 @@ build_clones()
1643 1633
       do
1644 1634
          IFS="$old"
1645 1635
          name="`canonical_clone_name "${clone}"`"
1646
-         srcdir="${CLONES_SUBDIR}/${name}"
1647
-
1636
+         srcdir="`get_source_dir "${name}"`"
1648 1637
          if [ -d "${srcdir}" ]
1649 1638
          then
1650 1639
             build_if_alive  "${name}" "${srcdir}" || exit 1
... ...
@@ -1667,7 +1656,7 @@ build_clones()
1667 1656
             IFS="$old"
1668 1657
 
1669 1658
             name="`canonical_name_from_clone "${clone}"`"
1670
-            srcdir="${CLONES_SUBDIR}/${name}"
1659
+            srcdir="`get_source_dir "${name}"`"
1671 1660
 
1672 1661
             if [ -d "${srcdir}" ]
1673 1662
             then
... ...
@@ -1680,7 +1669,7 @@ build_clones()
1680 1669
    else
1681 1670
       for name in "$@"
1682 1671
       do
1683
-         srcdir="${CLONES_SUBDIR}/${name}"
1672
+         srcdir="`get_source_dir "${name}"`"
1684 1673
 
1685 1674
          if [ -d "${srcdir}" ]
1686 1675
          then
... ...
@@ -432,12 +432,14 @@ checkout()
432 432
    local dstdir
433 433
    local branch
434 434
    local tag
435
+   local scm
435 436
 
436 437
    name="$1"
437 438
    url="$2"
438 439
    dstdir="$3"
439 440
    branch="$4"
440 441
    tag="$5"
442
+   scm="$6"
441 443
 
442 444
    [ ! -z "$name" ]   || internal_fail "name is empty"
443 445
    [ ! -z "$url" ]    || internal_fail "url is empty"
... ...
@@ -454,7 +456,6 @@ checkout()
454 456
    fi
455 457
    name2="`basename -- "${url}"`"  # only works for git really
456 458
 
457
-   local scmflagsdefault
458 459
 
459 460
    #
460 461
    # this implicitly ensures, that these folders are
... ...
@@ -475,9 +476,9 @@ checkout()
475 476
 
476 477
    local operation
477 478
    local map
479
+   local scmflagsdefault
478 480
 
479
-   map="`read_fetch_setting "${name}.scm"`"
480
-   case "${map}" in
481
+   case "${scm}" in
481 482
       git|"" )
482 483
          operation="git_clone"
483 484
          scmflagsdefault="--recursive"
... ...
@@ -487,7 +488,7 @@ checkout()
487 488
          ;;
488 489
 
489 490
       *)
490
-         fail "unknown scm system ${map}"
491
+         fail "unknown scm system ${scm}"
491 492
          ;;
492 493
    esac
493 494
 
... ...
@@ -606,18 +607,17 @@ Suggested fix:
606 607
 #
607 608
 checkout_repository()
608 609
 {
609
-   local dstdir
610 610
    local name
611
-   local flag
612 611
    local url
612
+   local dstdir
613 613
    local branch
614
-   local tag
615 614
 
616 615
    name="$1"
617 616
    url="$2"
618 617
    dstdir="$3"
619 618
    branch="$4"
620
-   tag="$5"
619
+
620
+   local flag
621 621
 
622 622
    if [ ! -e "${dstdir}" ]
623 623
    then
... ...
@@ -659,10 +659,12 @@ clone_repository()
659 659
    local name
660 660
    local url
661 661
    local branch
662
+   local scm
662 663
 
663 664
    name="$1"
664 665
    url="$2"
665 666
    branch="$3"
667
+   scm="$4"
666 668
 
667 669
    local tag
668 670
    local dstdir
... ...
@@ -675,7 +677,7 @@ clone_repository()
675 677
    # mark the checkout progress, so that we don't do incomplete fetches and
676 678
    # later on happily build
677 679
 
678
-   checkout_repository "${name}" "${url}" "${dstdir}" "${branch}" "${tag}"
680
+   checkout_repository "${name}" "${url}" "${dstdir}" "${branch}" "${tag}" "${scm}"
679 681
    flag=$?
680 682
 
681 683
    return $flag
... ...
@@ -710,6 +712,7 @@ clone_repositories()
710 712
    local fetched
711 713
    local match
712 714
    local branch
715
+   local scm
713 716
 
714 717
    old="${IFS:-" "}"
715 718
    fetched=""
... ...
@@ -742,8 +745,9 @@ ${clone}"
742 745
                name="`canonical_name_from_clone "${clone}"`"
743 746
                url="`url_from_clone "${clone}"`"
744 747
                branch="`branch_from_clone "${clone}"`"
748
+               scm="`scm_from_clone "${clone}"`"
745 749
 
746
-               clone_repository "${name}" "${url}" "${branch}"
750
+               clone_repository "${name}" "${url}" "${branch}" "${scm}"
747 751
 
748 752
                if [ $? -eq 1 ]
749 753
                then
... ...
@@ -763,6 +767,8 @@ ${clone}"
763 767
 
764 768
       name="`canonical_name_from_clone "${clone}"`"
765 769
       url="`url_from_clone "${clone}"`"
770
+      branch="`branch_from_clone "${clone}"`"
771
+
766 772
       did_clone_repository "${name}" "${url}" "${branch}"
767 773
    done
768 774
 
... ...
@@ -783,6 +789,7 @@ install_embedded_repositories()
783 789
    local url
784 790
    local dstdir
785 791
    local branch
792
+   local scm
786 793
 
787 794
    old="${IFS:-" "}"
788 795
 
... ...
@@ -801,6 +808,7 @@ install_embedded_repositories()
801 808
          name="`canonical_name_from_clone "${clone}"`"
802 809
          url="`url_from_clone "${clone}"`"
803 810
          branch="`branch_from_clone "${clone}"`"
811
+         scm="`scm_from_clone "${clone}"`"
804 812
 
805 813
          tag="`read_repo_setting "${name}" "tag"`" #repo (sic)
806 814
          dstdir="${dstprefix}${name}"
... ...
@@ -816,7 +824,7 @@ install_embedded_repositories()
816 824
             old_forbidden="${SYMLINK_FORBIDDEN}"
817 825
 
818 826
             SYMLINK_FORBIDDEN="YES"
819
-            checkout "${name}" "${url}" "${dstdir}" "${branch}" "${tag}"
827
+            checkout "${name}" "${url}" "${dstdir}" "${branch}" "${tag}" "${scm}"
820 828
             SYMLINK_FORBIDDEN="$old_forbidden"
821 829
 
822 830
             if read_yes_no_config_setting "update_gitignore" "YES"
... ...
@@ -863,22 +871,22 @@ update()
863 871
    local branch
864 872
    local tag
865 873
    local dstdir
874
+   local scm
866 875
 
867 876
    name="$1"
868 877
    url="$2"
869 878
    dstdir="$3"
870 879
    branch="$4"
871 880
    tag="$5"
881
+   scm="$6"
872 882
 
873 883
    [ ! -z "$url" ]           || internal_fail "url is empty"
874 884
    exekutor [ -d "$dstdir" ] || internal_fail "dstdir \"${dstdir}\" is wrong ($PWD)"
875 885
    [ ! -z "$name" ]          || internal_fail "name is empty"
876 886
 
877
-   local map
878 887
    local operation
879 888
 
880
-   map="`read_fetch_setting "${name}.scm"`"
881
-   case "${map}" in
889
+   case "${scm}" in
882 890
       git|"" )
883 891
          operation="git_pull"
884 892
          ;;
... ...
@@ -887,7 +895,7 @@ update()
887 895
          ;;
888 896
 
889 897
       *)
890
-         fail "unknown scm system ${map}"
898
+         fail "unknown scm system ${scm}"
891 899
          ;;
892 900
    esac
893 901
 
... ...
@@ -1127,15 +1135,15 @@ main()
1127 1135
    #
1128 1136
    if [ "${COMMAND}" = "install" ]
1129 1137
    then
1138
+      install_brews
1139
+      install_gems
1140
+      install_pips
1130 1141
 
1131 1142
       clone_repositories
1132 1143
 
1133 1144
       install_embedded_repositories
1134
-      install_brews
1135
-      install_gems
1136
-      install_pips
1137
-      check_tars
1138 1145
 
1146
+      check_tars
1139 1147
    else
1140 1148
       update_repositories "$@"
1141 1149
 
... ...
@@ -665,19 +665,25 @@ count_clone_components()
665 665
 
666 666
 url_from_clone()
667 667
 {
668
-   echo "$@" | tr ';' '\012' | head -1
668
+   echo "$@" | cut '-d;' -f 1
669 669
 }
670 670
 
671 671
 
672 672
 _name_part_from_clone()
673 673
 {
674
-   echo "$@" | tr ';' '\012' | head -2 | tail -1
674
+   echo "$@" | cut '-d;' -f 2
675 675
 }
676 676
 
677 677
 
678 678
 _branch_part_from_clone()
679 679
 {
680
-   echo "$@" | tr ';' '\012' | head -3 | tail -1
680
+   echo "$@" | cut '-d;' -f 3
681
+}
682
+
683
+
684
+_scm_part_from_clone()
685
+{
686
+   echo "$@" | cut '-d;' -f 4
681 687
 }
682 688
 
683 689
 
... ...
@@ -712,6 +718,17 @@ branch_from_clone()
712 718
 }
713 719
 
714 720
 
721
+scm_from_clone()
722
+{
723
+   local count
724
+
725
+   count="`count_clone_components "$@"`"
726
+   if [ "$count" -ge 4 ]
727
+   then
728
+      _scm_part_from_clone "$@"
729
+   fi
730
+}
731
+
715 732
 
716 733
 # http://askubuntu.com/questions/152001/how-can-i-get-octal-file-permissions-from-command-line
717 734
 lso()
... ...
@@ -88,23 +88,6 @@ then
88 88
    CLONESFETCH_SUBDIR="${CLONES_SUBDIR}"
89 89
 fi
90 90
 
91
-if [ "${CLONESFETCH_RELATIVE}" = "" ]
92
-then
93
-   CLONESFETCH_RELATIVE=`compute_relative "${CLONESFETCH_SUBDIR}"`
94
-fi
95
-
96
-#
97
-#
98
-#
99
-if [ "${CLONESBUILD_RELATIVE}" = "" ]
100
-then
101
-   CLONESBUILD_RELATIVE=`compute_relative "${CLONESBUILD_SUBDIR}"`
102
-fi
103
-
104
-if [ "${CLONES_RELATIVE}" = "" ]
105
-then
106
-   CLONES_RELATIVE=`compute_relative "${CLONES_SUBDIR}"`
107
-fi
108 91
 
109 92
 #
110 93
 # some checks
... ...
@@ -114,8 +97,6 @@ fi
114 97
 [ -z "${CLONESBUILD_SUBDIR}" ]   && internal_fail "variable CLONESBUILD_SUBDIR is empty"
115 98
 [ -z "${BUILDLOG_SUBDIR}" ]      && internal_fail "variable BUILDLOG_SUBDIR is empty"
116 99
 [ -z "${DEPENDENCY_SUBDIR}" ]    && internal_fail "variable DEPENDENCY_SUBDIR is empty"
117
-[ -z "${CLONES_RELATIVE}" ]      && internal_fail "variable CLONES_RELATIVE is empty"
118
-[ -z "${CLONESBUILD_RELATIVE}" ] && internal_fail "CLONESBUILD_RELATIVE is empty"
119 100
 
120 101
 #
121 102
 # Global Settings
... ...
@@ -109,7 +109,7 @@ refresh_repositories_settings()
109 109
       if [ "${clones}" != "" ]
110 110
       then
111 111
          IFS="
112
-   "
112
+"
113 113
          for clone in ${clones}
114 114
          do
115 115
             IFS="${old}"
... ...
@@ -140,7 +140,6 @@ ${clone}"
140 140
                if [ $flag -eq 0 ]
141 141
                then
142 142
                   stop=0
143
-                  break
144 143
                fi
145 144
             fi
146 145
          done
... ...
@@ -547,6 +547,14 @@ ${result}"
547 547
 
548 548
    IFS="${old}"
549 549
 
550
+   if [ "$MULLE_BOOTSTRAP_TRACE_SETTINGS" = "YES" ]
551
+   then
552
+      log_trace2 "----------------"
553
+      log_trace2 "merged settings:"
554
+      log_trace2 "----------------"
555
+      log_trace2 "${result}"
556
+      log_trace2 "----------------"
557
+   fi
550 558
    echo "${result}"
551 559
 }
552 560