Parcourir la source

buzhash64: integrate into build

Thomas Waldmann il y a 1 semaine
Parent
commit
63ff136dfe
4 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 1 0
      .gitignore
  2. 1 0
      scripts/make.py
  3. 3 0
      setup.py
  4. 5 0
      src/borg/chunkers/__init__.py

+ 1 - 0
.gitignore

@@ -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

+ 1 - 0
scripts/make.py

@@ -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

+ 3 - 0
setup.py

@@ -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),
     ]

+ 5 - 0
src/borg/chunkers/__init__.py

@@ -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)