Skip to contentSkip to conversation

standalone: Handle multiple configuration files.

PATCH In review Ian Campbell 2 participants 2 messages Nov 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 standalone: Handle multiple configuration files.

OSSTEST_CONFIG can actually be a colon separate list of files, so take this into account when sanity checking it.

---
 standalone | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
standalone +11 -2
index c1139f8..caf3fd5 100755
@@ -112,10 +112,19 @@ if [ ! -f standalone.db ] ; then
     exit 1
 fi
 
-if [ -z "$config" -o ! -r "$config" ] ; then
-    echo "Cannot read config." >&2
+if [ -z "$config" ] ; then
+    echo "No config specified." >&2
     exit 1
 fi
+IFS_saved=$IFS
+IFS=:
+for c in $config ; do
+    if [ -z "$c" -o ! -r "$c" ] ; then
+        echo "Cannot read config $c." >&2
+        exit 1
+    fi
+done
+IFS=$IFS_saved
 
 need_flight() {
     if [ -z "$flight" ] ; then
Signature · 1 line
2.1.1
Acked-by on v1 1/1
#1 lore raw

Ian Campbell writes ("[PATCH OSSTEST] standalone: Handle multiple configuration files."):

Quoted 2 lines

OSSTEST_CONFIG can actually be a colon separate list of files, so take this into account when sanity checking it.