From 2d5707c7479eacb3b1ad98e01b53f56a88f8fb78 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 18:14:31 +0200 Subject: Adding upstream version 3.2.7. Signed-off-by: Daniel Baumann --- define-from-md.awk | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 define-from-md.awk (limited to 'define-from-md.awk') diff --git a/define-from-md.awk b/define-from-md.awk new file mode 100755 index 0000000..9f7f2bf --- /dev/null +++ b/define-from-md.awk @@ -0,0 +1,41 @@ +#!/usr/bin/awk -f + +# The caller must pass args: -v hfile=NAME rsync.1.md + +BEGIN { + heading = "/* DO NOT EDIT THIS FILE! It is auto-generated from a list of values in " ARGV[1] "! */" + if (hfile ~ /compress/) { + define = "#define DEFAULT_DONT_COMPRESS" + prefix = "*." + } else { + define = "#define DEFAULT_CVSIGNORE" + prefix = "" + } + value_list = "" +} + +/^ > [^ ]+$/ { + gsub(/`/, "") + if (value_list != "") value_list = value_list " " + value_list = value_list prefix $2 + next +} + +value_list ~ /\.gz / && hfile ~ /compress/ { + exit +} + +value_list ~ /SCCS / && hfile ~ /cvsignore/ { + exit +} + +value_list = "" + +END { + if (value_list != "") + print heading "\n\n" define " \"" value_list "\"" > hfile + else { + print "Failed to find a value list in " ARGV[1] " for " hfile + exit 1 + } +} -- cgit v1.2.3