Find correct upgrade asset for arm (fixes #232)

This commit is contained in:
Jakob Borg 2014-05-20 00:06:16 +02:00
parent e359b146aa
commit a8c510cc72
2 changed files with 9 additions and 1 deletions

View File

@ -134,15 +134,20 @@ case "$1" in
export GOOS=linux export GOOS=linux
export GOARCH=arm export GOARCH=arm
origldflags="$ldflags"
export GOARM=7 export GOARM=7
ldflags="$origldflags -X main.GoArchExtra v7"
build build
tarDist "syncthing-linux-armv7-$version" tarDist "syncthing-linux-armv7-$version"
export GOARM=6 export GOARM=6
ldflags="$origldflags -X main.GoArchExtra v6"
build build
tarDist "syncthing-linux-armv6-$version" tarDist "syncthing-linux-armv6-$version"
export GOARM=5 export GOARM=5
ldflags="$origldflags -X main.GoArchExtra v5"
build build
tarDist "syncthing-linux-armv5-$version" tarDist "syncthing-linux-armv5-$version"

View File

@ -30,6 +30,8 @@ type githubAsset struct {
Name string `json:"name"` Name string `json:"name"`
} }
var GoArchExtra string // "", "v5", "v6", "v7"
func upgrade() error { func upgrade() error {
path, err := osext.Executable() path, err := osext.Executable()
if err != nil { if err != nil {
@ -60,7 +62,7 @@ func upgrade() error {
return nil return nil
} }
expectedRelease := fmt.Sprintf("syncthing-%s-%s-%s.", runtime.GOOS, runtime.GOARCH, rel.Tag) expectedRelease := fmt.Sprintf("syncthing-%s-%s%s-%s.", runtime.GOOS, runtime.GOARCH, GoArchExtra, rel.Tag)
for _, asset := range rel.Assets { for _, asset := range rel.Assets {
if strings.HasPrefix(asset.Name, expectedRelease) { if strings.HasPrefix(asset.Name, expectedRelease) {
if strings.HasSuffix(asset.Name, ".tar.gz") { if strings.HasSuffix(asset.Name, ".tar.gz") {
@ -88,6 +90,7 @@ func upgrade() error {
} }
} }
l.Warnf("Found no asset for %q", expectedRelease)
return nil return nil
} }