Modify the APPROX_RELEASE_HEIGHT.
This commit is contained in:
@@ -23,7 +23,11 @@ def main(args=sys.argv[1:]):
|
|||||||
logging.debug('argv %r parsed %r', sys.argv, opts)
|
logging.debug('argv %r parsed %r', sys.argv, opts)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
main_logged(opts.RELEASE_VERSION, opts.RELEASE_PREV)
|
main_logged(
|
||||||
|
opts.RELEASE_VERSION,
|
||||||
|
opts.RELEASE_PREV,
|
||||||
|
opts.RELEASE_HEIGHT,
|
||||||
|
)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
logging.error(str(e))
|
logging.error(str(e))
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
@@ -33,10 +37,11 @@ def main(args=sys.argv[1:]):
|
|||||||
|
|
||||||
|
|
||||||
# Top-level flow:
|
# Top-level flow:
|
||||||
def main_logged(release, releaseprev):
|
def main_logged(release, releaseprev, releaseheight):
|
||||||
verify_releaseprev_tag(releaseprev)
|
verify_releaseprev_tag(releaseprev)
|
||||||
initialize_git(release)
|
initialize_git(release)
|
||||||
patch_version_in_files(release, releaseprev)
|
patch_version_in_files(release, releaseprev)
|
||||||
|
patch_release_height(releaseheight)
|
||||||
|
|
||||||
raise NotImplementedError(main_logged)
|
raise NotImplementedError(main_logged)
|
||||||
|
|
||||||
@@ -59,6 +64,11 @@ def parse_args(args):
|
|||||||
type=Version.parse_arg,
|
type=Version.parse_arg,
|
||||||
help='The previously released version.',
|
help='The previously released version.',
|
||||||
)
|
)
|
||||||
|
p.add_argument(
|
||||||
|
'RELEASE_HEIGHT',
|
||||||
|
type=int,
|
||||||
|
help='A block height approximately occuring on release day.',
|
||||||
|
)
|
||||||
return p.parse_args(args)
|
return p.parse_args(args)
|
||||||
|
|
||||||
|
|
||||||
@@ -110,6 +120,27 @@ def patch_version_in_files(release, releaseprev):
|
|||||||
patch_README(release, releaseprev)
|
patch_README(release, releaseprev)
|
||||||
patch_clientversion_h(release)
|
patch_clientversion_h(release)
|
||||||
patch_configure_ac(release)
|
patch_configure_ac(release)
|
||||||
|
patch_gitian_linux_yml(release, releaseprev)
|
||||||
|
|
||||||
|
|
||||||
|
def patch_release_height(releaseheight):
|
||||||
|
rgx = re.compile(
|
||||||
|
r'^(static const int APPROX_RELEASE_HEIGHT = )\d+(;)$',
|
||||||
|
)
|
||||||
|
with PathPatcher('src/deprecation.h') as (inf, outf):
|
||||||
|
for line in inf:
|
||||||
|
m = rgx.match(line)
|
||||||
|
if m is None:
|
||||||
|
outf.write(line)
|
||||||
|
else:
|
||||||
|
[prefix, suffix] = m.groups()
|
||||||
|
outf.write(
|
||||||
|
'{}{}{}\n'.format(
|
||||||
|
prefix,
|
||||||
|
releaseheight,
|
||||||
|
suffix,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Helper code:
|
# Helper code:
|
||||||
@@ -148,6 +179,20 @@ def patch_configure_ac(release):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def patch_gitian_linux_yml(release, releaseprev):
|
||||||
|
path = 'contrib/gitian-descriptors/gitian-linux.yml'
|
||||||
|
with PathPatcher(path) as (inf, outf):
|
||||||
|
outf.write(inf.readline())
|
||||||
|
|
||||||
|
secondline = inf.readline()
|
||||||
|
assert secondline == 'name: "zcash-{}"\n'.format(
|
||||||
|
releaseprev.novtext
|
||||||
|
), repr(secondline)
|
||||||
|
|
||||||
|
outf.write('name: "zcash-{}"\n'.format(release.novtext))
|
||||||
|
outf.write(inf.read())
|
||||||
|
|
||||||
|
|
||||||
def _patch_build_defs(release, path, pattern):
|
def _patch_build_defs(release, path, pattern):
|
||||||
rgx = re.compile(pattern)
|
rgx = re.compile(pattern)
|
||||||
with PathPatcher(path) as (inf, outf):
|
with PathPatcher(path) as (inf, outf):
|
||||||
|
|||||||
Reference in New Issue
Block a user