]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
osstest: remove the usage of for and IFS in the anoint loops wip.freebsd
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 26 Jul 2017 09:17:43 +0000 (10:17 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 26 Jul 2017 10:42:14 +0000 (11:42 +0100)
Instead use a pipe from the output of the command to a while read ...
loop.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Suggested-by: Ian Jackson <ian.jackson@eu.citrix.com>
---

cr-daily-branch

index 91f73ad8de6c77f8e40c991913e40c4eacf893d9..bbb1d765abaa8a62fa12a737f9e6fa477052422e 100755 (executable)
@@ -136,9 +136,8 @@ esac
 
 case "$branch" in
 freebsd-*)
-    IFS=$'\n'
-    for anointed in \
-        `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+    ./mg-anoint list-prepared "freebsd build $freebsd_branch *" | \
+    while read anointed; do
         # Check if the anointed version matches OLD_VERSION,
         # or else force a new flight, even if OLD_REVISION matches
         # NEW_REVISION.
@@ -150,7 +149,6 @@ freebsd-*)
             break
         fi
     done
-    unset IFS
     ;;
 esac
 
@@ -305,9 +303,8 @@ freebsd)
        ;;
 esac
 
-IFS=$'\n'
-for anointed in \
-    `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+./mg-anoint list-prepared "freebsd build $freebsd_branch *" | \
+while read anointed; do
     # Retrieve previous successful FreeBSD build for each arch.
     freebsd_arch=${anointed##* }
     freebsd_envvar="FREEBSD_${freebsd_arch^^}_BUILDJOB"
@@ -316,7 +313,6 @@ for anointed in \
         export ${freebsd_envvar}=${flight_job/ /.}
     fi
 done
-unset IFS
 
 if [ "x$OLD_REVISION" = xdetermine-late ]; then
        OLD_REVISION="`\
@@ -525,9 +521,8 @@ case "$branch" in
 freebsd-*)
     if grep '^tolerable$' $mrof >/dev/null 2>&1 && $OSSTEST_ANOINT &&
        [ "x$OSSTEST_BLESSING" == "xreal" ]; then
-        IFS=$'\n'
-        for anointed in `./mg-anoint list-prepared \
-                                     "freebsd build $freebsd_branch *"`; do
+        ./mg-anoint list-prepared "freebsd build $freebsd_branch *" | \
+        while read anointed; do
             # Update anointed versions
             # NB: failure to update an anointed build for a specific arch
             # should not be fatal, and it's not an issue if one of the
@@ -538,7 +533,6 @@ freebsd-*)
                 echo "Anointed artifacts from build-$freebsd_arch-freebsd"
             fi
         done
-        unset IFS
     fi
     ;;
 esac