diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-03 18:04:08 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-03 20:24:29 +0200 |
commit | 23a7f3baa33265519840609dc54e950615ec39b1 (patch) | |
tree | ff2737f76b63a2acf5f8a9fffd5c15e3eb4c46c8 /tools/updater/manifest.go | |
parent | WebProfile refactoring (diff) | |
download | smolbote-23a7f3baa33265519840609dc54e950615ec39b1.tar.xz |
Merge some QoL improvements from staging branch
- Build executable in top-level buildroot
- Use meson sourceset
- Pull in poi-crash and poi-update from staging
- Remove extraneous scripts in tools/
- Pull in configure scripts in scripts/
Diffstat (limited to 'tools/updater/manifest.go')
-rw-r--r-- | tools/updater/manifest.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tools/updater/manifest.go b/tools/updater/manifest.go deleted file mode 100644 index 0d8bfae..0000000 --- a/tools/updater/manifest.go +++ /dev/null @@ -1,41 +0,0 @@ -package main - -import ( - "crypto/sha512" - "fmt" - "io" - "os" -) - -func checkFile(filepath string, checksum string) (bool, error) { - if _, err := os.Stat(filepath); os.IsNotExist(err) { - return false, nil - } - - // file exists, check checksum - lsum, err := hash(filepath) - if err != nil { - return false, err - } - - if checksum != fmt.Sprintf("%x", lsum) { - return false, nil - } - - return true, nil -} - -func hash(filepath string) ([]byte, error) { - file, err := os.Open(filepath) - if err != nil { - return nil, err - } - defer file.Close() - - hasher := sha512.New() - if _, err := io.Copy(hasher, file); err != nil { - return nil, err - } - - return hasher.Sum(nil), nil -} |