Browse code

Fix finds again for Linux and Mac compatility. Refactored some internal functions a bit.

Nat! authored on 17-10-2015 16:36:00
Showing 4 changed files
... ...
@@ -85,10 +85,10 @@ dispense_headers()
85 85
          mkdir_if_missing "${dst}"
86 86
 
87 87
          log_fluff "Copying ${C_RESET}${src}${C_FLUFF} to ${C_RESET}${dst}${C_FLUFF}"
88
-         exekutor find -xdev "${src}" -mindepth 1 -maxdepth 1 ! -path "${src}" -type d -print0 | \
88
+         exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 -type d -print0 | \
89 89
             exekutor xargs -0 -I % mv ${COPYMOVEFLAGS} -n % "${dst}"
90 90
          [ $? -eq 0 ]  || exit 1
91
-         exekutor find -xdev "${src}" -mindepth 1 -maxdepth 1 ! -path "${src}" \( -type f -o -type l \) -print0 | \
91
+         exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 \( -type f -o -type l \) -print0 | \
92 92
             exekutor xargs -0 -I % mv ${COPYMOVEFLAGS} -n % "${dst}"
93 93
          [ $? -eq 0 ]  || exit 1
94 94
 
... ...
@@ -130,7 +130,7 @@ dispense_binaries()
130 130
 
131 131
          log_fluff "Copying ${C_RESET}${src}${C_FLUFF} to ${C_RESET}${dst}${C_FLUFF}"
132 132
          mkdir_if_missing "${dst}"
133
-         exekutor find -xdev "${src}" -mindepth 1 -maxdepth 1 ! -path "${src}" \( -type "${findtype}" -o -type "${findtype2}" \) -print0 | \
133
+         exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 \( -type "${findtype}" -o -type "${findtype2}" \) -print0 | \
134 134
             exekutor xargs -0 -I % mv ${COPYMOVEFLAGS} -n % "${dst}"
135 135
          [ $? -eq 0 ]  || exit 1
136 136
       else
... ...
@@ -248,7 +248,7 @@ collect_and_dispense_product()
248 248
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${usrlocal}"
249 249
 
250 250
          log_fluff "Copying everything from ${C_RESET}${src}${C_FLUFF} to ${C_RESET}${dst}${C_FLUFF}"
251
-         exekutor find -xdev "${src}" -mindepth 1 -maxdepth 1 ! -path "${src}" -print0 | \
251
+         exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 -print0 | \
252 252
                exekutor xargs -0 -I % mv -v -n % "${dst}"
253 253
          [ $? -eq 0 ]  || fail "moving files from ${src} to ${dst} failed"
254 254
       fi
... ...
@@ -442,8 +442,8 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
442 442
 
443 443
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
444 444
 
445
-   logfile1="`build_log_name "${name}" "cmake" "${configuration}" "${sdk}"`"
446
-   logfile2="`build_log_name "${name}" "make" "${configuration}" "${sdk}"`"
445
+   logfile1="`build_log_name "cmake" "${name}" "${configuration}" "${sdk}"`"
446
+   logfile2="`build_log_name "make" "${name}" "${configuration}" "${sdk}"`"
447 447
 
448 448
    log_info "Build logs will be in ${C_RESET}${logfile1}${C_INFO} and ${C_RESET}${logfile2}${C_INFO}"
449 449
 
... ...
@@ -491,7 +491,7 @@ ${other_ldflags} \
491 491
 ${sdk}" \
492 492
 "${relative}/${srcdir}" >> "${logfile1}" || build_fail "${logfile1}" "cmake"
493 493
 
494
-      logging_exekutor make all install >> "${logfile2}" || build_fail "${logfile2}" "make"
494
+      logging_exekutor make VERBOSE=1 all install >> "${logfile2}" || build_fail "${logfile2}" "make"
495 495
 
496 496
       set +f
497 497
 
