Browse code

fix more regressions

Nat! authored on 24-09-2016 21:47:00
Showing 2 changed files
... ...
@@ -756,7 +756,7 @@ clone_repository()
756 756
    dstdir="${CLONESFETCH_SUBDIR}/${name}"
757 757
 
758 758
    doit=1
759
-   if [ "${DO_CHECK_USR_LOCAL_INCLUDE}" = "YES" ]
759
+   if [ "${CHECK_USR_LOCAL_INCLUDE}" = "YES" ]
760 760
    then
761 761
       has_usr_local_include "${name}"
762 762
       doit=$?
... ...
@@ -1057,16 +1057,17 @@ update_repositories()
1057 1057
       return
1058 1058
    fi
1059 1059
 
1060
+   # __parse_expanded_clone
1061
+   local name
1062
+   local url
1060 1063
    local branch
1064
+   local scm
1065
+   local tag
1066
+
1061 1067
    local dstdir
1062 1068
    local match
1063
-   local name
1064
-   local rval
1065
-   local scm
1066 1069
    local stop
1067
-   local tag
1068 1070
    local updated
1069
-   local url
1070 1071
 
1071 1072
    updated=""
1072 1073
 
... ...
@@ -1091,34 +1092,35 @@ update_repositories()
1091 1092
             # avoid superflous updates
1092 1093
             match="`echo "${updated}" | grep -x "${clone}"`"
1093 1094
 
1094
-            if [ "${match}" != "${clone}" ]
1095
+            if [ "${match}" = "${clone}" ]
1095 1096
             then
1096
-               updated="${updated}
1097
-${clone}"
1098
-
1099
-               __parse_expanded_clone "${clone}"
1100
-
1101
-               dstdir="${CLONESFETCH_SUBDIR}/${name}"
1097
+               continue
1098
+            fi
1102 1099
 
1103
-               create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1100
+            updated="${updated}
1101
+${clone}"
1102
+            __parse_expanded_clone "${clone}"
1104 1103
 
1105
-                  if [ -e "${dstdir}" ]
1106
-                  then
1107
-                     update_repository "${name}" "${url}" "${branch}"
1108
-                     rval=$?
1109
-                  else
1110
-                     scm="`scm_from_clone "${clone}"`"
1111
-                     clone_repository "${name}" "${url}" "${branch}" "${scm}"
1112
-                     rval=1
1113
-                  fi
1104
+            dstdir="${CLONESFETCH_SUBDIR}/${name}"
1114 1105
 
1115
-               remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1106
+            create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1116 1107
 
1117
-               if [ $rval -eq 1 ]
1108
+               if [ -e "${dstdir}" ]
1118 1109
                then
1119
-                  stop=0
1120
-                  break
1110
+                  update_repository "${name}" "${url}" "${branch}"
1111
+                  rval=$?
1112
+               else
1113
+                  scm="`scm_from_clone "${clone}"`"
1114
+                  clone_repository "${name}" "${url}" "${branch}" "${scm}"
1115
+                  rval=1
1121 1116
                fi
1117
+
1118
+            remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1119
+
1120
+            if [ $rval -eq 1 ]
1121
+            then
1122
+               stop=0
1123
+               break
1122 1124
             fi
1123 1125
          done
1124 1126
       fi
... ...
@@ -1303,20 +1305,26 @@ update_embedded_repositories()
1303 1305
    local clones
1304 1306
    local clone
1305 1307
    local old
1308
+
1309
+   # __parse_embedded_clone
1306 1310
    local name
1307 1311
    local url
1308 1312
    local branch
1309 1313
    local scm
1314
+   local tag
1315
+   local subdir
1310 1316
 
1311
-   MULLE_BOOTSTRAP_SETTINGS_NO_AUTO="YES"
1317
+   local dstdir
1312 1318
 
1313
-   old="${IFS:-" "}"
1319
+   MULLE_BOOTSTRAP_SETTINGS_NO_AUTO="YES"
1314 1320
 
1321
+   set -x
1315 1322
    clones="`read_fetch_setting "embedded_repositories"`"
1316 1323
    clones="`echo "${clones}" | sed '1!G;h;$!d'`"  # reverse lines
1317 1324
 
1318
-   if [ "${clones}" != "" ]
1325
+   if [ ! -z "${clones}" ]
1319 1326
    then
