You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/02/12 20:37:17 UTC

[2/3] incubator-mynewt-newt git commit: Add target definition to manifest file.

Add target definition to manifest file.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/93b3b5e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/93b3b5e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/93b3b5e1

Branch: refs/heads/master
Commit: 93b3b5e17f8266640e66f3b6ce3c2c19a8354c21
Parents: a359409
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Fri Feb 12 11:12:28 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Fri Feb 12 11:12:28 2016 -0800

----------------------------------------------------------------------
 newt/cli/image.go | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/93b3b5e1/newt/cli/image.go
----------------------------------------------------------------------
diff --git a/newt/cli/image.go b/newt/cli/image.go
index 7e66d10..37885f1 100644
--- a/newt/cli/image.go
+++ b/newt/cli/image.go
@@ -29,6 +29,7 @@ import (
 	"io"
 	"os"
 	"path/filepath"
+	"sort"
 	"strconv"
 	"strings"
 	"time"
@@ -100,6 +101,7 @@ type ImageManifest struct {
 	Hash    string `json:"id"`
 	Image   string `json:"image"`
 	Pkgs	[]*ImageManifestPkg `json:"pkgs"`
+	TgtVars []string `json:"target"`
 }
 
 type ImageManifestPkg struct {
@@ -288,6 +290,16 @@ func (image *Image) CreateManifest() error {
 		}
 		manifest.Pkgs = append(manifest.Pkgs, imgPkg)
 	}
+
+	vars := image.target.GetVars()
+	var keys []string
+	for k := range vars {
+		keys = append(keys, k)
+	}
+	sort.Strings(keys)
+	for _, k := range keys {
+		manifest.TgtVars = append(manifest.TgtVars, k+"="+vars[k])
+	}
 	file, err := os.Create(image.ManifestFile);
 	if err != nil {
 		return NewNewtError(fmt.Sprintf("Cannot create manifest file %s: %s",