mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
Fix build on Solaris
This commit is contained in:
parent
991dc32a0b
commit
e212b64823
@ -9,8 +9,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"bitbucket.org/kardianos/osext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Release struct {
|
type Release struct {
|
||||||
@ -40,12 +38,7 @@ func init() {
|
|||||||
func UpgradeTo(rel Release, archExtra string) error {
|
func UpgradeTo(rel Release, archExtra string) error {
|
||||||
select {
|
select {
|
||||||
case <-upgradeUnlocked:
|
case <-upgradeUnlocked:
|
||||||
path, err := osext.Executable()
|
err := upgradeTo(rel, archExtra)
|
||||||
if err != nil {
|
|
||||||
upgradeUnlocked <- true
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = upgradeTo(path, rel, archExtra)
|
|
||||||
// If we've failed to upgrade, unlock so that another attempt could be made
|
// If we've failed to upgrade, unlock so that another attempt could be made
|
||||||
if err != nil {
|
if err != nil {
|
||||||
upgradeUnlocked <- true
|
upgradeUnlocked <- true
|
||||||
|
@ -19,10 +19,16 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"bitbucket.org/kardianos/osext"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Upgrade to the given release, saving the previous binary with a ".old" extension.
|
// Upgrade to the given release, saving the previous binary with a ".old" extension.
|
||||||
func upgradeTo(path string, rel Release, archExtra string) error {
|
func upgradeTo(rel Release, archExtra string) error {
|
||||||
|
path, err := osext.Executable()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
osName := runtime.GOOS
|
osName := runtime.GOOS
|
||||||
if osName == "darwin" {
|
if osName == "darwin" {
|
||||||
// We call the darwin release bundles macosx because that makes more
|
// We call the darwin release bundles macosx because that makes more
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
package upgrade
|
package upgrade
|
||||||
|
|
||||||
func upgradeTo(path string, rel Release, extra string) error {
|
func upgradeTo(rel Release, extra string) error {
|
||||||
return ErrUpgradeUnsupported
|
return ErrUpgradeUnsupported
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +19,16 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"bitbucket.org/kardianos/osext"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Upgrade to the given release, saving the previous binary with a ".old" extension.
|
// Upgrade to the given release, saving the previous binary with a ".old" extension.
|
||||||
func upgradeTo(path string, rel Release, archExtra string) error {
|
func upgradeTo(rel Release, archExtra string) error {
|
||||||
|
path, err := osext.Executable()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
expectedRelease := fmt.Sprintf("syncthing-%s-%s%s-%s.", runtime.GOOS, runtime.GOARCH, archExtra, rel.Tag)
|
expectedRelease := fmt.Sprintf("syncthing-%s-%s%s-%s.", runtime.GOOS, runtime.GOARCH, archExtra, rel.Tag)
|
||||||
if debug {
|
if debug {
|
||||||
l.Debugf("expected release asset %q", expectedRelease)
|
l.Debugf("expected release asset %q", expectedRelease)
|
||||||
|
Loading…
Reference in New Issue
Block a user