mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 09:59:19 -04:00
Merge pull request #7012 from ThomasWaldmann/separate-encrypted-metadata
2 more things...
This commit is contained in:
commit
c5352000a7
2 changed files with 6 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ from ._common import with_repository, with_other_repository
|
|||
from ..archive import Archive
|
||||
from ..constants import * # NOQA
|
||||
from ..crypto.key import uses_same_id_hash, uses_same_chunker_secret
|
||||
from ..helpers import EXIT_SUCCESS, EXIT_ERROR
|
||||
from ..helpers import EXIT_SUCCESS, EXIT_ERROR, Error
|
||||
from ..helpers import location_validator, Location
|
||||
from ..helpers import format_file_size
|
||||
from ..manifest import Manifest
|
||||
|
|
@ -47,6 +47,9 @@ class TransferMixIn:
|
|||
self.print_error(f"No such upgrader: {args.upgrader}")
|
||||
return EXIT_ERROR
|
||||
|
||||
if UpgraderCls is not upgrade_mod.UpgraderFrom12To20 and other_manifest.repository.version == 1:
|
||||
raise Error("To transfer from a borg 1.x repo, you need to use: --upgrader=From12To20")
|
||||
|
||||
upgrader = UpgraderCls(cache=cache)
|
||||
|
||||
for name in archive_names:
|
||||
|
|
|
|||
|
|
@ -123,8 +123,10 @@ class UpgraderFrom12To20:
|
|||
csize = borg1_header_fmt.unpack(csize_bytes)
|
||||
compressed = data[2 + hlen : 2 + hlen + csize]
|
||||
meta, compressed = upgrade_zlib_and_level(meta, compressed)
|
||||
meta["psize"] = csize
|
||||
osize = len(data) - 2 - hlen - csize # amount of 0x00 bytes appended for obfuscation
|
||||
data = compressed + bytes(osize)
|
||||
meta["csize"] = len(data)
|
||||
else:
|
||||
meta, data = upgrade_zlib_and_level(meta, data)
|
||||
return meta, data
|
||||
|
|
|
|||
Loading…
Reference in a new issue