Parcourir la source

Respect old SATURNIN_CONF_PATH when creating new one

This allows prepending config locations to Saturnin.  This should be
normally used only in cases of staged installattions, such as in sanity
tests.
Alois Mahdal il y a 8 ans
Parent
révision
a35ab6f1df
1 fichiers modifiés avec 12 ajouts et 6 suppressions
  1. 12
    6
      src/saturnin.sh.skel

+ 12
- 6
src/saturnin.sh.skel Voir le fichier

408
 
408
 
409
 saturnin__conf_mkpath() {
409
 saturnin__conf_mkpath() {
410
     #
410
     #
411
-    # Assemble SATURNIN_CONF_PATH from locations $@
411
+    # Print new $SATURNIN_CONF_PATH by appending locations $@
412
     #
412
     #
413
-    # For each location, print colon-delimited list of directories.  If
414
-    # location ends with "/ini.d", list of subfolders, sorted by C locale is
415
-    # printed--this allows for modular configuration.  Otherwise the
416
-    # location is printed.  Non-existent or non-directory locations are
417
-    # silently ignored.
413
+    # Usage:
414
+    #
415
+    #     saturnin__conf_mkpath DIR [DIR..]
416
+    #
417
+    # First repeat elements of $SATURNIN_CONF_PATH unless it's empty.
418
+    # Then go through each DIR and print it, unless it ends with "/ini.d",
419
+    # in which case list its subdirectories, sorted by C locale (this allows
420
+    # for modular configuration).
421
+    #
422
+    # Non-existent or non-directory items are silently ignored.
418
     #
423
     #
419
     local location      # one location argument
424
     local location      # one location argument
420
     local path          # one path listed
425
     local path          # one path listed
426
+    test -n "$SATURNIN_CONF_PATH" && echo -n "$SATURNIN_CONF_PATH:"
421
     for location in "$@";
427
     for location in "$@";
422
     do
428
     do
423
         test -d "$location" || continue
429
         test -d "$location" || continue