It would be good to add a layer of indirection to the import paths. This
patch will allow the repo name to change as Mynewt progresses through the
incubation process without needing to update import paths again.

The import paths will use mynewt.io instead of
git-wip-us.apache.org/repos/asf. Mynewt will be go gettable as:

go get mynewt.io/newt/...

The go tool makes a request to https://mynewt.io/newt?go-get=1 when it
fetches the import. A meta tag redirects it to the git repo at
https://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git.

Thanks,
-Todd

diff --git newt/newt.go newt/newt.go
index 86d32b4..c85e27a 100644
--- newt/newt.go
+++ newt/newt.go
@@ -17,9 +17,9 @@ package main

 import (
  "fmt"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt.git/newt/cli"
  "github.com/spf13/cobra"
  "log"
+ "mynewt.io/newt/newt/cli"
  "os"
  "path/filepath"
  "regexp"
diff --git newtmgr/cli/cp.go newtmgr/cli/cp.go
index 7dca0c7..03855f6 100644
--- newtmgr/cli/cp.go
+++ newtmgr/cli/cp.go
@@ -18,8 +18,8 @@ package cli
 import (
  "log"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
  "github.com/mitchellh/go-homedir"
+ "mynewt.io/newt/util"
 )

 type CpMgr struct {
diff --git newtmgr/newtmgr.go newtmgr/newtmgr.go
index 7244efa..063f3ac 100644
--- newtmgr/newtmgr.go
+++ newtmgr/newtmgr.go
@@ -23,12 +23,12 @@ import (
  "os"
  "strings"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/newtmgr/cli"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/newtmgr/protocol"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/newtmgr/transport"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
  "github.com/hashicorp/logutils"
  "github.com/spf13/cobra"
+ "mynewt.io/newt/newtmgr/cli"
+ "mynewt.io/newt/newtmgr/protocol"
+ "mynewt.io/newt/newtmgr/transport"
+ "mynewt.io/newt/util"
 )

 var ConnProfileName string
diff --git newtmgr/protocol/cmdrunner.go newtmgr/protocol/cmdrunner.go
index 8f4db62..f5f128d 100644
--- newtmgr/protocol/cmdrunner.go
+++ newtmgr/protocol/cmdrunner.go
@@ -18,7 +18,7 @@ package protocol
 import (
  "log"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/newtmgr/transport"
+ "mynewt.io/newt/newtmgr/transport"
 )

 type CmdRunner struct {
diff --git newtmgr/protocol/config.go newtmgr/protocol/config.go
index 9b59fea..b9ced87 100644
--- newtmgr/protocol/config.go
+++ newtmgr/protocol/config.go
@@ -19,7 +19,7 @@ import (
  "encoding/json"

  "fmt"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type Config struct {
diff --git newtmgr/protocol/echo.go newtmgr/protocol/echo.go
index 8e544d6..b9e79e2 100644
--- newtmgr/protocol/echo.go
+++ newtmgr/protocol/echo.go
@@ -20,7 +20,7 @@ import (
  "fmt"
  "strconv"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type Echo struct {
diff --git newtmgr/protocol/imageboot.go newtmgr/protocol/imageboot.go
index e16d7cc..0192480 100644
--- newtmgr/protocol/imageboot.go
+++ newtmgr/protocol/imageboot.go
@@ -19,7 +19,7 @@ import (
  "encoding/json"

  "fmt"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type ImageBoot struct {
diff --git newtmgr/protocol/imagefiledownload.go
newtmgr/protocol/imagefiledownload.go
index 5dc9988..112ac6a 100644
--- newtmgr/protocol/imagefiledownload.go
+++ newtmgr/protocol/imagefiledownload.go
@@ -19,7 +19,7 @@ import (
  "encoding/base64"
  "encoding/json"
  "fmt"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type FileDownload struct {
@@ -83,9 +83,9 @@ func DecodeFileDownloadResponse(data []byte)
(*FileDownload, error) {
  err.Error()))
  }
  f := &FileDownload{
- Offset : resp.Off,
- Data   : decodedData,
- Size   : resp.Size,
+ Offset: resp.Off,
+ Data:   decodedData,
+ Size:   resp.Size,
  }
  return f, nil
 }
diff --git newtmgr/protocol/imagefileupload.go
newtmgr/protocol/imagefileupload.go
index c840489..17735ae 100644
--- newtmgr/protocol/imagefileupload.go
+++ newtmgr/protocol/imagefileupload.go
@@ -19,7 +19,7 @@ import (
  "encoding/base64"
  "encoding/json"
  "fmt"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type FileUpload struct {
diff --git newtmgr/protocol/imagelist.go newtmgr/protocol/imagelist.go
index f7be7af..30db52d 100644
--- newtmgr/protocol/imagelist.go
+++ newtmgr/protocol/imagelist.go
@@ -19,7 +19,7 @@ import (
  "encoding/json"
  "fmt"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type ImageList struct {
diff --git newtmgr/protocol/imageupload.go newtmgr/protocol/imageupload.go
index 7f079b4..fb7e7a0 100644
--- newtmgr/protocol/imageupload.go
+++ newtmgr/protocol/imageupload.go
@@ -19,7 +19,7 @@ import (
  "encoding/base64"
  "encoding/json"
  "fmt"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type ImageUpload struct {
diff --git newtmgr/protocol/mpstats.go newtmgr/protocol/mpstats.go
index 92d5cae..e2f0ab5 100644
--- newtmgr/protocol/mpstats.go
+++ newtmgr/protocol/mpstats.go
@@ -19,7 +19,7 @@ import (
  "encoding/json"
  "fmt"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 const (
diff --git newtmgr/protocol/nmgr.go newtmgr/protocol/nmgr.go
index 115df92..46b349b 100644
--- newtmgr/protocol/nmgr.go
+++ newtmgr/protocol/nmgr.go
@@ -20,7 +20,7 @@ import (
  "fmt"
  "log"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 type NmgrReq struct {
diff --git newtmgr/protocol/stats.go newtmgr/protocol/stats.go
index 30cb710..f54a9b7 100644
--- newtmgr/protocol/stats.go
+++ newtmgr/protocol/stats.go
@@ -19,7 +19,7 @@ import (
  "encoding/json"
  "fmt"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 const (
diff --git newtmgr/protocol/taskstats.go newtmgr/protocol/taskstats.go
index 5025ae7..1dbfaef 100644
--- newtmgr/protocol/taskstats.go
+++ newtmgr/protocol/taskstats.go
@@ -19,7 +19,7 @@ import (
  "encoding/json"
  "fmt"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/util"
 )

 const (
diff --git newtmgr/transport/conn.go newtmgr/transport/conn.go
index 708f2ee..c3a3643 100644
--- newtmgr/transport/conn.go
+++ newtmgr/transport/conn.go
@@ -18,8 +18,8 @@ package transport
 import (
  "bytes"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/newtmgr/cli"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
+ "mynewt.io/newt/newtmgr/cli"
+ "mynewt.io/newt/util"
 )

 type Conn interface {
diff --git newtmgr/transport/connserial.go newtmgr/transport/connserial.go
index f4880b7..ca4a011 100644
--- newtmgr/transport/connserial.go
+++ newtmgr/transport/connserial.go
@@ -22,9 +22,9 @@ import (
  "fmt"
  "log"

- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/newtmgr/cli"
- "git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/util"
  "github.com/tarm/serial"
+ "mynewt.io/newt/newtmgr/cli"
+ "mynewt.io/newt/util"
 )

 type ConnSerial struct {

Reply via email to