mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-11 06:33:39 +00:00
move chunker to borg.algorithms
This commit is contained in:
parent
390aa76c72
commit
956b50b29c
7 changed files with 12 additions and 10 deletions
6
setup.py
6
setup.py
|
@ -51,7 +51,7 @@ from setuptools.command.sdist import sdist
|
|||
|
||||
compress_source = 'src/borg/compress.pyx'
|
||||
crypto_source = 'src/borg/crypto.pyx'
|
||||
chunker_source = 'src/borg/chunker.pyx'
|
||||
chunker_source = 'src/borg/algorithms/chunker.pyx'
|
||||
hashindex_source = 'src/borg/hashindex.pyx'
|
||||
item_source = 'src/borg/item.pyx'
|
||||
crc32_source = 'src/borg/algorithms/crc32.pyx'
|
||||
|
@ -88,7 +88,7 @@ try:
|
|||
self.filelist.extend([
|
||||
'src/borg/compress.c',
|
||||
'src/borg/crypto.c',
|
||||
'src/borg/chunker.c', 'src/borg/_chunker.c',
|
||||
'src/borg/algorithms/chunker.c', 'src/borg/algorithms/buzhash.c',
|
||||
'src/borg/hashindex.c', 'src/borg/_hashindex.c',
|
||||
'src/borg/item.c',
|
||||
'src/borg/algorithms/crc32.c',
|
||||
|
@ -579,9 +579,9 @@ if not on_rtd:
|
|||
ext_modules += [
|
||||
Extension('borg.compress', [compress_source], libraries=['lz4'], include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
|
||||
Extension('borg.crypto', [crypto_source], libraries=crypto_libraries, include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
|
||||
Extension('borg.chunker', [chunker_source]),
|
||||
Extension('borg.hashindex', [hashindex_source]),
|
||||
Extension('borg.item', [item_source]),
|
||||
Extension('borg.algorithms.chunker', [chunker_source]),
|
||||
Extension('borg.algorithms.crc32', [crc32_source]),
|
||||
]
|
||||
if not sys.platform.startswith(('win32', )):
|
||||
|
|
0
src/borg/algorithms/__init__.py
Normal file
0
src/borg/algorithms/__init__.py
Normal file
|
@ -4,7 +4,7 @@ API_VERSION = '1.1_01'
|
|||
|
||||
from libc.stdlib cimport free
|
||||
|
||||
cdef extern from "_chunker.c":
|
||||
cdef extern from "buzhash.c":
|
||||
ctypedef int uint32_t
|
||||
ctypedef struct _Chunker "Chunker":
|
||||
pass
|
|
@ -16,11 +16,12 @@ from shutil import get_terminal_size
|
|||
import msgpack
|
||||
|
||||
from .logger import create_logger
|
||||
|
||||
logger = create_logger()
|
||||
|
||||
from . import xattr
|
||||
from .cache import ChunkListEntry
|
||||
from .chunker import Chunker
|
||||
from .algorithms.chunker import Chunker
|
||||
from .compress import Compressor, CompressionSpec
|
||||
from .constants import * # NOQA
|
||||
from .hashindex import ChunkIndex, ChunkIndexEntry
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import argparse
|
||||
import contextlib
|
||||
import collections
|
||||
import contextlib
|
||||
import grp
|
||||
import hashlib
|
||||
import logging
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import os.path
|
||||
import platform
|
||||
|
@ -25,20 +25,21 @@ from datetime import datetime, timezone, timedelta
|
|||
from functools import partial, lru_cache
|
||||
from itertools import islice
|
||||
from operator import attrgetter
|
||||
from string import Formatter
|
||||
from shutil import get_terminal_size
|
||||
from string import Formatter
|
||||
|
||||
import msgpack
|
||||
import msgpack.fallback
|
||||
|
||||
from .logger import create_logger
|
||||
|
||||
logger = create_logger()
|
||||
|
||||
from . import __version__ as borg_version
|
||||
from . import __version_tuple__ as borg_version_tuple
|
||||
from . import chunker
|
||||
from . import crypto
|
||||
from . import hashindex
|
||||
from .algorithms import chunker
|
||||
from .constants import * # NOQA
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from io import BytesIO
|
||||
|
||||
from ..chunker import Chunker, buzhash, buzhash_update
|
||||
from ..algorithms.chunker import Chunker, buzhash, buzhash_update
|
||||
from ..constants import * # NOQA
|
||||
from . import BaseTestCase
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue