mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-07 20:02:36 +00:00
Move chunker module to chunkers package
Refactor by relocating the `chunker` module under a new `chunkers` package, adjusting imports and file references accordingly.
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ dist
|
||||
src/borg/compress.c
|
||||
src/borg/crypto/low_level.c
|
||||
src/borg/item.c
|
||||
src/borg/chunker.c
|
||||
src/borg/chunkers/chunker.c
|
||||
src/borg/checksums.c
|
||||
src/borg/platform/darwin.c
|
||||
src/borg/platform/freebsd.c
|
||||
|
||||
+1
-1
@@ -542,7 +542,7 @@ class BuildMan:
|
||||
cython_sources = """
|
||||
src/borg/compress.pyx
|
||||
src/borg/crypto/low_level.pyx
|
||||
src/borg/chunker.pyx
|
||||
src/borg/chunkers/chunker.pyx
|
||||
src/borg/hashindex.pyx
|
||||
src/borg/item.pyx
|
||||
src/borg/checksums.pyx
|
||||
|
||||
@@ -50,7 +50,7 @@ cflags = ["-Wall", "-Wextra", "-Wpointer-arith", "-Wno-unreachable-code-fallthro
|
||||
|
||||
compress_source = "src/borg/compress.pyx"
|
||||
crypto_ll_source = "src/borg/crypto/low_level.pyx"
|
||||
chunker_source = "src/borg/chunker.pyx"
|
||||
chunker_source = "src/borg/chunkers/chunker.pyx"
|
||||
hashindex_source = "src/borg/hashindex.pyx"
|
||||
item_source = "src/borg/item.pyx"
|
||||
checksums_source = "src/borg/checksums.pyx"
|
||||
@@ -182,7 +182,7 @@ if not on_rtd:
|
||||
Extension("borg.compress", **compress_ext_kwargs),
|
||||
Extension("borg.hashindex", [hashindex_source], extra_compile_args=cflags),
|
||||
Extension("borg.item", [item_source], extra_compile_args=cflags),
|
||||
Extension("borg.chunker", [chunker_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]),
|
||||
Extension("borg.chunkers.chunker", [chunker_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]),
|
||||
Extension("borg.checksums", **checksums_ext_kwargs),
|
||||
]
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ from .logger import create_logger
|
||||
logger = create_logger()
|
||||
|
||||
from . import xattr
|
||||
from .chunker import get_chunker, Chunk
|
||||
from .chunkers import get_chunker, Chunk
|
||||
from .cache import ChunkListEntry, build_chunkindex_from_repo, delete_chunkindex_cache
|
||||
from .crypto.key import key_factory, UnsupportedPayloadError
|
||||
from .compress import CompressionSpec
|
||||
|
||||
@@ -134,7 +134,7 @@ class BenchmarkMixIn:
|
||||
key_96 = os.urandom(12)
|
||||
|
||||
import io
|
||||
from ..chunker import get_chunker
|
||||
from ..chunkers import get_chunker
|
||||
|
||||
print("Chunkers =======================================================")
|
||||
size = "1GB"
|
||||
|
||||
@@ -2,7 +2,7 @@ import argparse
|
||||
|
||||
from ._common import with_repository, with_other_repository, Highlander
|
||||
from ..archive import Archive, cached_hash, DownloadPipeline
|
||||
from ..chunker import get_chunker
|
||||
from ..chunkers import get_chunker
|
||||
from ..compress import CompressionSpec
|
||||
from ..constants import * # NOQA
|
||||
from ..crypto.key import uses_same_id_hash, uses_same_chunker_secret
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from .chunker import * # noqa
|
||||
@@ -12,8 +12,8 @@ from libc.stdint cimport uint8_t, uint32_t
|
||||
from libc.stdlib cimport malloc, free
|
||||
from libc.string cimport memcpy, memmove
|
||||
|
||||
from .constants import CH_DATA, CH_ALLOC, CH_HOLE, zeros
|
||||
from .platform import safe_fadvise
|
||||
from ..constants import CH_DATA, CH_ALLOC, CH_HOLE, zeros
|
||||
from ..platform import safe_fadvise
|
||||
|
||||
# this will be True if Python's seek implementation supports data/holes seeking.
|
||||
# this does not imply that it will actually work on the filesystem,
|
||||
@@ -14,7 +14,8 @@ def check_python():
|
||||
|
||||
|
||||
def check_extension_modules():
|
||||
from .. import platform, compress, crypto, item, chunker, hashindex
|
||||
from .. import platform, compress, crypto, item, hashindex
|
||||
from ..chunkers import chunker
|
||||
|
||||
msg = """The Borg binary extension modules do not seem to be properly installed."""
|
||||
if hashindex.API_VERSION != "1.2_01":
|
||||
|
||||
@@ -7,7 +7,7 @@ from unittest.mock import patch
|
||||
import pytest
|
||||
|
||||
from ... import xattr
|
||||
from ...chunker import has_seek_hole
|
||||
from ...chunkers import has_seek_hole
|
||||
from ...constants import * # NOQA
|
||||
from ...helpers import EXIT_WARNING, BackupPermissionError, bin_to_hex
|
||||
from ...helpers import flags_noatime, flags_normal
|
||||
|
||||
@@ -5,7 +5,16 @@ import tempfile
|
||||
import pytest
|
||||
|
||||
from .chunker_test import cf
|
||||
from ..chunker import Chunker, ChunkerFixed, sparsemap, has_seek_hole, ChunkerFailing, FileReader, FileFMAPReader, Chunk
|
||||
from ..chunkers import (
|
||||
Chunker,
|
||||
ChunkerFixed,
|
||||
sparsemap,
|
||||
has_seek_hole,
|
||||
ChunkerFailing,
|
||||
FileReader,
|
||||
FileFMAPReader,
|
||||
Chunk,
|
||||
)
|
||||
from ..constants import * # NOQA
|
||||
|
||||
BS = 4096 # fs block size
|
||||
|
||||
@@ -2,7 +2,7 @@ from hashlib import sha256
|
||||
from io import BytesIO
|
||||
|
||||
from .chunker_test import cf
|
||||
from ..chunker import Chunker
|
||||
from ..chunkers import Chunker
|
||||
from ..constants import * # NOQA
|
||||
from ..helpers import hex_to_bin
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
from ..chunker import ChunkerFixed, Chunker, get_chunker, buzhash, buzhash_update
|
||||
from ..chunkers import ChunkerFixed, Chunker, get_chunker, buzhash, buzhash_update
|
||||
from ..constants import * # NOQA
|
||||
from . import BaseTestCase
|
||||
|
||||
|
||||
Reference in New Issue
Block a user