The branch, master has been updated via 9dea2ae8 Make use of the new RSYNC_PORT env var. via 795268bb Replace mkproto.pl with mkproto.awk from 70cbc66b Set RSYNC_PORT in the env for a daemon-over-rsh connection. Fixes bug #14163.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 9dea2ae87cd2da25e4f39864808c8f6aeb98086a Author: Wayne Davison <way...@samba.org> Date: Tue Apr 7 13:29:29 2020 -0700 Make use of the new RSYNC_PORT env var. commit 795268bb7cf5c077320243d7f037836adf19aa41 Author: Ethan Sommer via rsync <rs...@lists.samba.org> Date: Tue Apr 7 13:01:45 2020 -0700 Replace mkproto.pl with mkproto.awk This replaces the build dependency on perl with one on awk which is already used throughout the build system and is much more ubiquitous than perl. ----------------------------------------------------------------------- Summary of changes: Makefile.in | 2 +- mkproto.awk | 39 +++++++++++++++++++++++++++++++++++++++ mkproto.pl | 48 ------------------------------------------------ stunnel-rsync.in | 9 +++++++-- 4 files changed, 47 insertions(+), 51 deletions(-) create mode 100644 mkproto.awk delete mode 100644 mkproto.pl Changeset truncated at 500 lines: diff --git a/Makefile.in b/Makefile.in index f912f312..d7ddbc41 100644 --- a/Makefile.in +++ b/Makefile.in @@ -210,7 +210,7 @@ proto.h: proto.h-tstamp @if test -f proto.h; then :; else cp -p $(srcdir)/proto.h .; fi proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c config.h - perl $(srcdir)/mkproto.pl $(srcdir)/*.c $(srcdir)/lib/compat.c + awk -f $(srcdir)/mkproto.awk $(srcdir)/*.c $(srcdir)/lib/compat.c man: rsync.1 rsyncd.conf.5 man-copy diff --git a/mkproto.awk b/mkproto.awk new file mode 100644 index 00000000..ab97d54f --- /dev/null +++ b/mkproto.awk @@ -0,0 +1,39 @@ +#!/usr/bin/awk -f + +BEGIN { + while ((getline i < "proto.h") > 0) old_protos = old_protos ? old_protos "\n" i : i + protos = "/* This file is automatically generated with \"make proto\". DO NOT EDIT */\n" +} + +inheader { + protos = protos "\n" ((inheader = /\)[ \t]*$/ ? 0 : 1) ? $0 : $0 ";") + next +} + +/^FN_(LOCAL|GLOBAL)_[^(]+\([^,()]+/ { + local = /^FN_LOCAL/ + gsub(/^FN_(LOC|GLOB)AL_|,.*$/, "") + sub(/^BOOL\(/, "BOOL ") + sub(/^CHAR\(/, "char ") + sub(/^INTEGER\(/, "int ") + sub(/^STRING\(/, "char *") + protos = protos "\n" $0 (local ? "(int module_id);" : "(void);") + next +} + +/^static|^extern|;/||!/^[A-Za-z][A-Za-z0-9_]* / { next } + +/\(.*\)[ \t]*$/ { + protos = protos "\n" $0 ";" + next +} + +/\(/ { + inheader = 1 + protos = protos "\n" $0 +} + +END { + if (old_protos != protos) print protos > "proto.h" + printf "" > "proto.h-tstamp" +} diff --git a/mkproto.pl b/mkproto.pl deleted file mode 100644 index cdeb2ea3..00000000 --- a/mkproto.pl +++ /dev/null @@ -1,48 +0,0 @@ -# generate prototypes for rsync - -$old_protos = ''; -if (open(IN, 'proto.h')) { - $old_protos = join('', <IN>); - close IN; -} - -%FN_MAP = ( - BOOL => 'BOOL ', - CHAR => 'char ', - INTEGER => 'int ', - STRING => 'char *', -); - -$inheader = 0; -$protos = qq|/* This file is automatically generated with "make proto". DO NOT EDIT */\n\n|; - -while (<>) { - if ($inheader) { - if (/[)][ \t]*$/) { - $inheader = 0; - s/$/;/; - } - $protos .= $_; - } elsif (/^FN_(LOCAL|GLOBAL)_([^(]+)\(([^,()]+)/) { - $ret = $FN_MAP{$2}; - $func = $3; - $arg = $1 eq 'LOCAL' ? 'int module_id' : 'void'; - $protos .= "$ret$func($arg);\n"; - } elsif (/^static|^extern/ || /[;]/ || !/^[A-Za-z][A-Za-z0-9_]* /) { - ; - } elsif (/[(].*[)][ \t]*$/) { - s/$/;/; - $protos .= $_; - } elsif (/[(]/) { - $inheader = 1; - $protos .= $_; - } -} - -if ($old_protos ne $protos) { - open(OUT, '>proto.h') or die $!; - print OUT $protos; - close OUT; -} - -open(OUT, '>proto.h-tstamp') and close OUT; diff --git a/stunnel-rsync.in b/stunnel-rsync.in index fdd8bfd1..ca702ae9 100755 --- a/stunnel-rsync.in +++ b/stunnel-rsync.in @@ -16,14 +16,19 @@ if [ x"$RSYNC_SSL_CERT" = x ]; then else cert="cert = $RSYNC_SSL_CERT" fi -if [ x"$RSYNC_SSL_CA_CERT" ]; then + +if [ x"$RSYNC_SSL_CA_CERT" = x ]; then cafile="" verify=0 else cafile="CAfile = $RSYNC_SSL_CA_CERT" verify=3 fi -port=${RSYNC_SSL_PORT:-874} + +port="${RSYNC_PORT:-0}" +if [ "$port" = 0 ]; then + port="${RSYNC_SSL_PORT:-874}" +fi # If the user specified USER@HOSTNAME::module, then rsync passes us # the -l USER option too, so we must be prepared to ignore it. -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs