diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 607d0e8..954f483 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -10,10 +10,6 @@ "Comment": "null-13", "Rev": "5d3ddcf53a508cc2f7404eaebf546ef2cb5cdb6e" }, - { - "ImportPath": "github.com/inconshreveable/go-update", - "Rev": "3f0466666779bd2143f368a207b0641f0ed536e8" - }, { "ImportPath": "github.com/kr/binarydist", "Rev": "9955b0ab8708602d411341e55fffd7e0700f86bd" diff --git a/selfupdate/selfupdate.go b/selfupdate/selfupdate.go index f4ca576..f6e4dde 100644 --- a/selfupdate/selfupdate.go +++ b/selfupdate/selfupdate.go @@ -29,6 +29,7 @@ const ( const devValidTime = 7 * 24 * time.Hour var ErrHashMismatch = errors.New("new file hash mismatch after patch") +var up = update.New() // Update protocol. // @@ -76,7 +77,7 @@ func (u *Updater) getExecRelativeDir(dir string) string { func (u *Updater) BackgroundRun() { os.MkdirAll(u.getExecRelativeDir(u.Dir), 0777) if u.wantUpdate() { - if err := update.SanityCheck(); err != nil { + if err := up.CanUpdate(); err != nil { // fail return } @@ -141,7 +142,7 @@ func (u *Updater) update() error { // it can't be renamed if a handle to the file is still open old.Close() - err, errRecover := update.FromStream(bytes.NewBuffer(bin)) + err, errRecover := up.FromStream(bytes.NewBuffer(bin)) if errRecover != nil { return fmt.Errorf("update and recovery errors: %q %q", err, errRecover) }