diff --git a/0001-add-loongarch-support-for-pyparted.patch b/0001-add-loongarch-support-for-pyparted.patch new file mode 100644 index 0000000..b96199e --- /dev/null +++ b/0001-add-loongarch-support-for-pyparted.patch @@ -0,0 +1,52 @@ +From e9e736aaf07d15eebfe24570b6ddd8badb4f8443 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Fri, 2 Dec 2022 14:08:50 +0800 +Subject: [PATCH] add loongarch support for pyparted + +Signed-off-by: Wenlong Zhang +--- + src/parted/__init__.py | 7 ++++--- + tests/test_parted_parted.py | 1 + + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/parted/__init__.py b/src/parted/__init__.py +index ef049ee..c3aa070 100644 +--- a/src/parted/__init__.py ++++ b/src/parted/__init__.py +@@ -405,7 +405,8 @@ archLabels = {'i386': ['msdos', 'gpt'], + 'mips64': ['msdos','gpt'], + 'armv7l': ['msdos', 'gpt'], + 'riscv32': ['msdos', 'gpt'], +- 'riscv64': ['msdos', 'gpt']} ++ 'riscv64': ['msdos', 'gpt'], ++ 'loongarch64': ['msdos', 'gpt']} + + # Adapted from: + # http://stackoverflow.com/questions/922550/how-to-mark-a-global-as-deprecated-in-python +@@ -442,9 +443,9 @@ def Deprecated(mod, deprecated=None): + __archLabels = (('amiga', 'ppc(64)?$'), + ('bsd', 'alpha$'), + ('dasd', 's390x?$'), +- ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64|64le)?$|aarch64$|armv7l$|riscv(32|64)$'), ++ ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64|64le)?$|aarch64$|armv7l$|riscv(32|64)$|loongarch64$'), + ('mac', 'ppc(64)?$'), +- ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64|64le)?$|aarch64$|mips64$|armv7l$|riscv(32|64)$'), ++ ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64|64le)?$|aarch64$|mips64$|armv7l$|riscv(32|64)$|loongarch64'), + ('sun', 'sparc(64)?$')) + + def getLabels(arch=None): +diff --git a/tests/test_parted_parted.py b/tests/test_parted_parted.py +index c615aad..d2b9a90 100755 +--- a/tests/test_parted_parted.py ++++ b/tests/test_parted_parted.py +@@ -65,6 +65,7 @@ class GetLabelsTestCase(unittest.TestCase): + self.assertSetEqual(parted.getLabels('armv7l'), {'gpt', 'msdos'}) + self.assertSetEqual(parted.getLabels('riscv32'), {'gpt', 'msdos'}) + self.assertSetEqual(parted.getLabels('riscv64'), {'gpt', 'msdos'}) ++ self.assertSetEqual(parted.getLabels('loongarch64'), {'gpt', 'msdos'}) + + class GetDeviceTestCase(RequiresDeviceNode): + def runTest(self): +-- +2.33.0 + diff --git a/pyparted.spec b/pyparted.spec index ac9f117..4df8d93 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -1,7 +1,7 @@ Name: pyparted Epoch: 1 Version: 3.12.0 -Release: 1 +Release: 2 Summary: Python bindings for libparted License: GPLv2 Group: System Environment/Libraries @@ -11,6 +11,8 @@ Source0: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{n BuildRequires: gcc pkgconfig e2fsprogs parted-devel >= 3.2-18 BuildRequires: python3-devel python3-six +Patch001: 0001-add-loongarch-support-for-pyparted.patch + %description %{name} is a set of native Python bindings for libparted. libparted is the library portion of the GNU parted project. With pyparted, you can write @@ -42,6 +44,9 @@ PYTHON=python3 %make_install %{python3_sitearch}/%{name}-%{version}-*.egg-info %changelog +* Thu Dec 1 2022 Wenlong Zhang - 3.12.0-2 +- Add loongarch64 architecture + * Fri Oct 28 2022 zhuofeng - 3.12.0-1 - update to 3.12.0