diff --git a/build.sh b/build.sh index 9d7ca8579..341858abc 100755 --- a/build.sh +++ b/build.sh @@ -142,7 +142,7 @@ case "$1" in godep go build ./cmd/stpidx godep go build ./cmd/stcli - for os in darwin-amd64 linux-386 linux-amd64 freebsd-amd64 windows-amd64 windows-386 ; do + for os in darwin-amd64 linux-386 linux-amd64 freebsd-amd64 windows-amd64 windows-386 solaris-amd64 ; do export GOOS=${os%-*} export GOARCH=${os#*-} diff --git a/cmd/syncthing/memsize_solaris.go b/cmd/syncthing/memsize_solaris.go new file mode 100644 index 000000000..360b5e1ad --- /dev/null +++ b/cmd/syncthing/memsize_solaris.go @@ -0,0 +1,20 @@ +package main + +import ( + "os/exec" + "strconv" +) + +func memorySize() (uint64, error) { + cmd := exec.Command("prtconf", "-m") + out, err := cmd.CombinedOutput() + if err != nil { + return 0, err + } + + mb, err := strconv.ParseUint(string(out), 10, 64) + if err != nil { + return 0, err + } + return mb * 1024 * 1024, nil +} diff --git a/cmd/syncthing/memsize_unimpl.go b/cmd/syncthing/memsize_unimpl.go index 63c4223dd..b896f895b 100644 --- a/cmd/syncthing/memsize_unimpl.go +++ b/cmd/syncthing/memsize_unimpl.go @@ -1,4 +1,4 @@ -// +build freebsd solaris +// +build freebsd package main diff --git a/cmd/syncthing/upgrade.go b/cmd/syncthing/upgrade_supported.go similarity index 99% rename from cmd/syncthing/upgrade.go rename to cmd/syncthing/upgrade_supported.go index 2ac2843b5..6b09f8533 100644 --- a/cmd/syncthing/upgrade.go +++ b/cmd/syncthing/upgrade_supported.go @@ -2,6 +2,8 @@ // Use of this source code is governed by an MIT-style license that can be // found in the LICENSE file. +// +build !solaris + package main import ( diff --git a/cmd/syncthing/upgrade_unsupp.go b/cmd/syncthing/upgrade_unsupp.go new file mode 100644 index 000000000..777c5f1de --- /dev/null +++ b/cmd/syncthing/upgrade_unsupp.go @@ -0,0 +1,9 @@ +// +build windows solaris + +package main + +import "errors" + +func upgrade() error { + return errors.New("Upgrade currently unsupported on Windows") +} diff --git a/files/testdata/index.db b/files/testdata/index.db new file mode 100644 index 000000000..2d4afe201 Binary files /dev/null and b/files/testdata/index.db differ