ref: af46e1737f7939365e09124cd15ec07550e5df13
dir: /sys/src/cmd/pkg/create/
#!/bin/rc -e
i=`{basename $1}
d=$1
echo Creating $i
C=`{pwd}
@{
rfork en
mkdir -p /tmp/$i/files/sys/src/cmd/$i
dircp $d /tmp/$i/files/sys/src/cmd/$i
cd $d
mk
divergefs -p /tmp/$i /
mk install clean
unmount /
}
cd /tmp/$i/files
rm -r env
tar cv * | bzip2 -9 > $C/$i.tbz
cd /tmp
rm -r $i
echo Created $C/$i.tbz