[Git][NTPsec/ntpsec][master] 2 commits: Prevent an insidious waf gotcha - see comment.

Eric S. Raymond gitlab at mg.gitlab.com
Mon Nov 7 22:58:09 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
dba48859 by Eric S. Raymond at 2016-11-07T17:12:46-05:00
Prevent an insidious waf gotcha - see comment.

- - - - -
b72c9f69 by Eric S. Raymond at 2016-11-07T17:57:40-05:00
Make ntpq behave as though stdout is line buffered...

...when when going to a pipe.  Defeats a Python misfeature.

- - - - -


2 changed files:

- ntpq/ntpq
- wscript


Changes:

=====================================
ntpq/ntpq
=====================================
--- a/ntpq/ntpq
+++ b/ntpq/ntpq
@@ -168,6 +168,7 @@ class Ntpq(cmd.Cmd):
 
     def say(self, msg):
         sys.stdout.write(msg)
+        sys.stdout.flush()	# In case we're piping the output
 
     def warn(self, msg):
         sys.stderr.write(msg)


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -143,6 +143,12 @@ def build(ctx):
 	ctx.load('asciidoc', tooldir='wafhelpers/')
 	ctx.load('rtems_trace', tooldir='wafhelpers/')
 
+	if ctx.cmd == "build":
+		# It's a waf gotcha that if there are object files (including
+		# .pyc and .pyo files) in a source directory, compilation to
+		# the build directory never happens.  This is how we foil that.
+		ctx.add_pre_fun(lambda ctx: ctx.exec_command("rm -f pylib/*.py[co]"))
+
 	if ctx.env.ENABLE_DOC_USER:
 		if ctx.variant != "main":
 			ctx.recurse("docs")
@@ -215,3 +221,9 @@ def build(ctx):
 		pprint("YELLOW", "Unit test runner skipped on a cross-compiled build.")
 		from waflib import Options
 		Options.options.no_tests = True
+
+# The following sets edit modes for GNU EMACS
+# Local Variables:
+# mode:python
+# End:
+# end



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/e5b7d2c4da7cbedb886e1a44d58f75749d686198...b72c9f694d1ece2a29af6cd77f9945c9bb3def20
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161107/9f2539a9/attachment.html>


More information about the vc mailing list