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/11 18:24:26 UTC
[1/2] incubator-mynewt-newt git commit: Add 'target label' command
for invoking bin2img.
Repository: incubator-mynewt-newt
Updated Branches:
refs/heads/master 3eb0674e2 -> 7fb023676
Add 'target label' command for invoking bin2img.
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/b221ef8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/b221ef8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/b221ef8c
Branch: refs/heads/master
Commit: b221ef8ccdfb54fee83cd79b771dbec7c80b7ba7
Parents: 3eb0674
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 11 07:39:06 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 11 07:39:06 2016 -0800
----------------------------------------------------------------------
newt/cli/target.go | 65 +++++++++++++++++++++++++++++++++++++++----------
newt/newt.go | 33 +++++++++++++++++++++++++
2 files changed, 85 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b221ef8c/newt/cli/target.go
----------------------------------------------------------------------
diff --git a/newt/cli/target.go b/newt/cli/target.go
index 77dd971..ae04a6d 100644
--- a/newt/cli/target.go
+++ b/newt/cli/target.go
@@ -400,6 +400,52 @@ func (t *Target) Remove() error {
return nil
}
+func (t *Target) binPath() (string, error) {
+ if t.Vars["project"] == "" {
+ return "", NewNewtError(fmt.Sprintf("No project associated with " +
+ "target %s", t.Name))
+ }
+ p, err := LoadProject(t.Repo, t, t.Vars["project"])
+ if err != nil {
+ return "", err
+ }
+ return filepath.Join(p.BinPath(), p.Name), nil
+}
+
+func (t *Target) Label(versionStr string) error {
+ bin2img, err := LoadTarget(t.Repo, "bin2img")
+ if err != nil {
+ return NewNewtError("Cannot label with bin2img target")
+ }
+
+ err = bin2img.Build()
+ if err != nil {
+ return err
+ }
+
+ bin2imgBase, err := bin2img.binPath()
+ if err != nil {
+ return err
+ }
+
+ bin2imgPath := bin2imgBase + ".elf"
+
+ binBaseName, err := t.binPath()
+ if err != nil {
+ return err
+ }
+
+ os.Chdir(t.Repo.BasePath)
+
+ rsp, err := ShellCommand(fmt.Sprintf("%s %s %s %s", bin2imgPath,
+ binBaseName + ".elf.bin", binBaseName + ".img", versionStr))
+ if err != nil {
+ StatusMessage(VERBOSITY_DEFAULT, "%s", rsp);
+ return err
+ }
+ return nil
+}
+
func (t *Target) Download() error {
pkgList, err := NewPkgList(t.Repo)
if err != nil {
@@ -421,11 +467,7 @@ func (t *Target) Download() error {
}
downloadScript := filepath.Join(pkg.BasePath, pkg.DownloadScript)
- if t.Vars["project"] == "" {
- return NewNewtError(fmt.Sprintf("No project associated with target %s",
- t.Name))
- }
- p, err := LoadProject(t.Repo, t, t.Vars["project"])
+ binBaseName, err := t.binPath()
if err != nil {
return err
}
@@ -439,7 +481,7 @@ func (t *Target) Download() error {
StatusMessage(VERBOSITY_DEFAULT, "Downloading with %s\n", downloadScript)
rsp, err := ShellCommand(fmt.Sprintf("%s %s %s", downloadScript,
- filepath.Join(p.BinPath(), p.Name), identString))
+ binBaseName, identString))
if err != nil {
StatusMessage(VERBOSITY_DEFAULT, "%s", rsp);
return err
@@ -469,11 +511,7 @@ func (t *Target) Debug() error {
}
debugScript := filepath.Join(pkg.BasePath, pkg.DebugScript)
- if t.Vars["project"] == "" {
- return NewNewtError(fmt.Sprintf("No project associated with target %s",
- t.Name))
- }
- p, err := LoadProject(t.Repo, t, t.Vars["project"])
+ binBaseName, err := t.binPath()
if err != nil {
return err
}
@@ -485,9 +523,10 @@ func (t *Target) Debug() error {
identString = identString + ident
}
- StatusMessage(VERBOSITY_DEFAULT, "Debugging with %s %s\n", debugScript, p.Name)
+ StatusMessage(VERBOSITY_DEFAULT, "Debugging with %s %s\n", debugScript,
+ binBaseName)
- cmdLine := []string{debugScript, filepath.Join(p.BinPath(), p.Name)}
+ cmdLine := []string{debugScript, binBaseName}
cmdLine = append(cmdLine, identString)
err = ShellInteractiveCommand(cmdLine)
if err != nil {
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/b221ef8c/newt/newt.go
----------------------------------------------------------------------
diff --git a/newt/newt.go b/newt/newt.go
index af3cdbb..7a41e42 100644
--- a/newt/newt.go
+++ b/newt/newt.go
@@ -303,6 +303,22 @@ func targetSizeCmd(cmd *cobra.Command, args []string) {
cli.StatusMessage(cli.VERBOSITY_DEFAULT, "%s", txt)
}
+func targetLabelCmd(cmd *cobra.Command, args []string) {
+ if len(args) < 2 {
+ NewtUsage(cmd, cli.NewNewtError("Must specify target and version"))
+ }
+
+ t, err := cli.LoadTarget(NewtRepo, args[0])
+ if err != nil {
+ NewtUsage(nil, err)
+ }
+
+ err = t.Label(args[1])
+ if err != nil {
+ NewtUsage(nil, err)
+ }
+}
+
func targetDownloadCmd(cmd *cobra.Command, args []string) {
if len(args) < 1 {
NewtUsage(cmd, cli.NewNewtError("Must specify target to download"))
@@ -386,6 +402,7 @@ func targetAddCmds(base *cobra.Command) {
targetHelpEx += " newt target build <target-name> [clean[ all]]\n"
targetHelpEx += " newt target test <target-name> [clean[ all]]\n"
targetHelpEx += " newt target size <target-name>\n"
+ targetHelpEx += " newt target label <target-name> <version number>"
targetHelpEx += " newt target download <target-name>\n"
targetHelpEx += " newt target debug <target-name>\n"
targetHelpEx += " newt target export [-a -export-all] [<target-name>]\n"
@@ -549,6 +566,22 @@ func targetAddCmds(base *cobra.Command) {
targetCmd.AddCommand(sizeCmd)
+ labelHelpText := formatHelp(`Label image by appending image header to created
+ binary file <target-name>. Version number in the header is set to be
+ <version>`)
+ labelHelpEx := " newt target label <target-name> <version>\n"
+ labelHelpEx += " newt target label my_target1 1.2.0\n"
+ labelHelpEx += " newt target label my_target1 1.2.0.3\n"
+
+ labelCmd := &cobra.Command{
+ Use: "label",
+ Short: "Add image header to target binary",
+ Long: labelHelpText,
+ Example: labelHelpEx,
+ Run: targetLabelCmd,
+ }
+ targetCmd.AddCommand(labelCmd)
+
downloadHelpText := formatHelp(`Download project image to target for
<target-name>.`)
downloadHelpEx := " newt target download <target-name>\n"
[2/2] incubator-mynewt-newt git commit: Runtime license -> Apache.
Posted by ma...@apache.org.
Runtime license -> Apache.
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/7fb02367
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/7fb02367
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/7fb02367
Branch: refs/heads/master
Commit: 7fb02367631eefffbd28a3a016f0c64e1fb5a359
Parents: b221ef8
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Thu Feb 11 09:15:36 2016 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Feb 11 09:15:36 2016 -0800
----------------------------------------------------------------------
newt/cli/build.go | 32 ++++++++++++++++++--------------
newt/cli/compiler.go | 32 ++++++++++++++++++--------------
newt/cli/deps.go | 19 +++++++++++++++++++
newt/cli/downloader.go | 32 ++++++++++++++++++--------------
newt/cli/image.go | 18 ++++++++++++++++++
newt/cli/pkg.go | 32 ++++++++++++++++++--------------
newt/cli/pkglist.go | 32 ++++++++++++++++++--------------
newt/cli/project.go | 32 ++++++++++++++++++--------------
newt/cli/remoterepo.go | 38 +++++++++++++++++++++-----------------
newt/cli/repo.go | 32 ++++++++++++++++++--------------
newt/cli/target.go | 42 +++++++++++++++++++++++-------------------
newt/cli/util.go | 32 ++++++++++++++++++--------------
newt/newt.go | 32 ++++++++++++++++++--------------
13 files changed, 243 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/build.go
----------------------------------------------------------------------
diff --git a/newt/cli/build.go b/newt/cli/build.go
index eff2376..67e3139 100644
--- a/newt/cli/build.go
+++ b/newt/cli/build.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/compiler.go
----------------------------------------------------------------------
diff --git a/newt/cli/compiler.go b/newt/cli/compiler.go
index c5e6926..31f999d 100644
--- a/newt/cli/compiler.go
+++ b/newt/cli/compiler.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/deps.go
----------------------------------------------------------------------
diff --git a/newt/cli/deps.go b/newt/cli/deps.go
index 72ada66..a4c7069 100644
--- a/newt/cli/deps.go
+++ b/newt/cli/deps.go
@@ -1,3 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package cli
import (
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/downloader.go
----------------------------------------------------------------------
diff --git a/newt/cli/downloader.go b/newt/cli/downloader.go
index b743fea..981673b 100644
--- a/newt/cli/downloader.go
+++ b/newt/cli/downloader.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/image.go
----------------------------------------------------------------------
diff --git a/newt/cli/image.go b/newt/cli/image.go
new file mode 100644
index 0000000..f736fe1
--- /dev/null
+++ b/newt/cli/image.go
@@ -0,0 +1,18 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/pkg.go
----------------------------------------------------------------------
diff --git a/newt/cli/pkg.go b/newt/cli/pkg.go
index d3fe537..d968289 100644
--- a/newt/cli/pkg.go
+++ b/newt/cli/pkg.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/pkglist.go
----------------------------------------------------------------------
diff --git a/newt/cli/pkglist.go b/newt/cli/pkglist.go
index fd7f811..675b401 100644
--- a/newt/cli/pkglist.go
+++ b/newt/cli/pkglist.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/project.go
----------------------------------------------------------------------
diff --git a/newt/cli/project.go b/newt/cli/project.go
index 43ae4b6..fe3012e 100644
--- a/newt/cli/project.go
+++ b/newt/cli/project.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/remoterepo.go
----------------------------------------------------------------------
diff --git a/newt/cli/remoterepo.go b/newt/cli/remoterepo.go
index 56b3dfa..1dadb66 100644
--- a/newt/cli/remoterepo.go
+++ b/newt/cli/remoterepo.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
@@ -37,9 +41,9 @@ type RemoteRepo struct {
// Allocate a new structure, and initialize it.
func NewRemoteRepo(pkgList *PkgList, branch string) (*RemoteRepo, error) {
remoteRepo := &RemoteRepo{
- Name : pkgList.Name,
+ Name: pkgList.Name,
RemoteLoc: pkgList.RemoteUrl,
- LocalLoc: "",
+ LocalLoc: "",
}
err := remoteRepo.Download(branch)
@@ -91,7 +95,7 @@ func (remoteRepo *RemoteRepo) Download(branch string) error {
func (remoteRepo *RemoteRepo) ResolvePkgName(pkgName string) (*Pkg, error) {
if remoteRepo.PkgList == nil {
return nil, NewNewtError(fmt.Sprintf("RemoteRepo %s not downloaded yet!",
- remoteRepo.Name))
+ remoteRepo.Name))
}
return remoteRepo.PkgList.ResolvePkgName(pkgName)
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/repo.go
----------------------------------------------------------------------
diff --git a/newt/cli/repo.go b/newt/cli/repo.go
index 45ad5ce..fa7d34e 100644
--- a/newt/cli/repo.go
+++ b/newt/cli/repo.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/target.go
----------------------------------------------------------------------
diff --git a/newt/cli/target.go b/newt/cli/target.go
index ae04a6d..1b1822e 100644
--- a/newt/cli/target.go
+++ b/newt/cli/target.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
@@ -95,7 +99,7 @@ func (t *Target) SetDefaults() error {
}
t.Identities = map[string]string{}
for _, ident := range identities {
- StatusMessage(VERBOSITY_VERBOSE, " set default ident %s\n", ident)
+ StatusMessage(VERBOSITY_VERBOSE, " set default ident %s\n", ident)
t.Identities[ident] = t.Name
}
t.Capabilities, err = parseTargetStringSlice(t.Vars["capabilities"])
@@ -402,7 +406,7 @@ func (t *Target) Remove() error {
func (t *Target) binPath() (string, error) {
if t.Vars["project"] == "" {
- return "", NewNewtError(fmt.Sprintf("No project associated with " +
+ return "", NewNewtError(fmt.Sprintf("No project associated with "+
"target %s", t.Name))
}
p, err := LoadProject(t.Repo, t, t.Vars["project"])
@@ -438,9 +442,9 @@ func (t *Target) Label(versionStr string) error {
os.Chdir(t.Repo.BasePath)
rsp, err := ShellCommand(fmt.Sprintf("%s %s %s %s", bin2imgPath,
- binBaseName + ".elf.bin", binBaseName + ".img", versionStr))
+ binBaseName+".elf.bin", binBaseName+".img", versionStr))
if err != nil {
- StatusMessage(VERBOSITY_DEFAULT, "%s", rsp);
+ StatusMessage(VERBOSITY_DEFAULT, "%s", rsp)
return err
}
return nil
@@ -483,7 +487,7 @@ func (t *Target) Download() error {
rsp, err := ShellCommand(fmt.Sprintf("%s %s %s", downloadScript,
binBaseName, identString))
if err != nil {
- StatusMessage(VERBOSITY_DEFAULT, "%s", rsp);
+ StatusMessage(VERBOSITY_DEFAULT, "%s", rsp)
return err
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/cli/util.go
----------------------------------------------------------------------
diff --git a/newt/cli/util.go b/newt/cli/util.go
index 9626acf..c49fc39 100644
--- a/newt/cli/util.go
+++ b/newt/cli/util.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package cli
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/7fb02367/newt/newt.go
----------------------------------------------------------------------
diff --git a/newt/newt.go b/newt/newt.go
index 7a41e42..268d823 100644
--- a/newt/newt.go
+++ b/newt/newt.go
@@ -1,17 +1,21 @@
-/*
- Copyright 2015 Runtime Inc.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package main