1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 08:45:13 +00:00

borg extract: warn if a include pattern never matched, fixes #209

This commit is contained in:
Thomas Waldmann 2015-09-19 18:16:47 +02:00
parent 15b003e344
commit e0a08c5cae

View file

@ -21,7 +21,7 @@
from .cache import Cache
from .key import key_creator
from .helpers import Error, location_validator, format_time, format_file_size, \
format_file_mode, ExcludePattern, exclude_path, adjust_patterns, to_localtime, timestamp, \
format_file_mode, ExcludePattern, IncludePattern, exclude_path, adjust_patterns, to_localtime, timestamp, \
get_cache_dir, get_keys_dir, format_timedelta, prune_within, prune_split, \
Manifest, remove_surrogates, update_excludes, format_archive, check_extension_modules, Statistics, \
is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec
@ -286,6 +286,9 @@ def do_extract(self, args):
if not args.dry_run:
while dirs:
archive.extract_item(dirs.pop(-1))
for pattern in patterns:
if isinstance(pattern, IncludePattern) and pattern.match_count == 0:
self.print_error("Warning: Include pattern '%s' never matched.", pattern)
return self.exit_code
def do_rename(self, args):