The branch, master has been updated via b5e539fc Use documentation to extract 2 more .h lists from 88c18ef6 Make the g++ check more lenient.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit b5e539fc5aa52b94608dbb976981930c03213a78 Author: Wayne Davison <wa...@opencoder.net> Date: Thu Jun 18 10:49:34 2020 -0700 Use documentation to extract 2 more .h lists - Change default_cvsignore char[] into a define. - Make the DEFAULT_DONT_COMPRESS and DEFAULT_CVSIGNORE defines get set based on their info in rsync.1.md. - Add a few more don't-compress suffixes from Simon Matter. ----------------------------------------------------------------------- Summary of changes: .gitignore | 2 ++ Makefile.in | 7 ++++++- define-from-md.awk | 41 +++++++++++++++++++++++++++++++++++++++++ exclude.c | 13 ++----------- help-from-md.awk | 8 ++++---- loadparm.c | 6 +----- rsync.1.md | 32 ++++++++++++++++++++++++++++++++ 7 files changed, 88 insertions(+), 21 deletions(-) create mode 100755 define-from-md.awk Changeset truncated at 500 lines: diff --git a/.gitignore b/.gitignore index 00613f45..70061765 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ aclocal.m4 /rsync*.5 /rsync*.html /help-rsync*.h +/default-cvsignore.h +/default-dont-compress.h /.md2man-works /autom4te*.cache /confdefs.h diff --git a/Makefile.in b/Makefile.in index d2329cef..91d9d4a9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,11 +100,16 @@ rsync$(EXEEXT): $(OBJS) $(OBJS): $(HEADERS) $(CHECK_OBJS): $(HEADERS) options.o: latest-year.h help-rsync.h help-rsyncd.h +exclude.o: default-cvsignore.h +loadparm.o: default-dont-compress.h flist.o: rounding.h +default-cvsignore.h default-dont-compress.h: rsync.1.md define-from-md.awk + awk -f $(srcdir)/define-from-md.awk -v hfile=$@ $(srcdir)/rsync.1.md + help-rsync.h help-rsyncd.h: rsync.1.md help-from-md.awk - awk -f $(srcdir)/help-from-md.awk -v helpfile=$@ $(srcdir)/rsync.1.md + awk -f $(srcdir)/help-from-md.awk -v hfile=$@ $(srcdir)/rsync.1.md rounding.h: rounding.c rsync.h proto.h @for r in 0 1 3; do \ diff --git a/define-from-md.awk b/define-from-md.awk new file mode 100755 index 00000000..9f7f2bf3 --- /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 + } +} diff --git a/exclude.c b/exclude.c index d3122b57..df56e802 100644 --- a/exclude.c +++ b/exclude.c @@ -21,6 +21,7 @@ */ #include "rsync.h" +#include "default-cvsignore.h" extern int am_server; extern int am_sender; @@ -1051,16 +1052,6 @@ static filter_rule *parse_rule_tok(const char **rulestr_ptr, return rule; } -static char default_cvsignore[] = - /* These default ignored items come from the CVS manual. */ - "RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS" - " .make.state .nse_depinfo *~ #* .#* ,* _$* *$" - " *.old *.bak *.BAK *.orig *.rej .del-*" - " *.a *.olb *.o *.obj *.so *.exe" - " *.Z *.elc *.ln core" - /* The rest we added to suit ourself. */ - " .svn/ .git/ .hg/ .bzr/"; - static void get_cvs_excludes(uint32 rflags) { static int initialized = 0; @@ -1070,7 +1061,7 @@ static void get_cvs_excludes(uint32 rflags) return; initialized = 1; - parse_filter_str(&cvs_filter_list, default_cvsignore, + parse_filter_str(&cvs_filter_list, DEFAULT_CVSIGNORE, rule_template(rflags | (protocol_version >= 30 ? FILTRULE_PERISHABLE : 0)), 0); diff --git a/help-from-md.awk b/help-from-md.awk index ca358c89..19007974 100755 --- a/help-from-md.awk +++ b/help-from-md.awk @@ -1,10 +1,10 @@ #!/usr/bin/awk -f -# The caller must set -v helpfile=help-NAME.h and pass arg NAME.NUM.md +# The caller must pass args: -v hfile=help-NAME.h NAME.NUM.md BEGIN { heading = "/* DO NOT EDIT THIS FILE! It is auto-generated from the option list in " ARGV[1] "! */" - findcomment = helpfile + findcomment = hfile sub("\\.", "\\.", findcomment) findcomment = "\\[comment\\].*" findcomment backtick_cnt = 0 @@ -32,9 +32,9 @@ $0 ~ findcomment { END { if (foundcomment && backtick_cnt > 1) - print heading "\n" prints > helpfile + print heading "\n" prints > hfile else { - print "Failed to find " helpfile " section in " ARGV[1] + print "Failed to find " hfile " section in " ARGV[1] exit 1 } } diff --git a/loadparm.c b/loadparm.c index 58c898e8..dfc0b077 100644 --- a/loadparm.c +++ b/loadparm.c @@ -42,6 +42,7 @@ #include "rsync.h" #include "itypes.h" +#include "default-dont-compress.h" extern item_list dparam_list; @@ -52,11 +53,6 @@ extern item_list dparam_list; #define LOG_DAEMON 0 #endif -#define DEFAULT_DONT_COMPRESS "*.gz *.zip *.z *.rpm *.deb *.iso *.bz2" \ - " *.t[gb]z *.7z *.mp[34] *.mov *.avi *.ogg *.jpg *.jpeg *.png" \ - " *.lzo *.rzip *.lzma *.rar *.ace *.gpg *.xz *.txz *.lz *.tlz" \ - " *.ogv *.web[mp] *.squashfs" - /* the following are used by loadparm for option lists */ typedef enum { P_BOOL, P_BOOLREV, P_CHAR, P_INTEGER, diff --git a/rsync.1.md b/rsync.1.md index 01277e4d..d09578ca 100644 --- a/rsync.1.md +++ b/rsync.1.md @@ -1852,6 +1852,8 @@ your home directory (remove the '=' for that). The exclude list is initialized to exclude the following items (these initial items are marked as perishable -- see the FILTER RULES section): +[comment]: # (This list gets used for the default-cvsignore.h file.) + > `RCS` > `SCCS` > `CVS` @@ -2335,38 +2337,68 @@ your home directory (remove the '=' for that). The default file suffixes in the skip-compress list in this version of rsync are: +[comment]: # (This list gets used for the default-dont-compress.h file.) + > 7z > ace + > apk > avi > bz2 > deb + > flac > gpg > gz > iso + > jar > jpeg > jpg > lz + > lz4 > lzma > lzo + > mkv > mov > mp3 > mp4 + > odb + > odf + > odg + > odi + > odm + > odp + > ods + > odt > ogg > ogv + > opus + > otg + > oth + > otp + > ots + > ott + > oxt > png > rar > rpm + > rz > rzip > squashfs + > sxc + > sxd + > sxg + > sxm + > sxw > tbz > tgz > tlz > txz + > tzo > webm > webp > xz > z > zip + > zst This list will be replaced by your `--skip-compress` list in all but one situation: a copy from a daemon rsync will add your skipped suffixes to its -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs