Generate manpages; commit that; improve error output in sh_log.

This commit is contained in:
Nathan Wilcox 2017-05-19 18:03:28 -07:00
parent 785244020a
commit c62edf9471
2 changed files with 22 additions and 19 deletions

View File

@ -31,14 +31,6 @@ Example:
$ ./zcutil/make-release.py v1.0.8-1 v1.0.9 $ ./zcutil/make-release.py v1.0.8-1 v1.0.9
Build by running `./zcutil/build.sh`.
Then perform the following command:
$ bash contrib/devtools/gen-manpages.sh
Commit the changes.
### B3. Generate release notes ### B3. Generate release notes
Run the release-notes.py script to generate release notes and update authors.md file. For example: Run the release-notes.py script to generate release notes and update authors.md file. For example:

View File

@ -42,16 +42,11 @@ def main_logged(release, releaseprev, releaseheight):
initialize_git(release) initialize_git(release)
patch_version_in_files(release, releaseprev) patch_version_in_files(release, releaseprev)
patch_release_height(releaseheight) patch_release_height(releaseheight)
commit('Versioning changes.')
logging.info('Committing version changes.')
sh_log(
'git',
'commit',
'--all',
'-m', 'make-release.py versioning changes.',
)
build() build()
gen_manpages()
commit('Updated manpages.')
raise NotImplementedError(main_logged) raise NotImplementedError(main_logged)
@ -158,7 +153,18 @@ def build():
sh_log('./zcutil/build.sh', '-j', nproc) sh_log('./zcutil/build.sh', '-j', nproc)
def gen_manpages():
logging.info('Generating manpages.')
sh_log('./contrib/devtools/gen-manpages.sh')
# Helper code: # Helper code:
def commit(message):
logging.info('Committing: %r', message)
fullmsg = 'make-release.py: {}'.format(message)
sh_log('git', 'commit', '--all', '-m', fullmsg)
def chdir_to_repo(repo): def chdir_to_repo(repo):
if repo is None: if repo is None:
dn = os.path.dirname dn = os.path.dirname
@ -258,9 +264,14 @@ def sh_out(*args):
def sh_log(*args): def sh_log(*args):
logging.debug('Run (log): %r', args) PIPE = subprocess.PIPE
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) try:
logging.debug('PID: %r', p.pid) p = subprocess.Popen(args, stdout=PIPE, stderr=PIPE)
except OSError:
logging.error('Error launching %r...', args)
raise
logging.debug('Run (log PID %r): %r', p.pid, args)
for line in p.stdout: for line in p.stdout:
logging.debug('> %s', line.rstrip()) logging.debug('> %s', line.rstrip())
status = p.wait() status = p.wait()