borgbackup: update use-distutils.patch

This commit is contained in:
Leonid Pliushch 2021-07-26 13:32:27 +03:00
parent ea20bf9f43
commit d4816a836c
No known key found for this signature in database
GPG Key ID: 45F2964132545795
1 changed files with 49 additions and 39 deletions

View File

@ -1,6 +1,6 @@
From a90b4d665e6145f7d10535ec77510ba7f04f7515 Mon Sep 17 00:00:00 2001
From 2ae2e3a15fa3e361b5f2e186d2450a8ccd38f698 Mon Sep 17 00:00:00 2001
From: Leonid Pliushch <leonid.pliushch@gmail.com>
Date: Mon, 26 Jul 2021 13:11:32 +0300
Date: Mon, 26 Jul 2021 13:30:08 +0300
Subject: [PATCH] Termux borgbackup: use distutils instead of packaging
Do not remove this patch unless you know what you are doing!
@ -14,35 +14,48 @@ So if you decide to drop this patch:
* Alternatively: create a postinst deb script (pip3 install packaging)
and move borgbackup to https://github.com/termux/unstable-packages
---
setup.py | 21 +++++++--------------
setup.py | 24 ++++++++----------------
src/borg/__init__.py | 5 ++---
src/borg/xattr.py | 6 +++---
3 files changed, 12 insertions(+), 20 deletions(-)
3 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/setup.py b/setup.py
index 7ad8f814..526757ed 100644
index 87e93d25..5ca79af2 100644
--- a/setup.py
+++ b/setup.py
@@ -11,8 +11,9 @@
multiprocessing = None
@@ -37,9 +37,7 @@
# Are we building on ReadTheDocs?
on_rtd = os.environ.get('READTHEDOCS')
-install_requires = [
- 'packaging',
-]
+install_requires = []
# note for package maintainers: if you package borgbackup for distribution,
# please add llfuse as a *requirement* on all platforms that have a working
@@ -54,8 +52,10 @@
],
}
from setuptools.command.build_ext import build_ext
-from setuptools import setup, find_packages, Extension, Command
+from setuptools import setup, find_packages, Extension
from setuptools.command.sdist import sdist
+from distutils.core import Command
+from distutils.command.clean import clean
try:
from Cython.Build import cythonize
@@ -70,7 +71,6 @@
# Please note:
# using any other version is not supported by borg development and
# any feedback related to issues caused by this will be ignored.
- 'packaging',
]
compress_source = 'src/borg/compress.pyx'
crypto_ll_source = 'src/borg/crypto/low_level.pyx'
@@ -146,7 +146,7 @@ def __init__(self, *args, **kwargs):
msgpack_packer_source = msgpack_packer_source.replace('.pyx', '.cpp')
msgpack_unpacker_source = msgpack_unpacker_source.replace('.pyx', '.cpp')
# note for package maintainers: if you package borgbackup for distribution,
@@ -137,16 +137,9 @@ def rm(file):
- from setuptools.command.build_ext import build_ext
+ from distutils.command.build_ext import build_ext
if not on_rtd and not all(os.path.exists(path) for path in [
compress_source, crypto_ll_source, chunker_source, hashindex_source, item_source, checksums_source,
platform_posix_source, platform_linux_source, platform_syncfilerange_source, platform_freebsd_source, platform_darwin_source,
@@ -767,16 +767,9 @@ def rm(file):
pass
@ -58,29 +71,26 @@ index 7ad8f814..526757ed 100644
+class Clean(clean):
def run(self):
+ super().run()
for source in cython_sources:
for source in cython_c_sources:
genc = source.replace('.pyx', '.c')
rm(genc)
@@ -160,7 +153,7 @@ def run(self):
'build_usage': setup_docs.build_usage,
'build_man': setup_docs.build_man,
@@ -793,7 +786,7 @@ def run(self):
'build_usage': build_usage,
'build_man': build_man,
'sdist': Sdist,
- 'clean2': Clean,
+ 'clean': Clean,
}
ext_modules = []
@@ -227,8 +220,8 @@ def members_appended(*ds):
# sometimes there's no need to cythonize
# this breaks chained commands like 'clean sdist'
- cythonizing = len(sys.argv) > 1 and sys.argv[1] not in (
- ('clean', 'clean2', 'egg_info', '--help-commands', '--version')) and '--help' not in sys.argv[1:]
+ cythonizing = len(sys.argv) > 1 and sys.argv[1] not in ('clean', 'egg_info', '--help-commands', '--version') \
+ and '--help' not in sys.argv[1:]
if cythonize and cythonizing:
cython_opts = dict(
@@ -882,7 +875,6 @@ def run(self):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
'Topic :: Security :: Cryptography',
'Topic :: System :: Archiving :: Backup',
],
diff --git a/src/borg/__init__.py b/src/borg/__init__.py
index 9f13c7d6..47adb1b6 100644
--- a/src/borg/__init__.py
@ -101,19 +111,19 @@ index 9f13c7d6..47adb1b6 100644
# assert that all semver components are integers
# this is mainly to show errors when people repackage poorly
diff --git a/src/borg/xattr.py b/src/borg/xattr.py
index a2039ebb..dd412edd 100644
index f611a80a..8f77ab95 100644
--- a/src/borg/xattr.py
+++ b/src/borg/xattr.py
@@ -7,7 +7,7 @@
import sys
@@ -8,7 +8,7 @@
import tempfile
from ctypes import CDLL, create_string_buffer, c_ssize_t, c_size_t, c_char_p, c_int, c_uint32, get_errno
from ctypes.util import find_library
-from packaging.version import parse as parse_version
+from distutils.version import LooseVersion
from .helpers import prepare_subprocess_env
from .helpers import Buffer, prepare_subprocess_env
@@ -29,8 +29,8 @@
@@ -91,8 +91,8 @@ def get_all(path, follow_symlinks=True):
if preload.startswith("libfakeroot"):
env = prepare_subprocess_env(system=True)
fakeroot_output = subprocess.check_output(['fakeroot', '-v'], env=env)