8 [ -s updates/$w.old ] || {
13 bsdiff updates/$w.old $w updates/$w.bsdiff
14 mv updates/$w.old updates/$w.older
16 cat > updates/$w-update.sh <<EOF
20 their_hash=\`sha512 < \$w\`
21 our_hash=`sha512 < updates/$w.older`
22 [ "\$their_hash" = "\$our_hash" ]
23 b64decode -o \$w.bsdiff < \$0
24 bspatch \$w \$w.new \$w.bsdiff
25 their_hash=\`sha512 < \$w.new\`
26 our_hash=`sha512 < updates/$w.old`
27 [ "\$their_hash" = "\$our_hash" ]
28 chown \`stat -f %u:%g \$w\` \$w.new
29 chmod \`stat -f %Mp%Lp \$w\` \$w.new
34 b64encode updates/$w.bsdiff < updates/$w.bsdiff >> updates/$w-update.sh
35 chmod +x updates/$w-update.sh