apenwarr-redo/docs/cookbook/container/try_fakeroot.sh
Avery Pennarun 3923a7d3f8 cookbook/container: example of building+running docker containers.
This got... long... and complicated.  But I think it's a really good
demonstration of getting redo to do complicated things elegantly.  At
least, I hope it is.
2019-01-08 01:42:33 -05:00

13 lines
243 B
Bash
Executable file

#!/bin/sh
frfile=$1
shift
broken=
fakeroot true 2>/dev/null || broken=1
if [ -z "$broken" ] && [ -e "$frfile" ]; then
redo-ifchange "$frfile"
exec fakeroot -i "$frfile" "$@"
elif [ -z "$broken" ]; then
exec fakeroot "$@"
else
exec "$@"
fi