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 RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
# Compile Go for cross compilation # Compile Go for cross compilation
ENV DOCKER_CROSSPLATFORMS darwin/amd64 darwin/386 ENV DOCKER_CROSSPLATFORMS linux/386 linux/arm darwin/amd64 darwin/386
# TODO add linux/386 and linux/arm # (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' 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 # Grab Go's cover tool for dead-simple code coverage testing

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -151,7 +151,8 @@ release_build() {
S3ARCH=i386 S3ARCH=i386
;; ;;
arm) 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'" echo >&2 "error: can't convert $S3ARCH to an appropriate value for 'uname -m'"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,5 @@
// +build !linux !amd64
package utils package utils
import ( import (
@ -9,5 +11,5 @@ type Utsname struct {
} }
func uname() (*Utsname, error) { 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")
} }