Bug 1204516 - Ignore missing directories when changing ownership of cache directories in build.sh. r=dustin
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 10 Feb 2016 15:09:22 +0900
changeset 284053 e39c9c48355d02dc5e25561477d7f97b6761a154
parent 284052 54f291017f6382a200f20cd7be9f3ef660df5e81
child 284054 02840dfc6310ad181aa7c3b49ef51c3dd1d71e95
push id17581
push usercbook@mozilla.com
push dateFri, 12 Feb 2016 14:21:29 +0000
treeherderfx-team@1b8a0036c771 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1204516
milestone47.0a1
Bug 1204516 - Ignore missing directories when changing ownership of cache directories in build.sh. r=dustin
testing/docker/desktop-build/bin/build.sh
--- a/testing/docker/desktop-build/bin/build.sh
+++ b/testing/docker/desktop-build/bin/build.sh
@@ -3,19 +3,21 @@
 set -x -e -v
 
 # TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
 # to a simple fail-if-root check
 if [ $(id -u) = 0 ]; then
     # each of the caches we have mounted are owned by root, so update that ownership
     # to 'worker'
     for cache in /home/worker/.tc-vcs /home/worker/workspace /home/worker/tooltool-cache; do
-        # -R probably isn't necessary forever, but it fixes some poisoned
-        # caches for now
-        chown -R worker:worker $cache
+        if [ -d $cache ]; then
+            # -R probably isn't necessary forever, but it fixes some poisoned
+            # caches for now
+            chown -R worker:worker $cache
+        fi
     done
 
     # ..then drop privileges by re-running this script
     exec su worker /home/worker/bin/build.sh
 fi
 
 ####
 # The default build works for any fx_desktop_build based mozharness job: