File borgbackup-1.1.4-binary-content-checks.patch of Package borgbackup
diff -rupN a/setup_b2.py b/setup_b2.py
--- a/setup_b2.py 2017-12-30 04:14:25.000000000 -0500
+++ b/setup_b2.py 2018-02-27 09:32:05.436199491 -0500
@@ -24,8 +24,8 @@ def b2_system_prefix(prefixes):
for prefix in prefixes:
filename = os.path.join(prefix, 'include', 'blake2.h')
if os.path.exists(filename):
- with open(filename, 'r') as fd:
- if 'blake2b_init' in fd.read():
+ with open(filename, 'rb') as fd:
+ if b'blake2b_init' in fd.read():
return prefix
diff -rupN a/setup_lz4.py b/setup_lz4.py
--- a/setup_lz4.py 2017-12-30 04:14:25.000000000 -0500
+++ b/setup_lz4.py 2018-02-27 09:32:26.040150097 -0500
@@ -24,8 +24,8 @@ def lz4_system_prefix(prefixes):
for prefix in prefixes:
filename = os.path.join(prefix, 'include', 'lz4.h')
if os.path.exists(filename):
- with open(filename, 'r') as fd:
- if 'LZ4_compress_default' in fd.read(): # requires lz4 >= 1.7.0 (r129)
+ with open(filename, 'rb') as fd:
+ if b'LZ4_compress_default' in fd.read(): # requires lz4 >= 1.7.0 (r129)
return prefix
diff -rupN a/setup.py b/setup.py
--- a/setup.py 2017-12-30 04:14:25.000000000 -0500
+++ b/setup.py 2018-02-27 09:31:35.968272628 -0500
@@ -145,8 +145,8 @@ def detect_openssl(prefixes):
for prefix in prefixes:
filename = os.path.join(prefix, 'include', 'openssl', 'evp.h')
if os.path.exists(filename):
- with open(filename, 'r') as fd:
- if 'PKCS5_PBKDF2_HMAC(' in fd.read():
+ with open(filename, 'rb') as fd:
+ if b'PKCS5_PBKDF2_HMAC(' in fd.read():
return prefix
diff -rupN a/setup_zstd.py b/setup_zstd.py
--- a/setup_zstd.py 2017-12-30 04:14:25.000000000 -0500
+++ b/setup_zstd.py 2018-02-27 09:32:44.264114280 -0500
@@ -66,8 +66,8 @@ def zstd_system_prefix(prefixes):
for prefix in prefixes:
filename = os.path.join(prefix, 'include', 'zstd.h')
if os.path.exists(filename):
- with open(filename, 'r') as fd:
- if 'ZSTD_getFrameContentSize' in fd.read(): # checks for zstd >= 1.3.0
+ with open(filename, 'rb') as fd:
+ if b'ZSTD_getFrameContentSize' in fd.read(): # checks for zstd >= 1.3.0
return prefix