buzhash64: integrate into build

This commit is contained in:
Thomas Waldmann 2025-06-05 19:23:10 +02:00
parent 6a6622f9d8
commit 63ff136dfe
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
4 changed files with 10 additions and 0 deletions

1
.gitignore vendored
View file

@ -7,6 +7,7 @@ src/borg/compress.c
src/borg/crypto/low_level.c
src/borg/item.c
src/borg/chunkers/buzhash.c
src/borg/chunkers/buzhash64.c
src/borg/chunkers/reader.c
src/borg/checksums.c
src/borg/platform/darwin.c

View file

@ -543,6 +543,7 @@ cython_sources = """
src/borg/compress.pyx
src/borg/crypto/low_level.pyx
src/borg/chunkers/buzhash.pyx
src/borg/chunkers/buzhash64.pyx
src/borg/chunkers/reader.pyx
src/borg/hashindex.pyx
src/borg/item.pyx

View file

@ -51,6 +51,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"
buzhash_source = "src/borg/chunkers/buzhash.pyx"
buzhash64_source = "src/borg/chunkers/buzhash64.pyx"
reader_source = "src/borg/chunkers/reader.pyx"
hashindex_source = "src/borg/hashindex.pyx"
item_source = "src/borg/item.pyx"
@ -66,6 +67,7 @@ cython_sources = [
compress_source,
crypto_ll_source,
buzhash_source,
buzhash64_source,
reader_source,
hashindex_source,
item_source,
@ -185,6 +187,7 @@ if not on_rtd:
Extension("borg.hashindex", [hashindex_source], extra_compile_args=cflags),
Extension("borg.item", [item_source], extra_compile_args=cflags),
Extension("borg.chunkers.buzhash", [buzhash_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]),
Extension("borg.chunkers.buzhash64", [buzhash64_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]),
Extension("borg.chunkers.reader", [reader_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]),
Extension("borg.checksums", **checksums_ext_kwargs),
]

View file

@ -1,4 +1,5 @@
from .buzhash import Chunker
from .buzhash64 import ChunkerBuzHash64
from .failing import ChunkerFailing
from .fixed import ChunkerFixed
from .reader import * # noqa
@ -11,6 +12,10 @@ def get_chunker(algo, *params, **kw):
seed = kw["seed"]
sparse = kw["sparse"]
return Chunker(seed, *params, sparse=sparse)
if algo == "buzhash64":
seed = kw["seed"]
sparse = kw["sparse"]
return ChunkerBuzHash64(seed, *params, sparse=sparse)
if algo == "fixed":
sparse = kw["sparse"]
return ChunkerFixed(*params, sparse=sparse)