gen: conf proto.h man
gensend: gen
- rsync -aivzc $(GENFILES) $${SAMBA_HOST-samba.org}:/home/ftp/pub/rsync/generated-files/
+ rsync -aic $(GENFILES) $${SAMBA_HOST-samba.org}:/home/ftp/pub/rsync/generated-files/
conf:
cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
man: rsync.1 rsync-ssl.1 rsyncd.conf.5
-rsync.1: rsync.1.md md2man latest-year.h Makefile
+rsync.1: rsync.1.md md2man NEWS.md Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsync.1.md
-rsync-ssl.1: rsync-ssl.1.md md2man latest-year.h Makefile
+rsync-ssl.1: rsync-ssl.1.md md2man NEWS.md Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsync-ssl.1.md
-rsyncd.conf.5: rsyncd.conf.5.md md2man latest-year.h Makefile
+rsyncd.conf.5: rsyncd.conf.5.md md2man NEWS.md Makefile
@$(srcdir)/maybe-make-man $(srcdir) rsyncd.conf.5.md
clean: cleantests
#
# This program is freely redistributable.
-import sys, os, re, argparse, time
+import sys, os, re, argparse, subprocess, time
from html.parser import HTMLParser
CONSUMES_TXT = set('h1 h2 p li pre'.split())
fi.srcdir = './'
fi.title = fi.prog + '(' + fi.sect + ') man page'
- fi.date = None
+ fi.mtime = None
- chk_files = 'latest-year.h Makefile'.split()
+ if os.path.lexists(fi.srcdir + '.git'):
+ fi.mtime = int(subprocess.check_output('git log -1 --format=%at'.split()))
+
+ chk_files = 'NEWS.md Makefile'.split()
for fn in chk_files:
try:
st = os.lstat(fi.srcdir + fn)
except:
die('Failed to find', fi.srcdir + fn)
- if not fi.date:
- fi.date = time.strftime('%d %b %Y', time.localtime(st.st_mtime))
+ if not fi.mtime:
+ fi.mtime = st.st_mtime
+
+ fi.date = time.strftime('%d %b %Y', time.localtime(fi.mtime))
env_subs = { }
if not os.path.exists('rsyncd.conf.5.md'):
die("There is no rsync checkout in the current directory.")
+ mandate_gensend_hook()
+
if args.make_tar:
check_git_state('master')
- cmd_chk(['touch', 'latest-year.h'])
+ cmd_chk(['touch', 'NEWS.md'])
cmd_chk(['make', gen_target])
cmd_chk(['rsync', '-a', *glob.glob('*.[1-9].html'), dest])
return branches
+def mandate_gensend_hook():
+ hook = '.git/hooks/pre-push'
+ if not os.path.exists(hook):
+ print('Creating hook file:', hook)
+ cmd_chk(['./rsync', '-a', 'packaging/pre-push', hook])
+ else:
+ out, rc = cmd_txt_status(['fgrep', 'make gensend', hook], discard='output')
+ if rc:
+ die('Please add a "make gensend" into your', hook, 'script.')
+
+
# Snag the GENFILES values out of the Makefile.in file and return them as a list.
def get_extra_files():
cont_re = re.compile(r'\\\n')
--- /dev/null
+#!/bin/sh
+cat >/dev/null # Just discard stdin data
+make gensend
dest = os.environ['HOME'] + '/samba-rsync-ftp'
ORIGINAL_PATH = os.environ['PATH']
-MAKE_GEN_CMDS = [
- 'make -f prepare-source.mak conf'.split(),
- './config.status'.split(),
- 'make gen'.split(),
- ]
def main():
now = datetime.now()
ztoday = now.strftime('%d %b %Y')
today = ztoday.lstrip('0')
+ mandate_gensend_hook()
+
curdir = os.getcwd()
signal.signal(signal.SIGINT, signal_handler)
- tweak the version in configure.ac and the spec files
- tweak NEWS.md and OLDNEWS.md to ensure header values are correct
- generate configure.sh, config.h.in, and proto.h
- - touch the latest-year.h file and generate the manpages
- page through the differences
""")
ans = input("<Press Enter to continue> ")
fh.write(txt)
cmd_chk(['packaging/year-tweak'])
- cmd_chk([touch, 'latest-year.h']) # This file's date is put in the generated manpages.
- cmd_chk(['make', 'reconfigure'])
- cmd_chk(['make', 'man'])
print(dash_line)
cmd_run("git diff --color | less -p '^diff .*'")
{dash_line}
About to:
- - commit all version changes
+ - git commit all changes
+ - generate the manpages
- merge the {args.master_branch} branch into the patch/{args.master_branch}/* branches
- update the files in the "patches" dir and OPTIONALLY
(if you type 'y') to launch a shell for each patch
if s.returncode:
die('Aborting')
+ cmd_chk(['make', 'reconfigure'])
+ cmd_chk(['make', 'gen'])
+
print(f'Creating any missing patch branches.')
s = cmd_run(f'packaging/branch-from-patch --branch={args.master_branch} --add-missing')
if s.returncode:
os.rename(rsync_lastver, 'a')
print(f"Creating {diff_file} ...")
- for cmd in MAKE_GEN_CMDS:
- cmd_chk(cmd)
cmd_chk(['rsync', '-a', *extra_files, 'b/'])
sed_script = r's:^((---|\+\+\+) [ab]/[^\t]+)\t.*:\1:' # CAUTION: must not contain any single quotes!