Basically all configuration is done directly inside source code. You
have to recompile it every time configuration changes. Is it a problem?
I doubt, because Go is very fast. But it produces huge statically linked
-executables, you say! Use @command{bsdiff}/@command{bspatch}!
+executables, you say! Use either @command{bsdiff}/@command{bspatch} or
+@command{zstd --patch-from}!
It is created exclusively to drive my own websites, but if you are
interested, then @code{git clone git://git.stargrave.org/godlighty.git} it.
mv $w updates/$w.old
exit
}
-bsdiff updates/$w.old $w updates/$w.bsdiff
+zstd -19 --patch-from updates/$w.old -o updates/$w.patch.zst $w
mv updates/$w.old updates/$w.older
mv $w updates/$w.old
-cat > updates/$w-update.sh <<EOF
+cat >updates/$w-update.sh <<EOF
#!/bin/sh -ex
w=\$1
[ -n "\$w" ]
-their_hash=\`sha512 < \$w\`
-our_hash=`sha512 < updates/$w.older`
+their_hash=\`sha512 <\$w\`
+our_hash=`sha512 <updates/$w.older`
[ "\$their_hash" = "\$our_hash" ]
-b64decode -o \$w.bsdiff < \$0
-bspatch \$w \$w.new \$w.bsdiff
-their_hash=\`sha512 < \$w.new\`
-our_hash=`sha512 < updates/$w.old`
+b64decode -o \$w.patch.zst <\$0
+zstd -d -D \$w -o \$w.new \$w.patch.zst
+their_hash=\`sha512 <\$w.new\`
+our_hash=`sha512 <updates/$w.old`
[ "\$their_hash" = "\$our_hash" ]
chown \`stat -f %u:%g \$w\` \$w.new
chmod \`stat -f %Mp%Lp \$w\` \$w.new
-rm \$w.bsdiff
+rm \$w.patch.zst
mv -f \$w.new \$w
exit
EOF
-b64encode updates/$w.bsdiff < updates/$w.bsdiff >> updates/$w-update.sh
+b64encode updates/$w.patch.zst <updates/$w.patch.zst >>updates/$w-update.sh
chmod +x updates/$w-update.sh