mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-23 14:41:43 +00:00
create package borg.algorithms with borg.algorithms.crc32 module
This commit is contained in:
parent
7c9a57bee5
commit
fa381ffcbe
9 changed files with 11 additions and 11 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -9,7 +9,7 @@ chunker.c
|
|||
compress.c
|
||||
crypto.c
|
||||
item.c
|
||||
src/borg/crc32.c
|
||||
src/borg/algorithms/crc32.c
|
||||
src/borg/platform/darwin.c
|
||||
src/borg/platform/freebsd.c
|
||||
src/borg/platform/linux.c
|
||||
|
|
8
setup.py
8
setup.py
|
@ -54,7 +54,7 @@
|
|||
chunker_source = 'src/borg/chunker.pyx'
|
||||
hashindex_source = 'src/borg/hashindex.pyx'
|
||||
item_source = 'src/borg/item.pyx'
|
||||
crc32_source = 'src/borg/crc32.pyx'
|
||||
crc32_source = 'src/borg/algorithms/crc32.pyx'
|
||||
platform_posix_source = 'src/borg/platform/posix.pyx'
|
||||
platform_linux_source = 'src/borg/platform/linux.pyx'
|
||||
platform_darwin_source = 'src/borg/platform/darwin.pyx'
|
||||
|
@ -91,8 +91,8 @@ def make_distribution(self):
|
|||
'src/borg/chunker.c', 'src/borg/_chunker.c',
|
||||
'src/borg/hashindex.c', 'src/borg/_hashindex.c',
|
||||
'src/borg/item.c',
|
||||
'src/borg/crc32.c',
|
||||
'src/borg/_crc32/crc32.c', 'src/borg/_crc32/clmul.c', 'src/borg/_crc32/slice_by_8.c',
|
||||
'src/borg/algorithms/crc32.c',
|
||||
'src/borg/algorithms/crc32_dispatch.c', 'src/borg/algorithms/crc32_clmul.c', 'src/borg/algorithms/crc32_slice_by_8.c',
|
||||
'src/borg/platform/posix.c',
|
||||
'src/borg/platform/linux.c',
|
||||
'src/borg/platform/freebsd.c',
|
||||
|
@ -582,7 +582,7 @@ def is_positional_group(group):
|
|||
Extension('borg.chunker', [chunker_source]),
|
||||
Extension('borg.hashindex', [hashindex_source]),
|
||||
Extension('borg.item', [item_source]),
|
||||
Extension('borg.crc32', [crc32_source]),
|
||||
Extension('borg.algorithms.crc32', [crc32_source]),
|
||||
]
|
||||
if not sys.platform.startswith(('win32', )):
|
||||
ext_modules.append(Extension('borg.platform.posix', [platform_posix_source]))
|
||||
|
|
|
@ -3,7 +3,7 @@ from libc.stdint cimport uint32_t
|
|||
from cpython.buffer cimport PyBUF_SIMPLE, PyObject_GetBuffer, PyBuffer_Release
|
||||
|
||||
|
||||
cdef extern from "_crc32/crc32.c":
|
||||
cdef extern from "crc32_dispatch.c":
|
||||
uint32_t _crc32_slice_by_8 "crc32_slice_by_8"(const void* data, size_t length, uint32_t initial_crc)
|
||||
uint32_t _crc32_clmul "crc32_clmul"(const void* data, size_t length, uint32_t initial_crc)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
/* always compile slice by 8 as a runtime fallback */
|
||||
#include "slice_by_8.c"
|
||||
#include "crc32_slice_by_8.c"
|
||||
|
||||
#ifdef __GNUC__
|
||||
/*
|
||||
|
@ -69,7 +69,7 @@
|
|||
#endif /* ifdef __GNUC__ */
|
||||
|
||||
#ifdef FOLDING_CRC
|
||||
#include "clmul.c"
|
||||
#include "crc32_clmul.c"
|
||||
#else
|
||||
|
||||
static uint32_t
|
|
@ -31,12 +31,12 @@
|
|||
import borg
|
||||
from . import __version__
|
||||
from . import helpers
|
||||
from .algorithms.crc32 import crc32
|
||||
from .archive import Archive, ArchiveChecker, ArchiveRecreater, Statistics, is_special
|
||||
from .archive import BackupOSError, backup_io
|
||||
from .cache import Cache
|
||||
from .constants import * # NOQA
|
||||
from .compress import CompressionSpec
|
||||
from .crc32 import crc32
|
||||
from .helpers import EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR
|
||||
from .helpers import Error, NoManifestError, set_ec
|
||||
from .helpers import location_validator, archivename_validator, ChunkerParams
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
from .logger import create_logger
|
||||
from .lrucache import LRUCache
|
||||
from .platform import SaveFile, SyncFile, sync_dir, safe_fadvise
|
||||
from .crc32 import crc32
|
||||
from .algorithms.crc32 import crc32
|
||||
|
||||
logger = create_logger(__name__)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import pytest
|
||||
|
||||
from .. import crc32
|
||||
from ..algorithms import crc32
|
||||
|
||||
crc32_implementations = [crc32.crc32_slice_by_8]
|
||||
if crc32.have_clmul:
|
||||
|
|
Loading…
Reference in a new issue