- 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.
/rsync*.5
/rsync*.html
/help-rsync*.h
+/default-cvsignore.h
+/default-dont-compress.h
/.md2man-works
/autom4te*.cache
/confdefs.h
$(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 \
--- /dev/null
+#!/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
+ }
+}
*/
#include "rsync.h"
+#include "default-cvsignore.h"
extern int am_server;
extern int am_sender;
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;
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);
#!/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
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
}
}
#include "rsync.h"
#include "itypes.h"
+#include "default-dont-compress.h"
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,
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`
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