Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/master' into wip
[src/xds/xds-server.git]
/
lib
/
crosssdk
/
sdk.go
diff --git
a/lib/crosssdk/sdk.go
b/lib/crosssdk/sdk.go
index
9aeec90
..
5be8954
100644
(file)
--- a/
lib/crosssdk/sdk.go
+++ b/
lib/crosssdk/sdk.go
@@
-3,6
+3,8
@@
package crosssdk
import (
"fmt"
"path/filepath"
import (
"fmt"
"path/filepath"
+
+ uuid "github.com/satori/go.uuid"
)
// SDK Define a cross tool chain used to build application
)
// SDK Define a cross tool chain used to build application
@@
-31,8
+33,9
@@
func NewCrossSDK(path string) (*SDK, error) {
d = filepath.Dir(d)
s.Profile = filepath.Base(d)
d = filepath.Dir(d)
s.Profile = filepath.Base(d)
- s.ID = s.Profile + "_" + s.Arch + "_" + s.Version
- s.Name = s.Arch + " (" + s.Version + ")"
+ // Use V3 to ensure that we get same uuid on restart
+ s.ID = uuid.NewV3(uuid.FromStringOrNil("sdks"), s.Profile+"_"+s.Arch+"_"+s.Version).String()
+ s.Name = s.Arch + " (" + s.Version + ")"
envFile := filepath.Join(path, "environment-setup*")
ef, err := filepath.Glob(envFile)
envFile := filepath.Join(path, "environment-setup*")
ef, err := filepath.Glob(envFile)
@@
-48,6
+51,6
@@
func NewCrossSDK(path string) (*SDK, error) {
}
// GetEnvCmd returns the command used to initialized the environment
}
// GetEnvCmd returns the command used to initialized the environment
-func (s *SDK) GetEnvCmd() string {
- return
". " + s.EnvFile
+func (s *SDK) GetEnvCmd()
[]
string {
+ return
[]string{"source", s.EnvFile}
}
}