summaryrefslogtreecommitdiffstats
path: root/support/cvs2includes
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:14:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:14:31 +0000
commit2d5707c7479eacb3b1ad98e01b53f56a88f8fb78 (patch)
treed9c334e83692851c02e3e1b8e65570c97bc82481 /support/cvs2includes
parentInitial commit. (diff)
downloadrsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.tar.xz
rsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.zip
Adding upstream version 3.2.7.upstream/3.2.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'support/cvs2includes')
-rwxr-xr-xsupport/cvs2includes42
1 files changed, 42 insertions, 0 deletions
diff --git a/support/cvs2includes b/support/cvs2includes
new file mode 100755
index 0000000..fc7f78f
--- /dev/null
+++ b/support/cvs2includes
@@ -0,0 +1,42 @@
+#!/usr/bin/env perl
+#
+# This script finds all CVS/Entries files in the current directory and below
+# and creates a local .cvsinclude file with non-inherited rules including each
+# checked-in file. Then, use this option whenever using --cvs-exclude (-C):
+#
+# -f ': .cvsinclude'
+#
+# That ensures that all checked-in files/dirs are included in the transfer.
+# (You could alternately put ": .cvsinclude" into an .rsync-filter file and
+# use the -F option, which is easier to type.)
+#
+# The downside is that you need to remember to re-run cvs2includes whenever
+# you add a new file to the project.
+use strict;
+
+open(FIND, 'find . -name CVS -type d |') or die $!;
+while (<FIND>) {
+ chomp;
+ s#^\./##;
+
+ my $entries = "$_/Entries";
+ s/CVS$/.cvsinclude/;
+ my $filter = $_;
+
+ open(ENTRIES, $entries) or die "Unable to open $entries: $!\n";
+ my @includes;
+ while (<ENTRIES>) {
+ push(@includes, $1) if m#/(.+?)/#;
+ }
+ close ENTRIES;
+ if (@includes) {
+ open(FILTER, ">$filter") or die "Unable to write $filter: $!\n";
+ print FILTER map "+ /$_\n", @includes;
+ close FILTER;
+ print "Updated $filter\n";
+ } elsif (-f $filter) {
+ unlink($filter);
+ print "Removed $filter\n";
+ }
+}
+close FIND;