... ...
@@ -549,8 +549,8 @@ ${C_MAGENTA}${name}${C_INFO} for SDK ${C_MAGENTA}${sdk}${C_INFO} ..."
549 549
 
550 550
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
551 551
 
552
-   logfile1="`build_log_name "${name}" "configure" "${configuration}" "${sdk}"`"
553
-   logfile2="`build_log_name "${name}" "make" "${configuration}" "${sdk}"`"
552
+   logfile1="`build_log_name "configure" "${name}" "${configuration}" "${sdk}"`"
553
+   logfile2="`build_log_name "make" "${name}" "${configuration}" "${sdk}"`"
554 554
 
555 555
    log_info "Build logs will be in ${C_RESET}${logfile1}${C_INFO} and ${C_RESET}${logfile2}${C_INFO}"
556 556
 
... ...
@@ -738,33 +738,6 @@ fixup_header_path()
738 738
 }
739 739
 
740 740
 
741
-escaped_spaces()
742
-{
743
-   echo "$1" | sed 's/ /\\ /g'
744
-}
745
-
746
-
747
-combined_escaped_search_path()
748
-{
749
-   for i in "$@"
750
-   do
751
-      if [ ! -z "$i" ]
752
-      then
753
-         i="`escaped_spaces "$i"`"
754
-         if [ -z "$path" ]
755
-         then
756
-            path="$i"
757
-         else
758
-            path="$path $i"
759
-         fi
760
-      fi
761
-   done
762
-
763
-   echo "${path}"
764
-}
765
-
766
-
767
-
768 741
 build_xcodebuild()
769 742
 {
770 743
    local configuration
... ...
@@ -787,13 +760,13 @@ build_xcodebuild()
787 760
    schemename="$8"
788 761
    targetname="$9"
789 762
 
790
-   [ -z "${configuration}" ] && internal_fail "configuration is empty"
791
-   [ -z "${srcdir}" ]      && internal_fail "srcdir is empty"
792
-   [ -z "${builddir}" ]    && internal_fail "builddir is empty"
793
-   [ -z "${relative}" ]    && internal_fail "relative is empty"
794
-   [ -z "${name}" ]        && internal_fail "name is empty"
795
-   [ -z "${sdk}" ]         && internal_fail "sdk is empty"
796
-   [ -z "${project}" ]     && internal_fail "project is empty"
763
+   [ ! -z "${configuration}" ] || internal_fail "configuration is empty"
764
+   [ ! -z "${srcdir}" ]        || internal_fail "srcdir is empty"
765
+   [ ! -z "${builddir}" ]      || internal_fail "builddir is empty"
766
+   [ ! -z "${relative}" ]      || internal_fail "relative is empty"
767
+   [ ! -z "${name}" ]          || internal_fail "name is empty"
768
+   [ ! -z "${sdk}" ]           || internal_fail "sdk is empty"
769
+   [ ! -z "${project}" ]       || internal_fail "project is empty"
797 770
 
798 771
    enforce_build_sanity "${builddir}"
799 772
 
... ...
@@ -921,7 +894,7 @@ ${info} ..."
921 894
 
922 895
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
923 896
 
924
-   logfile="`build_log_name "${name}" "xcodebuild" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`"
897
+   logfile="`build_log_name "xcodebuild" "${name}" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`"
925 898
    log_info "Build log will be in ${C_RESET}${logfile}${C_INFO}"
926 899
 
927 900
    set -f
... ...
@@ -1170,13 +1143,12 @@ build_script()
1170 1143
 
1171 1144
 build()
1172 1145
 {
1146
+   local name
1173 1147
    local srcdir
1174 1148
 
1175
-   srcdir="$1"
1176
-
1177
-   local name
1149
+   name="$1"
1150
+   srcdir="$2"
1178 1151
 
1179
-   name=`basename "${srcdir}"`
1180 1152
    [ "${name}" != "${CLONES_SUBDIR}" ] || internal_fail "missing repo argument (${srcdir})"
1181 1153
 
1182 1154
    local preferences
... ...
@@ -1315,12 +1287,11 @@ Release"`"
1315 1287
 #
1316 1288
 build_wrapper()
1317 1289
 {
1318
-   local dstdir
1290
+   local srcdir
1319 1291
    local name
1320 1292
 
1321
-   dstdir="$1"
1322
-   name="$2"
1323
-
1293
+   name="$1"
1294
+   srcdir="$2"
1324 1295
 
1325 1296
    REFERENCE_DEPENDENCY_SUBDIR="${DEPENDENCY_SUBDIR}"
1326 1297
    BUILD_DEPENDENCY_SUBDIR="${DEPENDENCY_SUBDIR}/tmp"
... ...
@@ -1342,11 +1313,11 @@ build_wrapper()
1342 1313
    # need that path for includes though
1343 1314
    #
1344 1315
 
1345
-   run_repo_settings_script "${dstdir}" "${name}" "pre-build" "$@" || exit 1
1316
+   run_repo_settings_script "${name}" "${srcdir}" "pre-build" "$@" || exit 1
1346 1317
 
1347
-   build "${dstdir}" || exit 1
1318
+   build "${name}" "${srcdir}" || exit 1
1348 1319
 
1349
-   run_repo_settings_script "${dstdir}" "${name}" "post-build" "$@" || exit 1
1320
+   run_repo_settings_script "${name}" "${srcdir}" "post-build" "$@" || exit 1
1350 1321
 
1351 1322
    log_fluff "Remove \"${BUILD_DEPENDENCY_SUBDIR}\""
1352 1323
 
... ...
@@ -1359,23 +1330,26 @@ build_wrapper()
1359 1330
 }
1360 1331
 
1361 1332
 
1362
-build_if_readable()
1333
+build_if_alive()
1363 1334
 {
1364
-   local dstdir
1365 1335
    local name
1336
+   local srcdir
1366 1337
 
1367
-   dstdir="$1"
1368
-   name="$2"
1338
+   name="$1"
1339
+   srcdir="$2"
1369 1340
 
1370 1341
    local xdone
1371
-   if [ ! -r "${dstdir}" ]
1342
+   local zombie
1343
+
1344
+   zombie="`dirname "${srcdir}"`/.zombies/${name}"
1345
+   if [ -e "${zombie}" ]
1372 1346
    then
1373
-      echo "Ignoring orphaned repo ${name}" >&2
1347
+      log_warning "Ignoring zombie repo ${name} as ${C_RESET}${zombie}${C_WARNING} exists"
1374 1348
    else
1375 1349
       xdone="`/bin/echo "${BUILT}" | grep -x "${name}"`"
1376 1350
       if [ "$xdone" = "" ]
1377 1351
       then
1378
-         build_wrapper "${dstdir}" "${name}"
1352
+         build_wrapper "${name}" "${srcdir}" 
1379 1353
          BUILT="${name}
1380 1354
 ${BUILT}"
1381 1355
       else
... ...
@@ -1390,7 +1364,7 @@ build_clones()
1390 1364
    local clone
1391 1365
    local xdone
1392 1366
    local name
1393
-   local dstdir
1367
+   local srcdir
1394 1368
 
1395 1369
    for clone in ${CLONES_SUBDIR}/*.failed
1396 1370
    do
... ...
@@ -1416,13 +1390,13 @@ build_clones()
1416 1390
       for clone in `read_build_root_setting "build_order"`
1417 1391
       do
1418 1392
          name="`canonical_clone_name "${clone}"`"
1419
-         dstdir="${CLONES_SUBDIR}/${name}"
1393
+         srcdir="${CLONES_SUBDIR}/${name}"
1420 1394
 
1421
-         if [ -d "${dstdir}" ]
1395
+         if [ -d "${srcdir}" ]
1422 1396
          then
1423
-            build_if_readable "${dstdir}" "${name}"  || exit 1
1397
+            build_if_alive  "${name}" "${srcdir}" || exit 1
1424 1398
          else
1425
-            fail "build_order contains unknown repo \"${clone}\" (\"${dstdir}\")"
1399
+            fail "build_order contains unknown repo \"${clone}\" (\"${srcdir}\")"
1426 1400
          fi
1427 1401
       done
1428 1402
 
... ...
@@ -1435,24 +1409,24 @@ build_clones()
1435 1409
          for clone in ${clones}
1436 1410
          do
1437 1411
             name="`canonical_clone_name "${clone}"`"
1438
-            dstdir="${CLONES_SUBDIR}/${name}"
1412
+            srcdir="${CLONES_SUBDIR}/${name}"
1439 1413
 
1440
-            if [ -d "${dstdir}" ]
1414
+            if [ -d "${srcdir}" ]
1441 1415
             then
1442
-               build_if_readable "${dstdir}" "${name}" || exit  1
1416
+               build_if_alive "${name}" "${srcdir}" || exit  1
1443 1417
             else
1444
-               fail "repo for \"${clone}\" not found (\"${dstdir}\") ($PWD)"
1418
+               fail "repo for \"${clone}\" not found (\"${srcdir}\") ($PWD)"
1445 1419
             fi
1446 1420
          done
1447 1421
       fi
1448 1422
    else
1449 1423
       for name in "$@"
1450 1424
       do
1451
-         dstdir="${CLONES_SUBDIR}/${name}"
1425
+         srcdir="${CLONES_SUBDIR}/${name}"
1452 1426
 
1453
-         if [ -d "${dstdir}" ]
1427
+         if [ -d "${srcdir}" ]
1454 1428
          then
1455
-            build_if_readable "${dstdir}" "${name}" || exit 1
1429
+            build_if_alive "${name}" "${srcdir}"|| exit 1
1456 1430
          else
1457 1431
             fail "unknown repo ${name}"
1458 1432
          fi
... ...
@@ -428,7 +428,7 @@ bootstrap_auto_update()
428 428
       return 1
429 429
    fi
430 430
 
431
-   log_info "Recursively acquiring ${dstname} .bootstrap settings ..."
431
+   log_info "Recursively acquiring ${dstdir} .bootstrap settings ..."
432 432
 
433 433
    # prepare auto folder if it doesn't exist yet
434 434
    if [ ! -d "${BOOTSTRAP_SUBDIR}.auto" ]
... ...
@@ -493,7 +493,7 @@ bootstrap_auto_update()
493 493
 
494 494
       mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
495 495
       relative="`compute_relative "${BOOTSTRAP_SUBDIR}"`"
496
-      exekutor find "${dst}/.bootstrap/settings" -type f -mindepth 1 -maxdepth 1 -print0 | \
496
+      exekutor find "${dst}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type f -print0 | \
497 497
          exekutor xargs -0 -I % ln -s -f "${relative}/../../"% "${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
498 498
 
499 499
       if [ -e "${dst}/.bootstrap/settings/bin"  ]
... ...
@@ -503,7 +503,7 @@ bootstrap_auto_update()
503 503
 
504 504
       # flatten other folders into our own settings
505 505
       # don't force though, keep first
506
-      exekutor find "${dst}/.bootstrap/settings" -mindepth 1 -maxdepth 1 ! -name bin -type d -print0 | \
506
+      exekutor find "${dst}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type d -print0 | \
507 507
          exekutor xargs -0 -I % ln -s "${relative}/../"% "${BOOTSTRAP_SUBDIR}.auto/settings"
508 508
    fi
509 509
 
... ...
@@ -529,20 +529,29 @@ ensure_clones_directory()
529 529
 }
530 530
 
531 531
 
532
+#
533
+# used to do this with chmod -h, alas Linux can't do that
534
+# So we create a special directory .zombies
535
+# and create files there
536
+#
532 537
 mark_all_zombies()
533 538
 {
534 539
    local i
540
+   local name
535 541
 
536 542
       # first mark all repos as stale
537 543
    if dir_has_files "${CLONES_FETCH_SUBDIR}"
538 544
    then
539 545
       log_fluff "Marking all repositories as zombies for now"
540 546
 
547
+      mkdir_if_missing "${CLONES_FETCH_SUBDIR}/.zombies"
548
+
541 549
       for i in `ls -1d "${CLONES_FETCH_SUBDIR}/"*`
542 550
       do
543 551
          if [ -d "${i}" -o -L "${i}" ]
544 552
          then
545
-            exekutor chmod -h 000 "${i}"
553
+            name="`basename "${i}"`"
554
+            exekutor touch "${CLONES_FETCH_SUBDIR}/.zombies/${name}"
546 555
          fi
547 556
       done
548 557
    fi
... ...
@@ -551,31 +560,41 @@ mark_all_zombies()
551 560
 
552 561
 mark_alive()
553 562
 {
554
-   local dstname
563
+   local dstdir
564
+   local name
555 565
 
556
-   dstname="$1"
566
+   name="$1"
567
+   dstdir="$2"
557 568
 
558 569
    local permission
570
+   local zombie
571
+
572
+   zombie="`dirname "${dstdir}"`/.zombies/${name}"
559 573
 
560 574
    # mark as alive
561
-   if [ -d "${dstname}" -o -L "${dstname}" ] && [ ! -r "${dstname}" ]
575
+   if [ -d "${dstdir}" -o -L "${dstdir}" ]
562 576
    then
563
-      permission="`lso "${CLONES_FETCH_SUBDIR}"`"
564
-      [ ! -z "$permission" ] || fail "failed to get permission of ${CLONES_FETCH_SUBDIR}"
565
-      exekutor chmod -h "${permission}" "${dstname}"
577
+      if [ -e "${zombie}" ]
578
+      then
579
+         log_fluff "Mark ${C_RESET}${dstdir}${C_FLUFF} as alive"
566 580
 
567
-      log_fluff "Marked \"${dstname}\" as alive"
581
+         exekutor rm -f "${zombie}" || fail "failed to delete zombie ${zombie}"
582
+      else
583
+         log_fluff "Marked ${C_RESET}${dstdir}${C_FLUFF} is already alive"
584
+      fi
585
+   else
586
+      log_fluff "${C_RESET}${dstdir}${C_FLUFF} is neither a symlink nor a directory"
568 587
    fi
569 588
 }
570 589
 
571 590
 
572 591
 log_fetch_action()
573 592
 {
574
-   local dstname
593
+   local dstdir
575 594
    local clone
576 595
 
577 596
    clone="$1"
578
-   dstname="$2"
597
+   dstdir="$2"
579 598
 
580 599
    local info
581 600
 
... ...
@@ -586,7 +605,7 @@ log_fetch_action()
586 605
       info=" "
587 606
    fi
588 607
 
589
-   log_fluff "Perform ${COMMAND}${info}${clone} in ${dstname} ..."
608
+   log_fluff "Perform ${COMMAND}${info}${clone} in ${dstdir} ..."
590 609
 }
591 610
 
592 611
 
... ...
@@ -595,16 +614,16 @@ checkout()
595 614
    local clone
596 615
    local name
597 616
    local tag
598
-   local dstname
617
+   local dstdir
599 618
 
600 619
    clone="$1"
601 620
    name="$2"
602
-   dstname="$3"
621
+   dstdir="$3"
603 622
    tag="$4"
604 623
 
605
-   [ ! -z "$clone" ]   || internal_fail "clone is empty"
606
-   [ ! -z "$name" ]    || internal_fail "name is empty"
607
-   [ ! -z "$dstname" ] || internal_fail "dstname is empty"
624
+   [ ! -z "$clone" ]  || internal_fail "clone is empty"
625
+   [ ! -z "$name" ]   || internal_fail "name is empty"
626
+   [ ! -z "$dstdir" ] || internal_fail "dstdir is empty"
608 627
 
609 628
    local srcname
610 629
    local operation
... ...
@@ -691,8 +710,8 @@ Use it ?"
691 710
          ;;
692 711
       esac
693 712
 
694
-      "${operation}" "${srcname}" "${dstname}" "${tag}"
695
-      mulle-bootstrap-warn-scripts.sh "${dstname}/.bootstrap" "${dstname}" || fail "Ok, aborted"  #sic
713
+      "${operation}" "${srcname}" "${dstdir}" "${tag}"
714
+      mulle-bootstrap-warn-scripts.sh "${dstdir}/.bootstrap" "${dstdir}" || fail "Ok, aborted"  #sic
696 715
    fi
697 716
 }
698 717
 
... ...
@@ -707,25 +726,25 @@ Use it ?"
707 726
 #
708 727
 checkout_repository()
709 728
 {
710
-   local dstname
729
+   local dstdir
711 730
    local name
712 731
    local flag
713 732
 
714 733
    name="$2"
715
-   dstname="$3"
734
+   dstdir="$3"
716 735
 
717
-   if [ ! -e "${dstname}" ]
736
+   if [ ! -e "${dstdir}" ]
718 737
    then
719 738
       checkout "$@"
720 739
       flag=1
721 740
 
722 741
       if [ "${COMMAND}" = "install" -a "${DONT_RECURSE}" = "" ]
723 742
       then
724
-         bootstrap_auto_update "${dstname}"
743
+         bootstrap_auto_update "${dstdir}"
725 744
          flag=$?
726 745
       fi
727 746
 
728
-      run_build_settings_script "${dstname}" "${name}" "post-${COMMAND}" "$@"
747
+      run_build_settings_script "${name}" "${dstdir}" "post-${COMMAND}" "$@"
729 748
 
730 749
       # means we recursed and should start fetch from top
731 750
       if [ ${flag} -eq 0 ]
... ...
@@ -734,7 +753,7 @@ checkout_repository()
734 753
       fi
735 754
 
736 755
    else
737
-      log_fluff "Repository \"${dstname}\" already exists"
756
+      log_fluff "Repository ${C_RESET}${dstdir}${C_FLUFF} already exists"
738 757
    fi
739 758
    return 0
740 759
 }
... ...
@@ -748,15 +767,15 @@ clone_repository()
748 767
 
749 768
    local name
750 769
    local tag
751
-   local dstname
770
+   local dstdir
752 771
 
753 772
    name="`basename "${clone}" .git`"
754 773
    tag="`read_repo_setting "${name}" "tag"`" #repo (sic)
755
-   dstname="${CLONES_FETCH_SUBDIR}/${name}"
756
-   mark_alive "${dstname}"
757
-   log_fetch_action "${name}" "${dstname}"
774
+   dstdir="${CLONES_FETCH_SUBDIR}/${name}"
775
+   mark_alive "${name}" "${dstdir}"
776
+   log_fetch_action "${name}" "${dstdir}"
758 777
 
759
-   checkout_repository "${clone}" "${name}" "${dstname}" "${tag}"
778
+   checkout_repository "${clone}" "${name}" "${dstdir}" "${tag}"
760 779
 }
761 780
 
762 781
 
... ...
@@ -767,12 +786,12 @@ did_clone_repository()
767 786
    clone="$1"
768 787
 
769 788
    local name
770
-   local dstname
789
+   local dstdir
771 790
 
772 791
    name="`basename "${clone}" .git`"
773
-   dstname="${CLONES_FETCH_SUBDIR}/${name}"
792
+   dstdir="${CLONES_FETCH_SUBDIR}/${name}"
774 793
 
775
-   run_build_settings_script "${dstname}" "${name}" "did-install" "${dstname}" "${name}"
794
+   run_build_settings_script "${name}" "${dstdir}" "did-install" "${dstdir}" "${name}"
776 795
 }
777 796
 
778 797
 
... ...
@@ -819,33 +838,33 @@ update()
819 838
    local clone
820 839
    local name
821 840
    local tag
822
-   local dstname
841
+   local dstdir
823 842
 
824 843
    clone="$1"
825 844
    name="$2"
826
-   dstname="$3"
845
+   dstdir="$3"
827 846
    tag="$4"
828 847
 
829
-   [ ! -z "$clone" ] ||internal_fail "clone is empty"
830
-   exekutor [ -d "$dstname" ] || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
831
-   [ ! -z "$name" ]  || internal_fail "name is empty"
848
+   [ ! -z "$clone" ]         || internal_fail "clone is empty"
849
+   exekutor [ -d "$dstdir" ] || internal_fail "dstdir \"${dstdir}\" is wrong ($PWD)"
850
+   [ ! -z "$name" ]          || internal_fail "name is empty"
832 851
 
833 852
    local script
834 853
 
835
-   log_info "Updating \"${dstname}\""
836
-   if [ ! -L "${dstname}"  ]
854
+   log_info "Updating \"${dstdir}\""
855
+   if [ ! -L "${dstdir}"  ]
837 856
    then
838
-      run_repo_settings_script "${dstname}" "${name}" "pre-update" "%@"
857
+      run_repo_settings_script "${name}" "${dstdir}" "pre-update" "%@"
839 858
 
840 859
       script="`find_repo_setting_file "${name}" "bin/update.sh"`"
841 860
       if [ ! -z "${script}" ]
842 861
       then
843 862
          run_script "${script}" "$@"
844 863
       else
845
-         exekutor git_pull "${dstname}" "${tag}"
864
+         exekutor git_pull "${dstdir}" "${tag}"
846 865
       fi
847 866
 
848
-      run_repo_settings_script "${dstname}" "${name}" "post-update" "%@"
867
+      run_repo_settings_script "${name}" "${dstdir}" "post-update" "%@"
849 868
    fi
850 869
 }
851 870
 
... ...
@@ -858,18 +877,18 @@ update_repository()
858 877
 
859 878
    local name
860 879
    local tag
861
-   local dstname
880
+   local dstdir
862 881
 
863 882
    name="`basename "${clone}" .git`"
864 883
    tag="`read_repo_setting "${name}" "tag"`" #repo (sic)
865 884
 
866
-   dstname="${CLONES_FETCH_SUBDIR}/${name}"
867
-   exekutor [ -e "${dstname}" ] || fail "You need to install first, before updating"
868
-   exekutor [ -x "${dstname}" ] || fail "${name} is not anymore in \"gits\""
885
+   dstdir="${CLONES_FETCH_SUBDIR}/${name}"
886
+   exekutor [ -e "${dstdir}" ] || fail "You need to install first, before updating"
887
+   exekutor [ -x "${dstdir}" ] || fail "${name} is not anymore in \"gits\""
869 888
 
870
-   log_fetch_action "${clone}" "${dstname}"
889
+   log_fetch_action "${clone}" "${dstdir}"
871 890
 
872
-   update "${clone}" "${name}" "${dstname}" "${tag}"
891
+   update "${clone}" "${name}" "${dstdir}" "${tag}"
873 892
 }
874 893
 
875 894
 
... ...
@@ -880,12 +899,12 @@ did_update_repository()
880 899
    clone="$1"
881 900
 
882 901
    local name
883
-   local dstname
902
+   local dstdir
884 903
 
885 904
    name="`basename "${clone}" .git`"
886
-   dstname="${CLONES_FETCH_SUBDIR}/${name}"
905
+   dstdir="${CLONES_FETCH_SUBDIR}/${name}"
887 906
 
888
-   run_build_settings_script "${dstname}" "${name}" "did-update" "${dstname}" "${name}"
907
+   run_build_settings_script "${name}" "${dstdir}" "did-update" "${dstdir}" "${name}"
889 908
 }
890 909
 
891 910
 
... ...
@@ -329,6 +329,32 @@ remove_absolute_path_prefix_up_to()
329 329
 }
330 330
 
331 331
 
332
+escaped_spaces()
333
+{
334
+   echo "$1" | sed 's/ /\\ /g'
335
+}
336
+
337
+
338
+combined_escaped_search_path()
339
+{
340
+   for i in "$@"
341
+   do
342
+      if [ ! -z "$i" ]
343
+      then
344
+         i="`escaped_spaces "$i"`"
345
+         if [ -z "$path" ]
346
+         then
347
+            path="$i"
348
+         else
349
+            path="$path $i"
350
+         fi
351
+      fi
352
+   done
353
+
354
+   echo "${path}"
355
+}
356
+
357
+
332 358
 mkdir_if_missing()
333 359
 {
334 360
    if [ ! -d "${1}" ]
... ...
@@ -130,15 +130,15 @@ run_build_root_settings_script()
130 130
 # run in subshell
131 131
 run_fake_environment_script()
132 132
 {
133
-   local dstname
133
+   local srcdir
134 134
    local script
135 135
 
136
-   dstname="$1"
136
+   srcdir="$1"
137 137
    shift
138 138
    script="$1"
139 139
    shift
140 140
 
141
-   ( owd="`pwd -P`"; cd "${dstname}" ;
141
+   ( owd="`pwd -P`"; cd "${srcdir}" ;
142 142
    CLONES_SUBDIR="${owd}/${CLONES_SUBDIR}" \
143 143
    CLONESBUILD_SUBDIR="${owd}/${CLONESBUILD_SUBDIR}" \
144 144
    DEPENDENCY_SUBDIR="${owd}/${DEPENDENCY_SUBDIR}" \
... ...
@@ -151,45 +151,45 @@ run_repo_settings_script()
151 151
 {
152 152
    local name
153 153
    local scriptname
154
-   local dstname
154
+   local srcdir
155 155
 
156
-   dstname="$1"
157
-   shift
158 156
    name="$1"
159 157
    shift
158
+   srcdir="$1"
159
+   shift
160 160
    scriptname="$1"
161 161
    shift
162 162
 
163
-   exekutor [ -d "$dstname" ]      || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
164
-   [ ! -z "$name" ]       || internal_fail "name is empty"
165
-   [ ! -z "$scriptname" ] || internal_fail "scriptname is empty"
163
+   exekutor [ -d "$srcdir" ] || internal_fail "directory srcdir \"${srcdir}\" is wrong ($PWD)"
164
+   [ ! -z "$name" ]           || internal_fail "name is empty"
165
+   [ ! -z "$scriptname" ]     || internal_fail "scriptname is empty"
166 166
 
167 167
    local script
168 168
 
169 169
    script="`find_repo_setting_file "${name}" "bin/${scriptname}.sh"`"
170 170
    if [ ! -z "${script}" ]
171 171
    then
172
-      run_fake_environment_script "${dstname}" "${script}" "$@" || exit 1
172
+      run_fake_environment_script "${srcdir}" "${script}" "$@" || exit 1
173 173
    fi
174 174
 }
175 175
 
176 176
 
177 177
 run_build_settings_script()
178 178
 {
179
-   local dstname
179
+   local srcdir
180 180
    local name
181 181
    local scriptname
182 182
 
183
-   dstname="$1"
184
-   shift
185 183
    name="$1"
186 184
    shift
185
+   srcdir="$1"
186
+   shift
187 187
    scriptname="$1"
188 188
    shift
189 189
 
190
-   exekutor [ -d "$dstname" ]      || internal_fail "dstname \"${dstname}\" is wrong ($PWD)"
191
-   [ ! -z "$name" ]       || internal_fail "name is empty"
192
-   [ ! -z "$scriptname" ] || internal_fail "scriptname is empty"
190
+   exekutor [ -d "$srcdir" ]  || internal_fail "srcdir \"${srcdir}\" is wrong ($PWD)"
191
+   [ ! -z "$name" ]           || internal_fail "name is empty"
192
+   [ ! -z "$scriptname" ]     || internal_fail "scriptname is empty"
193 193
 
194 194
    local script
195 195