Add windowskext integration, update related packages
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/google/renameio"
|
||||
@@ -70,9 +71,11 @@ func fetchFile(realFilepath, updateFilepath string, tries int) error {
|
||||
return fmt.Errorf("updates: failed to finalize file %s: %s", realFilepath, err)
|
||||
}
|
||||
// set permissions
|
||||
err = os.Chmod(realFilepath, 0644)
|
||||
if err != nil {
|
||||
log.Warningf("updates: failed to set permissions on downloaded file %s: %s", realFilepath, err)
|
||||
if runtime.GOOS != "windows" {
|
||||
err = os.Chmod(realFilepath, 0644)
|
||||
if err != nil {
|
||||
log.Warningf("updates: failed to set permissions on downloaded file %s: %s", realFilepath, err)
|
||||
}
|
||||
}
|
||||
|
||||
log.Infof("updates: fetched %s (stored to %s)", downloadURL, realFilepath)
|
||||
|
||||
@@ -56,7 +56,7 @@ func loadOrFetchFile(identifier string) (*File, error) {
|
||||
}
|
||||
|
||||
// build final filepath
|
||||
realFilePath := filepath.Join(updateStoragePath, versionedFilePath)
|
||||
realFilePath := filepath.Join(updateStoragePath, filepath.FromSlash(versionedFilePath))
|
||||
if _, err := os.Stat(realFilePath); err == nil {
|
||||
// file exists
|
||||
updateUsedStatus(identifier, version)
|
||||
|
||||
@@ -92,6 +92,7 @@ func ScanForLatest(baseDir string, hardFail bool) (latest map[string]string, las
|
||||
storedVersion, ok := latest[identifierPath]
|
||||
if ok {
|
||||
// FIXME: this will fail on multi-digit version segments!
|
||||
// FIXME: use https://github.com/hashicorp/go-version
|
||||
if version > storedVersion {
|
||||
latest[identifierPath] = version
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user