mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-03 18:27:01 +00:00
Merge pull request #2000 from enkore/issue/1997
check: fail if single archive does not exist
This commit is contained in:
commit
53aaee3519
2 changed files with 9 additions and 0 deletions
|
@ -1100,13 +1100,21 @@ def valid_item(obj):
|
|||
key=lambda name_info: name_info[1][b'time'])
|
||||
if prefix is not None:
|
||||
archive_items = [item for item in archive_items if item[0].startswith(prefix)]
|
||||
if not archive_items:
|
||||
logger.warning('--prefix %s does not match any archives', prefix)
|
||||
num_archives = len(archive_items)
|
||||
end = None if last is None else min(num_archives, last)
|
||||
if last is not None and end < last:
|
||||
logger.warning('--last %d archives: only found %d archives', last, end)
|
||||
else:
|
||||
# we only want one specific archive
|
||||
archive_items = [item for item in self.manifest.archives.items() if item[0] == archive]
|
||||
num_archives = 1
|
||||
end = 1
|
||||
if not archive_items:
|
||||
logger.error('Archive %s does not exist', archive)
|
||||
self.error_found = True
|
||||
return
|
||||
|
||||
with cache_if_remote(self.repository) as repository:
|
||||
for i, (name, info) in enumerate(archive_items[:end]):
|
||||
|
|
|
@ -138,6 +138,7 @@ Bug fixes:
|
|||
:ref:`the issue <tam_vuln>` is not relevant for unencrypted repositories,
|
||||
it now does nothing and prints an error, #1981.
|
||||
- Fixed change-passphrase crashing with unencrypted repositories, #1978
|
||||
- Fixed "borg check repo::archive" indicating success if "archive" does not exist, #1997
|
||||
|
||||
Other changes:
|
||||
|
||||
|
|
Loading…
Reference in a new issue