Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(22)

Side by Side Diff: lib/Brackup/Config.pm

Issue 718: 'accept' option - a file or directory must match at least one of the accept regexps to be backed up SVN Base: http://brackup.googlecode.com/svn/trunk/
Patch Set: Created 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 package Brackup::Config; 1 package Brackup::Config;
2 2
3 use strict; 3 use strict;
4 use Brackup::ConfigSection; 4 use Brackup::ConfigSection;
5 use warnings; 5 use warnings;
6 use Carp qw(croak); 6 use Carp qw(croak);
7 use Fcntl qw(O_WRONLY O_CREAT O_EXCL); 7 use Fcntl qw(O_WRONLY O_CREAT O_EXCL);
8 8
9 sub new { 9 sub new {
10 my ($class) = @_; 10 my ($class) = @_;
(...skipping 102 matching lines...) Show 10 above Show 10 below
113 sub load_root { 113 sub load_root {
114 my ($self, $name, $cache) = @_; 114 my ($self, $name, $cache) = @_;
115 my $conf = $self->{"SOURCE:$name"} or 115 my $conf = $self->{"SOURCE:$name"} or
116 die "Unknown source '$name'\n"; 116 die "Unknown source '$name'\n";
117 117
118 my $root = Brackup::Root->new($conf, $cache); 118 my $root = Brackup::Root->new($conf, $cache);
119 119
120 # iterate over config's ignore, and add those 120 # iterate over config's ignore, and add those
121 foreach my $pat ($conf->values("ignore")) { 121 foreach my $pat ($conf->values("ignore")) {
122 $root->ignore($pat); 122 $root->ignore($pat);
123 }
124
125 foreach my $pat ($conf->values("accept")) {
126 $root->accept($pat);
123 } 127 }
124 128
125 # common things to ignore 129 # common things to ignore
126 $root->ignore(qr!~$!); 130 $root->ignore(qr!~$!);
127 $root->ignore(qr!^\.thumbnails/!); 131 $root->ignore(qr!^\.thumbnails/!);
128 $root->ignore(qr!^\.kde/share/thumbnails/!); 132 $root->ignore(qr!^\.kde/share/thumbnails/!);
129 $root->ignore(qr!^\.ee/minis/!); 133 $root->ignore(qr!^\.ee/minis/!);
130 $root->ignore(qr!^\.(gqview|nautilus)/thumbnails/!); 134 $root->ignore(qr!^\.(gqview|nautilus)/thumbnails/!);
131 135
132 # abort if the user had any configuration we didn't understand 136 # abort if the user had any configuration we didn't understand
(...skipping 39 matching lines...) Show 10 above Show 10 below
172 176
173 L<Brackup::Manual::Overview> 177 L<Brackup::Manual::Overview>
174 178
175 L<Brackup::Root> 179 L<Brackup::Root>
176 180
177 L<Brackup::Target> 181 L<Brackup::Target>
178 182
179 183
180 184
181 185
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r338