You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/05/22 17:59:52 UTC

[GitHub] ccollins476ad closed pull request #168: Ensure new `.a` file needed before deleting old

ccollins476ad closed pull request #168: Ensure new `.a` file needed before deleting old
URL: https://github.com/apache/mynewt-newt/pull/168
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index 7ea5c640..4ecf3d6e 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -691,7 +691,7 @@ func (c *Compiler) CopyArchive(filename string) error {
 	}
 	if copyRequired {
 		err = util.CopyFile(filename, tgtFile)
-		util.StatusMessage(util.VERBOSITY_DEFAULT, "copying %s\n",
+		util.StatusMessage(util.VERBOSITY_DEFAULT, "Copying %s\n",
 			filepath.ToSlash(tgtFile))
 	}
 
@@ -1176,11 +1176,8 @@ func (c *Compiler) CompileArchive(archiveFile string) error {
 		return util.NewNewtError(err.Error())
 	}
 
-	// Delete the old archive, if it exists.
-	os.Remove(archiveFile)
-
 	objList := c.getObjFiles([]string{})
-	if objList == nil {
+	if len(objList) == 0 {
 		return nil
 	}
 
@@ -1190,6 +1187,9 @@ func (c *Compiler) CompileArchive(archiveFile string) error {
 		return nil
 	}
 
+	// Delete the old archive, if it exists.
+	os.Remove(archiveFile)
+
 	util.StatusMessage(util.VERBOSITY_DEFAULT, "Archiving %s",
 		path.Base(archiveFile))
 	util.StatusMessage(util.VERBOSITY_VERBOSE, " with object files %s",


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services