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.
9 lines
184 B
Text
9 lines
184 B
Text
redo-ifchange "$2.fs" rdinit
|
|
d=$PWD
|
|
fs=$2
|
|
(
|
|
(cd "$fs" && find . -print0 |
|
|
"$d/try_fakeroot.sh" "$d/$2.fakeroot" \
|
|
cpio -Hnewc -0 -o)
|
|
printf 'rdinit\0' | cpio -Hnewc -0 -o
|
|
) >$3
|