Browse code

make .auto creation somwhat safer (paranoia). Explain inherit copying more

Nat! authored on 04/01/2016 01:05:37
Showing 1 changed files
... ...
@@ -382,26 +382,29 @@ bootstrap_auto_update()
382 382
 
383 383
    #
384 384
    # prepare auto folder if it doesn't exist yet
385
-   # means copy our own files to .auto first
385
+   # means copy our own files to .auto first,
386 386
    #
387 387
    if [ ! -d "${BOOTSTRAP_SUBDIR}.auto" ]
388 388
    then
389 389
       log_info "Found a .bootstrap folder for \"${name}\" will set up ${BOOTSTRAP_SUBDIR}.auto"
390 390
 
391
-      mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto/settings"
391
+      mkdir_if_missing "${BOOTSTRAP_SUBDIR}.tmp/settings"
392 392
       for i in $INHERIT_SETTINGS
393 393
       do
394 394
          if [ -f "${BOOTSTRAP_SUBDIR}.local/${i}" ]
395 395
          then
396
-            exekutor cp "${BOOTSTRAP_SUBDIR}.local/${i}" "${BOOTSTRAP_SUBDIR}.auto/${i}" || exit 1
396
+            exekutor cp "${BOOTSTRAP_SUBDIR}.local/${i}" "${BOOTSTRAP_SUBDIR}.tmp/${i}" || exit 1
397 397
          else
398 398
             if [ -f "${BOOTSTRAP_SUBDIR}/${i}" ]
399 399
             then
400
-               exekutor cp "${BOOTSTRAP_SUBDIR}/${i}" "${BOOTSTRAP_SUBDIR}.auto/${i}" || exit 1
400
+               exekutor cp "${BOOTSTRAP_SUBDIR}/${i}" "${BOOTSTRAP_SUBDIR}.tmp/${i}" || exit 1
401 401
             fi
402 402
          fi
403 403
       done
404 404
 
405
+      # now move it
406
+      exekutor mv "${BOOTSTRAP_SUBDIR}.tmp" "${BOOTSTRAP_SUBDIR}.auto" || exit 1
407
+
405 408
       # leave .scm files behind
406 409
    fi
407 410
 
... ...
@@ -434,6 +437,8 @@ bootstrap_auto_update()
434 434
          else
435 435
             exekutor cp "${srcfile}" "${dstfile}" || exit 1
436 436
          fi
437
+      else
438
+         log_fluff "Don't inherit \"`basename -- ${i}`\" as it's not specified"
437 439
       fi
438 440
    done
439 441
 
... ...
@@ -1153,7 +1158,6 @@ main()
1153 1153
          log_warning "Folder \"${BOOTSTRAP_SUBDIR}.auto\" already exists!"
1154 1154
       fi
1155 1155
 
1156
-
1157 1156
       clone_repositories
1158 1157
 
1159 1158
       install_embedded_repositories