[Git][NTPsec/ntpsec][master] waf cleanup: use cmd_and_log() instead of rolling our own subprocess
Matt Selsky
gitlab at mg.gitlab.com
Sun Mar 4 02:08:40 UTC 2018
Matt Selsky pushed to branch master at NTPsec / ntpsec
Commits:
cdc1abcd by Matt Selsky at 2018-03-04T01:53:27Z
waf cleanup: use cmd_and_log() instead of rolling our own subprocess
- - - - -
1 changed file:
- wscript
Changes:
=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -213,16 +213,11 @@ def configure(ctx):
if ctx.options.disable_manpage:
ctx.env.DISABLE_MANPAGE = True
- from waflib.Utils import subprocess
if ((os.path.exists(".git") and
ctx.find_program("git", var="BIN_GIT", mandatory=False))):
ctx.start_msg("DEVEL: Getting revision")
- cmd = ["git", "log", "-1", "--format=%H"]
- p = subprocess.Popen(cmd, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE, universal_newlines=True)
- ctx.env.NTPSEC_REVISION, stderr = p.communicate()
- ctx.env.NTPSEC_REVISION = ctx.env.NTPSEC_REVISION.replace("\n", "")
+ cmd = shlex.split("git log -1 --format=%H")
+ ctx.env.NTPSEC_REVISION = ctx.cmd_and_log(cmd).strip()
ctx.end_msg(ctx.env.NTPSEC_REVISION)
ctx.start_msg("Building version")
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/cdc1abcd05e41176d5f1755e4509ccd77ebfa931
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/cdc1abcd05e41176d5f1755e4509ccd77ebfa931
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180304/2daae206/attachment.html>
More information about the vc
mailing list