On Sat, Sep 23, 2017 at 10:12:32AM BST, Ted Unangst wrote:
> Raf Czlonka wrote:
> > This is unrelated to your diff but what I do instead is to check
> > the BUILDINFO file - it's tiny and all the information you need,
> > is already there.
>
> While we're on the subject, I'll point out that sometimes only the base sets
> change, but not the x sets. If you download SHA256 you can download only files
> that differ. (This also may work better if you switch mirrors or the
> timestamps drift for other reasons.) It's just a few lines of shell, though I
> don't have them handy atm.
>
> (And for bonus points, you can use SHA256.sig and verify it's correct, then
> verify that BUILDINFO hasn't been tampered with, etc...)
>
> ftp/http should still do the right thing, of course.
Hi Ted et al.
I've mentioned BUILDINFO only as an example of the smallest file
to download which, at the same time contains very useful information.
This is what I use:
BSD="bsd.rd bsd"
test "$(sysctl -n hw.ncpu)" -ge "2" && BSD="$BSD bsd.mp"
ftp -o BUILDINFO.new -V ${SNAP_PATH}/BUILDINFO > /dev/null 2>&1 &&
cmp -s BUILDINFO.new BUILDINFO || mv BUILDINFO.new BUILDINFO &&
ftp -V ${SNAP_PATH}/SHA256.sig > /dev/null 2>&1 &&
for i in INSTALL.${arch} $BSD $SETS BUILDINFO
do
signify -q -C -p $KEY -x SHA256.sig $i > /dev/null 2>&1 ||
ftp -V ${SNAP_PATH}/${i} > /dev/null 2>&1
done
I don't think $KEY, $SNAP_PATH and $SETS require any explanation.
Regards,
Raf