Merge pull request #3857 from creack/remove_darwin_files

Remove all darwin specific files and use more generic _unsupported with build tags.
This commit is contained in:
Victor Vieux 2014-01-31 11:48:10 -08:00
commit 523341d994
33 changed files with 57 additions and 19 deletions

View File

@ -68,8 +68,9 @@ ENV GOPATH /go:/go/src/github.com/dotcloud/docker/vendor
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
# Compile Go for cross compilation
ENV DOCKER_CROSSPLATFORMS darwin/amd64 darwin/386
# TODO add linux/386 and linux/arm
ENV DOCKER_CROSSPLATFORMS linux/386 linux/arm darwin/amd64 darwin/386
# (set an explicit GOARM of 5 for maximum compatibility)
ENV GOARM 5
RUN cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done'
# Grab Go's cover tool for dead-simple code coverage testing

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package archive
import "syscall"

View File

@ -1,3 +1,5 @@
// +build amd64
package lxc
import (

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package lxc
func setHostname(hostname string) error {

View File

@ -1,3 +1,5 @@
// +build amd64
package aufs
import "syscall"

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package aufs
import "errors"

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package btrfs

View File

@ -1,3 +1,3 @@
// +build !linux
// +build !linux !amd64
package btrfs

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -1,4 +1,4 @@
// +build linux
// +build linux,amd64
package devmapper

View File

@ -151,7 +151,8 @@ release_build() {
S3ARCH=i386
;;
arm)
# GOARCH is fine
S3ARCH=armel
# someday, we might potentially support mutliple GOARM values, in which case we might get armhf here too
;;
*)
echo >&2 "error: can't convert $S3ARCH to an appropriate value for 'uname -m'"

View File

@ -1,3 +1,5 @@
// +build amd64
package graphdb
import (

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package graphdb
func NewSqliteConn(root string) (*Database, error) {

View File

@ -1,3 +1,5 @@
// +build amd64
package mount
import (

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package mount
func parseOptions(options string) (int, string) {

View File

@ -1,3 +1,5 @@
// +build amd64
package mount
import (

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package mount
func mount(device, target, mType string, flag uintptr, data string) error {

View File

@ -1,3 +1,5 @@
// +build amd64
package netlink
import (

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package netlink
import (

View File

@ -1,3 +1,5 @@
// +build amd64
package docker
// FIXME: This could be easily rewritten in pure Go

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package docker
import (

View File

@ -24,10 +24,12 @@ func TreeSize(dir string) (size int64, err error) {
// Check inode to handle hard links correctly
inode := fileInfo.Sys().(*syscall.Stat_t).Ino
if _, exists := data[inode]; exists {
// inode is not a uint64 on all platforms. Cast it to avoid issues.
if _, exists := data[uint64(inode)]; exists {
return nil
}
data[inode] = false
// inode is not a uint64 on all platforms. Cast it to avoid issues.
data[uint64(inode)] = false
size += s

View File

@ -1,3 +1,5 @@
// +build amd64
package utils
import (

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package utils
import (
@ -9,5 +11,5 @@ type Utsname struct {
}
func uname() (*Utsname, error) {
return nil, errors.New("Kernel version detection is not available on darwin")
return nil, errors.New("Kernel version detection is available only on linux")
}