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 320378 e39c9c48355d02dc5e25561477d7f97b6761a154
parent 320377 54f291017f6382a200f20cd7be9f3ef660df5e81
child 320379 02840dfc6310ad181aa7c3b49ef51c3dd1d71e95
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1204516
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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: