apenwarr-redo/t/205-readonly/all.do
Avery Pennarun 3dbdfbc06f Better handling if parent closes REDO_CHEATFDS or MAKEFLAGS fds.
Silently recover if REDO_CHEATFDS file descriptors are closed, because
they aren't completely essential and MAKEFLAGS-related warnings already
get printed if all file descriptors have been closed.

If MAKEFLAGS --jobserver-auth flags are closed, improve the error
message so that a) it's a normal error instead of an exception and b)
we link to documentation about why it happens.  Also write some more
detailed documentation about what's going on here.
2019-01-18 00:11:48 +00:00

25 lines
660 B
Text

[ -e rodir ] && chmod u+w rodir
[ -e rodir/rwdir ] && chmod u+w rodir/rwdir
rm -rf rodir
mkdir rodir rodir/rwdir
cd rodir
cat >default.ro1.do <<-EOF
chmod u+w "\$(dirname "\$1")"
echo 'redir' >\$3
EOF
cat >default.ro2.do <<-EOF
chmod u+w "\$(dirname "\$1")"
echo 'stdout'
EOF
# Check that:
# - redo works when the .do file is in a read-only directory.
# - redo works when the target is in a read-only directory that becomes
# writable only *after* launching the .do script. (For example, the .do
# might mount a new read-write filesystem in an otherwise read-only
# tree.)
chmod a-w . rwdir
redo rwdir/a.ro1
chmod a-w . rwdir
redo rwdir/a.ro2