1327
+      old="${IFS:-" "}"
1320 1328
       IFS="
1321 1329
 "
1322 1330
       for clone in ${clones}
... ...
@@ -1325,36 +1333,24 @@ update_embedded_repositories()
1325 1333
 
1326 1334
          __parse_embedded_clone "${clone}"
1327 1335
 
1328
-         local doit
1336
+         dstdir="${dstprefix}${subdir}"
1337
+         log_fetch_action "${url}" "${dstdir}"
1329 1338
 
1330
-         doit=1
1331
-         if [ "${DO_CHECK_USR_LOCAL_INCLUDE}" = "YES" ]
1332
-         then
1333
-            has_usr_local_include "${name}"
1334
-            doit=$?
1335
-         fi
1339
+         create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1336 1340
 
1337
-         if [ $doit -ne 0 ]
1341
+         if [ -e "${dstdir}" ]
1338 1342
          then
1339
-            log_fetch_action "${url}" "${dstdir}"
1340
-
1341
-            create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1342
-
1343
-            if [ -e "${dstdir}" ]
1344
-            then
1345
-               update "${name}" "${url}" "${dstdir}" "${branch}" "${tag}"
1346
-            else
1347
-               clone_embedded_repository "${dstprefix}" "${clone}"
1348
-            fi
1349
-
1350
-            remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1343
+            update "${name}" "${url}" "${dstdir}" "${branch}" "${tag}"
1351 1344
          else
1352
-            log_info "${C_MAGENTA}${C_BOLD}${name}${C_INFO} is a system library, so not updating"
1345
+            clone_embedded_repository "${dstprefix}" "${clone}"
1353 1346
          fi
1347
+
1348
+         remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1354 1349
       done
1350
+
1351
+      IFS="${old}"
1355 1352
    fi
1356 1353
 
1357
-   IFS="${old}"
1358 1354
    MULLE_BOOTSTRAP_SETTINGS_NO_AUTO=
1359 1355
 }
1360 1356
 
... ...
@@ -1433,7 +1429,7 @@ _common_main()
1433 1429
    # should we check for '/usr/local/include/<name>' and don't fetch if
1434 1430
    # present (somewhat dangerous, because we do not check versions)
1435 1431
    #
1436
-   DO_CHECK_USR_LOCAL_INCLUDE="`read_config_setting "check_usr_local_include" "NO"`"
1432
+   CHECK_USR_LOCAL_INCLUDE="`read_config_setting "check_usr_local_include" "NO"`"
1437 1433
 
1438 1434
    if [ "${COMMAND}" = "fetch" ]
1439 1435
    then
... ...
@@ -373,12 +373,8 @@ bury_embedded_zombies()
373 373
       do
374 374
          if [ -f "${i}" ]
375 375
          then
376
-            log_info "CLONESFETCH_SUBDIR=${CLONESFETCH_SUBDIR}"
377
-            log_info "pwd=${PWD}"
378
-            log_info "i=${i}"
379 376
             dstdir="`embedded_repository_subdir_from_file "${i}" "${CLONESFETCH_SUBDIR}/.embedded"`"
380 377
             dstdir="${dstprefix}${dstdir}"
381
-            log_info "dstdir=${dstdir}"
382 378
 
383 379
             if [ -d "${dstdir}" -o -L "${dstdir}" ]
384 380
             then
... ...
@@ -649,19 +645,19 @@ refresh_main()
649 645
    then
650 646
       if [ "${DONT_RECURSE}" = "" ]
651 647
       then
652
-         log_verbose "Refreshing repository settings"
648
+         log_fluff "Refreshing repository settings"
653 649
          refresh_repositories_settings
654 650
       fi
655 651
 
656
-      log_verbose "Detect zombie repositories"
652
+      log_fluff "Detect zombie repositories"
657 653
       refresh_repositories
658 654
 
659
-      log_verbose "Detect embedded zombie repositories"
655
+      log_fluff "Detect embedded zombie repositories"
660 656
       refresh_embedded_repositories
661 657
 
662 658
       if [ "${DONT_RECURSE}" = "" ]
663 659
       then
664
-         log_verbose "Detect deeply embedded zombie repositories"
660
+         log_fluff "Detect deeply embedded zombie repositories"
665 661
          refresh_deeply_embedded_repositories
666 662
       fi
667 663
    fi