summaryrefslogtreecommitdiffstats
path: root/lib/crosssdk/sdk.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 14:56:39 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 16:00:04 +0100
commit1a780af75f5e8a012efc3546e656d3c889e4d2a1 (patch)
treea90179797af0bb59c85e256ef326b3979d506896 /lib/crosssdk/sdk.go
parent853532297622e8be4fad46bcde9a52c15e7fb0fe (diff)
Used uuid of SDK ID and support short ID name if not ambiguous.
Diffstat (limited to 'lib/crosssdk/sdk.go')
-rw-r--r--lib/crosssdk/sdk.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/crosssdk/sdk.go b/lib/crosssdk/sdk.go
index 5a5770d..5be8954 100644
--- a/lib/crosssdk/sdk.go
+++ b/lib/crosssdk/sdk.go
@@ -3,6 +3,8 @@ package crosssdk
import (
"fmt"
"path/filepath"
+
+ uuid "github.com/satori/go.uuid"
)
// 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)
- 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)