mirror of
https://github.com/minio/minio.git
synced 2024-12-28 08:05:55 -05:00
eb7c690ea9
This PR allows 'minio update' to not only shows update banner but also allows for in-place upgrades. Updates are done safely by validating the downloaded sha256 of the binary. Fixes #4781
25 lines
761 B
Go
25 lines
761 B
Go
// Package binarydist implements binary diff and patch as described on
|
|
// http://www.daemonology.net/bsdiff/. It reads and writes files
|
|
// compatible with the tools there.
|
|
package binarydist
|
|
|
|
var magic = [8]byte{'B', 'S', 'D', 'I', 'F', 'F', '4', '0'}
|
|
|
|
// File format:
|
|
// 0 8 "BSDIFF40"
|
|
// 8 8 X
|
|
// 16 8 Y
|
|
// 24 8 sizeof(newfile)
|
|
// 32 X bzip2(control block)
|
|
// 32+X Y bzip2(diff block)
|
|
// 32+X+Y ??? bzip2(extra block)
|
|
// with control block a set of triples (x,y,z) meaning "add x bytes
|
|
// from oldfile to x bytes from the diff block; copy y bytes from the
|
|
// extra block; seek forwards in oldfile by z bytes".
|
|
type header struct {
|
|
Magic [8]byte
|
|
CtrlLen int64
|
|
DiffLen int64
|
|
NewSize int64
|
|
}
|