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.
This commit is contained in:
parent
01497f55e9
commit
3923a7d3f8
38 changed files with 1375 additions and 7 deletions
24
docs/cookbook/container/default.list.do
Normal file
24
docs/cookbook/container/default.list.do
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
d=$PWD
|
||||
redo-ifchange "$2.fs"
|
||||
|
||||
if [ -e "$2.diffbase" ]; then
|
||||
redo-ifchange "$2.diffbase"
|
||||
read diffbase <$2.diffbase
|
||||
diffbase=$diffbase.list
|
||||
redo-ifchange "$diffbase"
|
||||
else
|
||||
diffbase=/dev/null
|
||||
redo-ifcreate "$2.diffbase"
|
||||
fi
|
||||
|
||||
(
|
||||
cd "$2" &&
|
||||
find . -print | sort | "$d/try_fakeroot.sh" "$d/$2.fakeroot" "$d/fileids.py"
|
||||
) >$1.tmp
|
||||
|
||||
comm -1 -3 "$diffbase" "$1.tmp" >$3
|
||||
rm -f "$1.tmp"
|
||||
|
||||
# Sanity check
|
||||
nbytes=$(wc -c <"$3")
|
||||
test $nbytes -gt 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue