git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 10b/16] engine.pl: delete the captured stderr file if empty

From
Philip Oakley <philipoakley@iee.org>
Date
Jul 20, 2015, 22:54 UTC
Message-ID
<1437432846-5796-3-git-send-email-philipoakley@iee.org>
In-Reply-To
<1437432846-5796-1-git-send-email-philipoakley@iee.org>

Keep the build clean of extraneous files if it is indeed clean. Otherwise leave the msvc-build-makedryerrors.txt file both as a flag for any CI system or for manual debugging.

Alternatively, with improved syntactic sugar[1]:
	unlink $ErrsFile if -f -z $ErrsFile;
could be used but requires Perl 5.10 or later, which is not
available on Msysgit, but is available on the newer Git-for-Windows
SDK on Msys2 [2].

Note that the file will contain the new values of the GIT_VERSION and GITGUI_VERSION if they were generated by the make file. They are omitted if the release is tagged and identically defined in their respective GIT_VERSION_GEN file DEF_VER variables.

[1]: http://perldoc.perl.org/functions/-X.html [2]: http://git-for-windows.github.io/

Helped-by:  Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Philip Oakley <philipoakley@iee.org>
---
Eric's help gmane.comp.version-control.msysgit/21745
---
 contrib/buildsystems/engine.pl | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index a6999b6..154575d 100755
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -77,6 +77,8 @@ EOM
 
 my $ErrsFile = "msvc-build-makedryerrors.txt";
 @makedry = `cd $git_dir && make -n MSVC=1 V=1 2>$ErrsFile` if !@makedry;
+# test for an empty Errors file and remove it
+unlink $ErrsFile if -f $ErrsFile && -z _;
 
 # Parse the make output into usable info
 parseMakeOutput();
-- 
2.3.1
Previous: Philip OakleyNext: Junio C Hamano
Message 3 of 9 in “Make the msvc-build scripts work again”
  1. 00/16 Make the msvc-build scripts work againPhilip Oakley, Jul 20, 2015
  2. engine.pl: ignore invalidcontinue.obj which is known to MSVCPhilip Oakley, Jul 20, 2015
  3. engine.pl: delete the captured stderr file if emptyPhilip Oakley, Jul 20, 2015
  4. Junio C HamanoJul 20, 2015
  5. Philip OakleyJul 21, 2015
  6. Junio C HamanoJul 21, 2015
  7. Junio C HamanoJul 21, 2015
  8. Philip OakleyJul 21, 2015
  9. Ramsay JonesJul 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.