From 5231a09820508e30631bfe1167dacece680b315e Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 11 Aug 2014 11:59:33 +0200 Subject: [PATCH] Add ./build.sh noupgrade and all-noupgrade --- build.sh | 99 +++++++++++++++++++++++++++-------------------- files/set_test.go | 3 +- 2 files changed, 59 insertions(+), 43 deletions(-) diff --git a/build.sh b/build.sh index 1e101c2e..30d96f85 100755 --- a/build.sh +++ b/build.sh @@ -119,6 +119,52 @@ transifex() { assets } +build-all() { + rm -f *.tar.gz *.zip + test -short || exit 1 + assets + + rm -rf bin Godeps/_workspace/pkg $GOPATH/pkg/*/github.com/syncthing + for os in darwin-amd64 freebsd-amd64 freebsd-386 linux-amd64 linux-386 windows-amd64 windows-386 solaris-amd64 ; do + export GOOS=${os%-*} + export GOARCH=${os#*-} + + build $* + + name="syncthing-${os/darwin/macosx}-$version" + case $GOOS in + windows) + zipDist "$name" + rm -f syncthing.exe + ;; + *) + tarDist "$name" + rm -f syncthing + ;; + esac + done + + 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" +} + case "$1" in "") shift @@ -130,6 +176,11 @@ case "$1" in rm -rf bin Godeps/_workspace/pkg $GOPATH/pkg/*/github.com/syncthing ;; + noupgrade) + export GOBIN=$(pwd)/bin + godep go install -tags noupgrade -ldflags "$ldflags" ./cmd/... + ;; + race) build -race ;; @@ -160,49 +211,13 @@ case "$1" in ;; all) - rm -f *.tar.gz *.zip - test -short || exit 1 - assets - - for os in darwin-amd64 freebsd-amd64 freebsd-386 linux-amd64 linux-386 windows-amd64 windows-386 solaris-amd64 ; do - export GOOS=${os%-*} - export GOARCH=${os#*-} - - build - - name="syncthing-${os/darwin/macosx}-$version" - case $GOOS in - windows) - zipDist "$name" - rm -f syncthing.exe - ;; - *) - tarDist "$name" - rm -f syncthing - ;; - esac - done - - 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" + shift + build-all + ;; + all-noupgrade) + shift + build-all -tags noupgrade ;; upload) diff --git a/files/set_test.go b/files/set_test.go index 77bb4e2d..5e3b0eb4 100644 --- a/files/set_test.go +++ b/files/set_test.go @@ -8,7 +8,6 @@ import ( "fmt" "sort" "testing" - "time" "github.com/syncthing/syncthing/files" "github.com/syncthing/syncthing/lamport" @@ -594,6 +593,7 @@ func TestLocalVersion(t *testing.T) { } } +/* var gf protocol.FileInfo func TestStressGlobalVersion(t *testing.T) { @@ -652,3 +652,4 @@ func stressWriter(s *files.Set, id protocol.NodeID, set1, set2 []protocol.FileIn i++ } } +*/