Commit bef1a643 authored by David Symonds's avatar David Symonds

If Make.deps is not writable (e.g. in Perforce client and not opened for...

If Make.deps is not writable (e.g. in Perforce client and not opened for editing), bail out immediately.

R=rsc,r
APPROVED=r
DELTA=7  (5 added, 1 deleted, 1 changed)
OCL=29319
CL=29319
parent 798b19bf
......@@ -5,7 +5,7 @@
# After editing the DIRS= list or adding imports to any Go files
# in any of those directories, run:
#
# p4 edit Make.deps; ./deps.bash
# ./deps.bash
#
# to rebuild the dependency information in Make.deps.
......
......@@ -6,6 +6,11 @@
OUT="Make.deps"
TMP="Make.deps.tmp"
if [ -f $OUT ] && ! [ -w $OUT ]; then
echo "$0: $OUT is read-only; aborting." 1>&2
exit 1
fi
# Get list of directories from Makefile
dirs=$(sed '1,/^DIRS=/d; /^$/,$d; s/\\//g' Makefile)
dirpat=$(echo $dirs | sed 's/ /|/g; s/.*/^(&)$/')
......@@ -28,5 +33,4 @@ for dir in $dirs; do (
echo $dir.install: $deps
) done > $TMP
p4 open $OUT
mv $TMP $OUT
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment