mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-12 07:08:47 +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'
|
compress_source = 'src/borg/compress.pyx'
|
||||||
crypto_source = 'src/borg/crypto.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'
|
hashindex_source = 'src/borg/hashindex.pyx'
|
||||||
item_source = 'src/borg/item.pyx'
|
item_source = 'src/borg/item.pyx'
|
||||||
crc32_source = 'src/borg/algorithms/crc32.pyx'
|
crc32_source = 'src/borg/algorithms/crc32.pyx'
|
||||||
|
@ -88,7 +88,7 @@ try:
|
||||||
self.filelist.extend([
|
self.filelist.extend([
|
||||||
'src/borg/compress.c',
|
'src/borg/compress.c',
|
||||||
'src/borg/crypto.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/hashindex.c', 'src/borg/_hashindex.c',
|
||||||
'src/borg/item.c',
|
'src/borg/item.c',
|
||||||
'src/borg/algorithms/crc32.c',
|
'src/borg/algorithms/crc32.c',
|
||||||
|
@ -579,9 +579,9 @@ if not on_rtd:
|
||||||
ext_modules += [
|
ext_modules += [
|
||||||
Extension('borg.compress', [compress_source], libraries=['lz4'], include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
|
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.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.hashindex', [hashindex_source]),
|
||||||
Extension('borg.item', [item_source]),
|
Extension('borg.item', [item_source]),
|
||||||
|
Extension('borg.algorithms.chunker', [chunker_source]),
|
||||||
Extension('borg.algorithms.crc32', [crc32_source]),
|
Extension('borg.algorithms.crc32', [crc32_source]),
|
||||||
]
|
]
|
||||||
if not sys.platform.startswith(('win32', )):
|
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
|
from libc.stdlib cimport free
|
||||||
|
|
||||||
cdef extern from "_chunker.c":
|
cdef extern from "buzhash.c":
|
||||||
ctypedef int uint32_t
|
ctypedef int uint32_t
|
||||||
ctypedef struct _Chunker "Chunker":
|
ctypedef struct _Chunker "Chunker":
|
||||||
pass
|
pass
|
|
@ -16,11 +16,12 @@ from shutil import get_terminal_size
|
||||||
import msgpack
|
import msgpack
|
||||||
|
|
||||||
from .logger import create_logger
|
from .logger import create_logger
|
||||||
|
|
||||||
logger = create_logger()
|
logger = create_logger()
|
||||||
|
|
||||||
from . import xattr
|
from . import xattr
|
||||||
from .cache import ChunkListEntry
|
from .cache import ChunkListEntry
|
||||||
from .chunker import Chunker
|
from .algorithms.chunker import Chunker
|
||||||
from .compress import Compressor, CompressionSpec
|
from .compress import Compressor, CompressionSpec
|
||||||
from .constants import * # NOQA
|
from .constants import * # NOQA
|
||||||
from .hashindex import ChunkIndex, ChunkIndexEntry
|
from .hashindex import ChunkIndex, ChunkIndexEntry
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import argparse
|
import argparse
|
||||||
import contextlib
|
|
||||||
import collections
|
import collections
|
||||||
|
import contextlib
|
||||||
import grp
|
import grp
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
|
||||||
import io
|
import io
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import platform
|
import platform
|
||||||
|
@ -25,20 +25,21 @@ from datetime import datetime, timezone, timedelta
|
||||||
from functools import partial, lru_cache
|
from functools import partial, lru_cache
|
||||||
from itertools import islice
|
from itertools import islice
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
from string import Formatter
|
|
||||||
from shutil import get_terminal_size
|
from shutil import get_terminal_size
|
||||||
|
from string import Formatter
|
||||||
|
|
||||||
import msgpack
|
import msgpack
|
||||||
import msgpack.fallback
|
import msgpack.fallback
|
||||||
|
|
||||||
from .logger import create_logger
|
from .logger import create_logger
|
||||||
|
|
||||||
logger = create_logger()
|
logger = create_logger()
|
||||||
|
|
||||||
from . import __version__ as borg_version
|
from . import __version__ as borg_version
|
||||||
from . import __version_tuple__ as borg_version_tuple
|
from . import __version_tuple__ as borg_version_tuple
|
||||||
from . import chunker
|
|
||||||
from . import crypto
|
from . import crypto
|
||||||
from . import hashindex
|
from . import hashindex
|
||||||
|
from .algorithms import chunker
|
||||||
from .constants import * # NOQA
|
from .constants import * # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from ..chunker import Chunker, buzhash, buzhash_update
|
from ..algorithms.chunker import Chunker, buzhash, buzhash_update
|
||||||
from ..constants import * # NOQA
|
from ..constants import * # NOQA
|
||||||
from . import BaseTestCase
|
from . import BaseTestCase
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue