mirror of
https://github.com/borgbackup/borg.git
synced 2024-09-11 04:25:26 +03:00
Merge pull request #6460 from ThomasWaldmann/move-checksums
remove algorithms package, move checksums module to borg package
This commit is contained in:
commit
cb0e4fc2b2
4
setup.py
4
setup.py
@ -94,7 +94,7 @@
|
|||||||
chunker_source = 'src/borg/chunker.pyx'
|
chunker_source = 'src/borg/chunker.pyx'
|
||||||
hashindex_source = 'src/borg/hashindex.pyx'
|
hashindex_source = 'src/borg/hashindex.pyx'
|
||||||
item_source = 'src/borg/item.pyx'
|
item_source = 'src/borg/item.pyx'
|
||||||
checksums_source = 'src/borg/algorithms/checksums.pyx'
|
checksums_source = 'src/borg/checksums.pyx'
|
||||||
platform_posix_source = 'src/borg/platform/posix.pyx'
|
platform_posix_source = 'src/borg/platform/posix.pyx'
|
||||||
platform_linux_source = 'src/borg/platform/linux.pyx'
|
platform_linux_source = 'src/borg/platform/linux.pyx'
|
||||||
platform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx'
|
platform_syncfilerange_source = 'src/borg/platform/syncfilerange.pyx'
|
||||||
@ -207,7 +207,7 @@ def members_appended(*ds):
|
|||||||
Extension('borg.hashindex', [hashindex_source], extra_compile_args=cflags),
|
Extension('borg.hashindex', [hashindex_source], extra_compile_args=cflags),
|
||||||
Extension('borg.item', [item_source], extra_compile_args=cflags),
|
Extension('borg.item', [item_source], extra_compile_args=cflags),
|
||||||
Extension('borg.chunker', [chunker_source], extra_compile_args=cflags),
|
Extension('borg.chunker', [chunker_source], extra_compile_args=cflags),
|
||||||
Extension('borg.algorithms.checksums', **checksums_ext_kwargs),
|
Extension('borg.checksums', **checksums_ext_kwargs),
|
||||||
]
|
]
|
||||||
|
|
||||||
posix_ext = Extension('borg.platform.posix', [platform_posix_source], extra_compile_args=cflags)
|
posix_ext = Extension('borg.platform.posix', [platform_posix_source], extra_compile_args=cflags)
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
"""
|
|
||||||
borg.algorithms
|
|
||||||
===============
|
|
||||||
|
|
||||||
This package is intended for hash and checksum functions.
|
|
||||||
"""
|
|
@ -36,7 +36,7 @@
|
|||||||
import borg
|
import borg
|
||||||
from . import __version__
|
from . import __version__
|
||||||
from . import helpers
|
from . import helpers
|
||||||
from .algorithms.checksums import crc32
|
from .checksums import crc32
|
||||||
from .archive import Archive, ArchiveChecker, ArchiveRecreater, Statistics, is_special
|
from .archive import Archive, ArchiveChecker, ArchiveRecreater, Statistics, is_special
|
||||||
from .archive import BackupError, BackupOSError, backup_io, OsOpen, stat_update_check
|
from .archive import BackupError, BackupOSError, backup_io, OsOpen, stat_update_check
|
||||||
from .archive import FilesystemObjectProcessors, TarfileObjectProcessors, MetadataCollector, ChunksProcessor
|
from .archive import FilesystemObjectProcessors, TarfileObjectProcessors, MetadataCollector, ChunksProcessor
|
||||||
@ -563,7 +563,7 @@ def chunkit(chunker_name, *args, **kwargs):
|
|||||||
print(f"{spec:<24} {size:<10} {timeit(func, number=100):.3f}s")
|
print(f"{spec:<24} {size:<10} {timeit(func, number=100):.3f}s")
|
||||||
|
|
||||||
import zlib
|
import zlib
|
||||||
from borg.algorithms.checksums import crc32, deflate_crc32, xxh64
|
from borg.checksums import crc32, deflate_crc32, xxh64
|
||||||
print("Non-cryptographic checksums / hashes ===========================")
|
print("Non-cryptographic checksums / hashes ===========================")
|
||||||
size = "1GB"
|
size = "1GB"
|
||||||
tests = [
|
tests = [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
from ..platformflags import is_darwin
|
from .platformflags import is_darwin
|
||||||
from ..helpers import bin_to_hex
|
from .helpers import bin_to_hex
|
||||||
|
|
||||||
from libc.stdint cimport uint32_t
|
from libc.stdint cimport uint32_t
|
||||||
from cpython.buffer cimport PyBUF_SIMPLE, PyObject_GetBuffer, PyBuffer_Release
|
from cpython.buffer cimport PyBUF_SIMPLE, PyObject_GetBuffer, PyBuffer_Release
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
from ..helpers import IntegrityError
|
from ..helpers import IntegrityError
|
||||||
from ..logger import create_logger
|
from ..logger import create_logger
|
||||||
from ..algorithms.checksums import StreamingXXH64
|
from ..checksums import StreamingXXH64
|
||||||
|
|
||||||
logger = create_logger()
|
logger = create_logger()
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ def format_needs_cache(cls, format):
|
|||||||
return any(key in cls.KEYS_REQUIRING_CACHE for key in format_keys)
|
return any(key in cls.KEYS_REQUIRING_CACHE for key in format_keys)
|
||||||
|
|
||||||
def __init__(self, archive, format, *, json_lines=False):
|
def __init__(self, archive, format, *, json_lines=False):
|
||||||
from ..algorithms.checksums import StreamingXXH64
|
from ..checksums import StreamingXXH64
|
||||||
self.xxh64 = StreamingXXH64
|
self.xxh64 = StreamingXXH64
|
||||||
self.archive = archive
|
self.archive = archive
|
||||||
self.json_lines = json_lines
|
self.json_lines = json_lines
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
from .helpers import msgpack
|
from .helpers import msgpack
|
||||||
from .repository import Repository
|
from .repository import Repository
|
||||||
from .version import parse_version, format_version
|
from .version import parse_version, format_version
|
||||||
from .algorithms.checksums import xxh64
|
from .checksums import xxh64
|
||||||
from .helpers.datastruct import EfficientCollectionQueue
|
from .helpers.datastruct import EfficientCollectionQueue
|
||||||
|
|
||||||
logger = create_logger(__name__)
|
logger = create_logger(__name__)
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from .logger import create_logger
|
from .logger import create_logger
|
||||||
from .lrucache import LRUCache
|
from .lrucache import LRUCache
|
||||||
from .platform import SaveFile, SyncFile, sync_dir, safe_fadvise
|
from .platform import SaveFile, SyncFile, sync_dir, safe_fadvise
|
||||||
from .algorithms.checksums import crc32
|
from .checksums import crc32
|
||||||
from .crypto.file_integrity import IntegrityCheckedFile, FileIntegrityError
|
from .crypto.file_integrity import IntegrityCheckedFile, FileIntegrityError
|
||||||
|
|
||||||
logger = create_logger(__name__)
|
logger = create_logger(__name__)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from ..algorithms import checksums
|
from .. import checksums
|
||||||
from ..helpers import bin_to_hex
|
from ..helpers import bin_to_hex
|
||||||
|
|
||||||
crc32_implementations = [checksums.deflate_crc32]
|
crc32_implementations = [checksums.deflate_crc32]
|
||||||
|
Loading…
Reference in New Issue
Block a user