Permalink
Browse files

build snapd without CGO

  • Loading branch information...
1 parent 5221eba commit fc5e6d7112ad005f32d120dcfc3e646c3645241a @chipaca chipaca committed Nov 17, 2016
View
@@ -43,7 +43,7 @@ import (
"github.com/snapcore/snapd/asserts/snapasserts"
"github.com/snapcore/snapd/client"
"github.com/snapcore/snapd/dirs"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/interfaces"
"github.com/snapcore/snapd/logger"
"github.com/snapcore/snapd/osutil"
View
@@ -32,7 +32,7 @@ import (
"gopkg.in/tomb.v2"
"github.com/snapcore/snapd/dirs"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/logger"
"github.com/snapcore/snapd/notifications"
"github.com/snapcore/snapd/osutil"
@@ -1,7 +1,7 @@
// -*- Mode: Go; indent-tabs-mode: t -*-
/*
- * Copyright (C) 2014-2015 Canonical Ltd
+ * Copyright (C) 2016 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -17,15 +17,8 @@
*
*/
-package progress
+package i18n // import "github.com/snapcore/snapd/i18n/dumb"
-/*
-#include <unistd.h>
-*/
-import "C"
-
-// isatty is a wrapper around isatty(3).
-// Returns true if the specified fd is associated with a tty.
-func isatty(fd int) bool {
- return C.isatty(C.int(fd)) == 1
+func G(s string) string {
+ return s
}
@@ -22,7 +22,7 @@ package configstate
import (
"fmt"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/overlord/hookstate"
"github.com/snapcore/snapd/overlord/snapstate"
"github.com/snapcore/snapd/overlord/state"
@@ -40,7 +40,7 @@ import (
"github.com/snapcore/snapd/asserts"
"github.com/snapcore/snapd/dirs"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/osutil"
"github.com/snapcore/snapd/overlord/assertstate"
"github.com/snapcore/snapd/overlord/auth"
@@ -28,7 +28,7 @@ import (
"github.com/snapcore/snapd/asserts"
"github.com/snapcore/snapd/asserts/snapasserts"
"github.com/snapcore/snapd/dirs"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/overlord/assertstate"
"github.com/snapcore/snapd/overlord/auth"
"github.com/snapcore/snapd/overlord/snapstate"
@@ -23,7 +23,7 @@ import (
"encoding/json"
"fmt"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/overlord/configstate"
)
@@ -24,7 +24,7 @@ import (
"fmt"
"strings"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/overlord/configstate"
)
@@ -24,7 +24,7 @@ package ifacestate
import (
"fmt"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/interfaces"
"github.com/snapcore/snapd/interfaces/backends"
@@ -22,7 +22,7 @@ package patch
import (
"fmt"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/overlord/state"
)
@@ -27,7 +27,7 @@ import (
"sort"
"github.com/snapcore/snapd/boot"
- "github.com/snapcore/snapd/i18n"
+ "github.com/snapcore/snapd/i18n/dumb"
"github.com/snapcore/snapd/logger"
"github.com/snapcore/snapd/overlord/auth"
"github.com/snapcore/snapd/overlord/state"
@@ -26,6 +26,7 @@ import (
"unicode"
"github.com/cheggaaa/pb"
+ "golang.org/x/crypto/ssh/terminal"
)
// Meter is an interface to show progress to the user
@@ -194,5 +195,5 @@ func MakeProgressBar() Meter {
var attachedToTerminal = func() bool {
fd := int(os.Stdin.Fd())
- return isatty(fd)
+ return terminal.IsTerminal(fd)
}

0 comments on commit fc5e6d7

Please sign in to comment.