[Git][NTPsec/ntpsec][master] 2 commits: Nuke all the logic around NTPSEC_RELEASE in the build recipe.
Eric S. Raymond
gitlab at mg.gitlab.com
Sun Dec 4 15:30:12 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
e4526e3b by Eric S. Raymond at 2016-12-04T10:29:24-05:00
Nuke all the logic around NTPSEC_RELEASE in the build recipe.
We have a simpler way to do things.
- - - - -
66ad001e by Eric S. Raymond at 2016-12-04T10:29:24-05:00
Undo incorrect constification.
- - - - -
6 changed files:
- ntpd/refclock_jjy.c
- ntpd/wscript
- wafhelpers/configure.py
- − wafhelpers/dist.py
- wafhelpers/waf.py
- wscript
Changes:
=====================================
ntpd/refclock_jjy.c
=====================================
--- a/ntpd/refclock_jjy.c
+++ b/ntpd/refclock_jjy.c
@@ -4046,7 +4046,7 @@ static int
modem_init_resp00 ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up )
{
- const char *pCmd, cBuf [ 46 ] ;
+ char *pCmd, cBuf [ 46 ] ;
int iCmdLen ;
int iErrorCorrection, iSpeakerSwitch, iSpeakerVolume ;
int iNextModemState = STAY_MODEM_STATE ;
=====================================
ntpd/wscript
=====================================
--- a/ntpd/wscript
+++ b/ntpd/wscript
@@ -4,23 +4,21 @@ def build(ctx):
bldnode = ctx.bldnode.abspath()
if ctx.variant == "host":
+ bison_source = [
+ "ntp_parser.y"
+ ]
- if not ctx.env.NTPSEC_RELEASE:
- bison_source = [
- "ntp_parser.y"
+ ctx(
+ target = "bison_obj",
+ features = "c src_include bld_include libisc_include",
+ source = bison_source,
+ includes = [
+ "%s/ntpd/" % srcnode,
+ "%s/" % ctx.bldnode.parent.abspath()
]
+ )
- ctx(
- target = "bison_obj",
- features = "c src_include bld_include libisc_include",
- source = bison_source,
- includes = [
- "%s/ntpd/" % srcnode,
- "%s/" % ctx.bldnode.parent.abspath()
- ]
- )
-
- ctx.add_group() # Generate Bison files first.
+ ctx.add_group() # Generate Bison files first.
keyword_gen_source = [
"keyword-gen.c",
@@ -111,7 +109,7 @@ def build(ctx):
"ntp_signd.c",
"ntp_timer.c",
"ntpd.c",
- ctx.bldnode.parent.find_node("host/ntpd/ntp_parser.tab.c") if not ctx.env.NTPSEC_RELEASE else "ntp_parser.tab.c"
+ ctx.bldnode.parent.find_node("host/ntpd/ntp_parser.tab.c")
]
# XXX: This really sucks, we need to get rid of all these refclock
=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -16,7 +16,6 @@ def cmd_configure(ctx, config):
from wafhelpers.util import parse_version
parse_version(config)
- ctx.env.NTPSEC_RELEASE = config["NTPSEC_RELEASE"]
ctx.env.NTPSEC_VERSION_MAJOR = config["NTPSEC_VERSION_MAJOR"]
ctx.env.NTPSEC_VERSION_MINOR = config["NTPSEC_VERSION_MINOR"]
ctx.env.NTPSEC_VERSION_REV = config["NTPSEC_VERSION_REV"]
@@ -49,9 +48,7 @@ def cmd_configure(ctx, config):
ctx.setenv('host', ctx.env.derive())
ctx.load('compiler_c')
-
- if not ctx.env.NTPSEC_RELEASE:
- ctx.load('bison')
+ ctx.load('bison')
for opt in opt_map:
ctx.env[opt] = opt_map[opt]
=====================================
wafhelpers/dist.py deleted
=====================================
--- a/wafhelpers/dist.py
+++ /dev/null
@@ -1,70 +0,0 @@
-from __future__ import print_function
-
-from os import path
-from shutil import copyfile
-from os.path import exists
-import time
-from wafhelpers.util import parse_version
-
-def dist_cmd(ctx, config):
- files_man = []
-
- parse_version(config)
-
- if not ctx.options.build_snapshot and not config["NTPSEC_RELEASE"]:
- ctx.fatal('Please supply --build-snapshot or set config["NTPSEC_RELEASE"] = True')
-
- if not config["NTPSEC_RELEASE"]:
- ctx.fatal('config["NTPSEC_RELEASE"] must be set to True')
-
- if exists("build/c4che/host_cache.py"):
- from waflib.ConfigSet import ConfigSet
- cset = ConfigSet()
- cset.load("build/c4che/host_cache.py")
- else:
- ctx.fatal("Please run 'waf configure' first.")
-
- rev = cset.NTPSEC_REVISION[:7]
- timestamp = time.strftime("%Y-%m-%d_%H%M%S")
-
- # XXX: Redo to not use globs.
- bldnode = ctx.path.make_node(config["out"])
- for section in [1, 5, 8]:
- files_man += bldnode.ant_glob("**/*.%d" % section)
-
- # Need a more reliable check.
- if not files_man:
- ctx.fatal("You must configure and build first with NTPSEC_RELEASE set to false")
-
- for man in files_man:
- src = man.abspath()
- dst = src.replace("%s/main/" % bldnode.abspath(), "")
- print("Copying %s -> %s" % (src, dst))
- copyfile(src, dst)
-
- files = [
- ("build/host/ntpd/ntp_parser.tab.c", "ntpd/ntp_parser.tab.c"),
- ("build/host/ntpd/ntp_parser.tab.h", "ntpd/ntp_parser.tab.h")
- ]
-
- for src, dst in files:
- if not path.exists(src):
- ctx.fatal("%s doesn't exist please configure and build first. NTPSEC_RELEASE must be set to False" % src)
- print("Copying %s -> %s" % (src, dst))
- copyfile(src, dst)
-
- version = "%d.%d.%d" % (config["NTPSEC_VERSION_MAJOR"], \
- config["NTPSEC_VERSION_MINOR"], \
- config["NTPSEC_VERSION_REV"])
-
- if ctx.options.build_snapshot:
- ctx.base_name = "ntpsec-%s-%s-%s-snap" % (timestamp, version, rev)
- else:
- ctx.base_name = "ntpsec-%s" % version
-
- if ctx.options.build_version_tag:
- ctx.base_name = "%s-%s" % (ctx.base_name, ctx.options.build_version_tag)
-
- if ctx.options.build_snapshot:
- with open("VERSION", "w") as fp:
- fp.write("%s %s %s\n" % (version, timestamp, rev))
=====================================
wafhelpers/waf.py
=====================================
--- a/wafhelpers/waf.py
+++ b/wafhelpers/waf.py
@@ -66,9 +66,7 @@ def manpage(ctx, section, source):
if not manprefix.endswith("/"):
manprefix += "/"
- if ctx.env.NTPSEC_RELEASE:
- ctx.install_files(manprefix + "man%s/" % section, source.replace("-man.txt", ".%s" % section))
- return
+ #ctx.install_files(manprefix + "man%s/" % section, source.replace("-man.txt", ".%s" % section))
if not ctx.env.ENABLE_DOC or ctx.env.DISABLE_MANPAGE:
return
=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -15,21 +15,10 @@ from wafhelpers.test import test_write_log, test_print_log
from wafhelpers.options import options_cmd
config = {
- "NTPSEC_RELEASE": False,
"out": out,
"OPT_STORE": {}
}
-# Release procedure:
-# 1. waf configure
-# 2. waf build
-# 3. Edit wscript and set NTPSEC_RELEASE to True
-# 4. waf dist
-
-# Snapshot procedure:
-# Steps 1-3 as above.
-# 4. waf dist --build-snapshot
-
def help(ctx):
"Be helpful, give a usage"
print('''
@@ -41,10 +30,6 @@ Usage: waf <command>
''')
-def dist(ctx):
- from wafhelpers.dist import dist_cmd
- dist_cmd(ctx, config)
-
def options(ctx):
options_cmd(ctx, config)
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/18a0a88c3eadc83edb198b1ef1e5927d9e3f2c56...66ad001ed60d5e9edccf46f60fde63197f939567
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161204/124b1421/attachment.html>
More information about the vc
mailing list