From a8c510cc722e77b6b74601178d1c3c6cf85068eb Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 20 May 2014 00:06:16 +0200 Subject: [PATCH] Find correct upgrade asset for arm (fixes #232) --- build.sh | 5 +++++ cmd/syncthing/upgrade_unix.go | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 4c3d06154..437cd9705 100755 --- a/build.sh +++ b/build.sh @@ -134,15 +134,20 @@ case "$1" in export GOOS=linux export GOARCH=arm + origldflags="$ldflags" + export GOARM=7 + ldflags="$origldflags -X main.GoArchExtra v7" build tarDist "syncthing-linux-armv7-$version" export GOARM=6 + ldflags="$origldflags -X main.GoArchExtra v6" build tarDist "syncthing-linux-armv6-$version" export GOARM=5 + ldflags="$origldflags -X main.GoArchExtra v5" build tarDist "syncthing-linux-armv5-$version" diff --git a/cmd/syncthing/upgrade_unix.go b/cmd/syncthing/upgrade_unix.go index 05f05fe24..226334b69 100644 --- a/cmd/syncthing/upgrade_unix.go +++ b/cmd/syncthing/upgrade_unix.go @@ -30,6 +30,8 @@ type githubAsset struct { Name string `json:"name"` } +var GoArchExtra string // "", "v5", "v6", "v7" + func upgrade() error { path, err := osext.Executable() if err != nil { @@ -60,7 +62,7 @@ func upgrade() error { 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 { if strings.HasPrefix(asset.Name, expectedRelease) { if strings.HasSuffix(asset.Name, ".tar.gz") { @@ -88,6 +90,7 @@ func upgrade() error { } } + l.Warnf("Found no asset for %q", expectedRelease) return nil }