Compare commits

...

5 Commits

Author SHA1 Message Date
Fedora Release Engineering b71463d9af Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 15:50:35 +00:00
David Cantrell 52a1c8bfaf Patch pyparted to handle PED_DISK_TYPE_PARTITION_TYPE_ID for the
msdos disk type and PED_DISK_TYPE_PARTITION_TYPE_UUID for the gpt
  label (#2098792)

Signed-off-by: David Cantrell <dcantrell@redhat.com>
2022-06-21 15:22:04 -04:00
Adam Williamson d32b10b877 Backport PR #92 to fix tests with parted 3.5 (#2098792) 2022-06-20 13:24:26 -07:00
Python Maint e8f5fc9089 Rebuilt for Python 3.11 2022-06-13 16:02:42 +02:00
David Cantrell 791a789e24 BR python3-setuptools
Signed-off-by: David Cantrell <dcantrell@redhat.com>
2022-03-07 14:45:25 -05:00
2 changed files with 111 additions and 2 deletions

View File

@ -0,0 +1,85 @@
diff -up pyparted-3.12.0/src/parted/__init__.py.orig pyparted-3.12.0/src/parted/__init__.py
--- pyparted-3.12.0/src/parted/__init__.py.orig 2022-03-07 12:38:56.000000000 -0500
+++ pyparted-3.12.0/src/parted/__init__.py 2022-06-21 15:05:10.318939409 -0400
@@ -217,6 +217,14 @@ from _ped import DISK_GPT_PMBR_BOOT
from _ped import DISK_TYPE_EXTENDED
from _ped import DISK_TYPE_PARTITION_NAME
+if hasattr(_ped, 'DISK_TYPE_PARTITION_TYPE_ID'):
+ # pylint: disable=E0611
+ from _ped import DISK_TYPE_PARTITION_TYPE_ID
+
+if hasattr(_ped, 'DISK_TYPE_PARTITION_TYPE_UUID'):
+ # pylint: disable=E0611
+ from _ped import DISK_TYPE_PARTITION_TYPE_UUID
+
from _ped import EXCEPTION_TYPE_INFORMATION
from _ped import EXCEPTION_TYPE_WARNING
from _ped import EXCEPTION_TYPE_ERROR
diff -up pyparted-3.12.0/src/_pedmodule.c.orig pyparted-3.12.0/src/_pedmodule.c
--- pyparted-3.12.0/src/_pedmodule.c.orig 2022-03-07 12:49:11.000000000 -0500
+++ pyparted-3.12.0/src/_pedmodule.c 2022-06-21 15:04:57.863977820 -0400
@@ -685,6 +685,14 @@ MOD_INIT(_ped) {
PyModule_AddIntConstant(m, "DISK_TYPE_EXTENDED", PED_DISK_TYPE_EXTENDED);
PyModule_AddIntConstant(m, "DISK_TYPE_PARTITION_NAME", PED_DISK_TYPE_PARTITION_NAME);
+#if PED_DISK_TYPE_LAST_FEATURE > 2
+ PyModule_AddIntConstant(m, "DISK_TYPE_PARTITION_TYPE_ID", PED_DISK_TYPE_PARTITION_TYPE_ID);
+#endif
+
+#if PED_DISK_TYPE_LAST_FEATURE > 4
+ PyModule_AddIntConstant(m, "DISK_TYPE_PARTITION_TYPE_UUID", PED_DISK_TYPE_PARTITION_TYPE_UUID);
+#endif
+
/* add PedFileSystemType as _ped.FileSystemType */
if (PyType_Ready(&_ped_FileSystemType_Type_obj) < 0)
return MOD_ERROR_VAL;
diff -up pyparted-3.12.0/tests/test__ped_disktype.py.orig pyparted-3.12.0/tests/test__ped_disktype.py
--- pyparted-3.12.0/tests/test__ped_disktype.py.orig 2018-01-12 13:31:40.000000000 -0500
+++ pyparted-3.12.0/tests/test__ped_disktype.py 2022-06-21 15:04:57.863977820 -0400
@@ -63,11 +63,22 @@ class DiskTypeCheckFeatureTestCase(Requi
self.assertTrue(self.disktype[name].check_feature(_ped.DISK_TYPE_EXTENDED))
self.assertFalse(self.disktype[name].check_feature(_ped.DISK_TYPE_PARTITION_NAME))
+ if hasattr(_ped, "DISK_TYPE_PARTITION_TYPE_ID"):
+ self.assertTrue(self.disktype[name].check_feature(_ped.DISK_TYPE_PARTITION_TYPE_ID))
+
+ if hasattr(_ped, "DISK_TYPE_PARTITION_TYPE_UUID"):
+ self.assertFalse(self.disktype[name].check_feature(_ped.DISK_TYPE_PARTITION_TYPE_UUID))
+
# The following types support DISK_TYPE_PARTITION_NAME
for name in ['amiga', 'gpt', 'mac', 'pc98']:
self.assertFalse(self.disktype[name].check_feature(_ped.DISK_TYPE_EXTENDED))
self.assertTrue(self.disktype[name].check_feature(_ped.DISK_TYPE_PARTITION_NAME))
+ # The following types support DISK_TYPE_PARTITION_TYPE_UUID
+ for name in ['gpt']:
+ if hasattr(_ped, "DISK_TYPE_PARTITION_TYPE_UUID"):
+ self.assertTrue(self.disktype[name].check_feature(_ped.DISK_TYPE_PARTITION_TYPE_UUID))
+
# The following types support all features
for name in ['dvh']:
self.assertTrue(self.disktype[name].check_feature(_ped.DISK_TYPE_EXTENDED))
@@ -75,11 +86,20 @@ class DiskTypeCheckFeatureTestCase(Requi
class DiskTypeStrTestCase(RequiresDiskTypes):
def runTest(self):
- self.assertEqual(str(self.disktype['msdos']), '_ped.DiskType instance --\n name: msdos features: 1')
+ if hasattr(_ped, "DISK_TYPE_PARTITION_TYPE_ID"):
+ self.assertEqual(str(self.disktype['msdos']), '_ped.DiskType instance --\n name: msdos features: 5')
+ else:
+ self.assertEqual(str(self.disktype['msdos']), '_ped.DiskType instance --\n name: msdos features: 1')
+
self.assertEqual(str(self.disktype['aix']), '_ped.DiskType instance --\n name: aix features: 0')
self.assertEqual(str(self.disktype['sun']), '_ped.DiskType instance --\n name: sun features: 0')
self.assertEqual(str(self.disktype['amiga']), '_ped.DiskType instance --\n name: amiga features: 2')
- self.assertEqual(str(self.disktype['gpt']), '_ped.DiskType instance --\n name: gpt features: 2')
+
+ if hasattr(_ped, "DISK_TYPE_PARTITION_TYPE_UUID"):
+ self.assertEqual(str(self.disktype['gpt']), '_ped.DiskType instance --\n name: gpt features: 10')
+ else:
+ self.assertEqual(str(self.disktype['gpt']), '_ped.DiskType instance --\n name: gpt features: 2')
+
self.assertEqual(str(self.disktype['mac']), '_ped.DiskType instance --\n name: mac features: 2')
self.assertEqual(str(self.disktype['bsd']), '_ped.DiskType instance --\n name: bsd features: 0')
self.assertEqual(str(self.disktype['pc98']), '_ped.DiskType instance --\n name: pc98 features: 2')

View File

@ -34,7 +34,7 @@ Summary: Python module for GNU parted
Name: pyparted
Epoch: 1
Version: 3.12.0
Release: 1%{?dist}
Release: 6%{?dist}
License: GPLv2+
URL: https://github.com/dcantrell/pyparted
@ -43,6 +43,11 @@ Source1: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{n
Source2: keyring.gpg
Source3: trustdb.gpg
# Support new disk type features from parted 3.5:
# https://bugzilla.redhat.com/show_bug.cgi?id=2098792
# https://github.com/dcantrell/pyparted/issues/91
Patch0: pyparted-3.12.0-partition-types.patch
BuildRequires: make
BuildRequires: gcc
BuildRequires: parted-devel >= 3.3
@ -53,6 +58,7 @@ BuildRequires: gnupg2
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-six
BuildRequires: python3-setuptools
%endif
%if %{with python2}
@ -92,6 +98,7 @@ partition tables. This package provides Python 3 bindings for parted.
gpg --no-default-keyring --keyring %{SOURCE2} --trustdb-name %{SOURCE3} --verify %{SOURCE1} %{SOURCE0} || exit 1
%setup -q
%patch0 -p1
%if %{with python3}
everything=$(ls)
@ -149,7 +156,24 @@ popd
%endif
%changelog
* Mon May 07 2022 David Cantrell <dcantrell@redhat.com> - 3.12.0-1
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.12.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jun 21 2022 David Cantrell <dcantrell@redhat.com> - 1:3.12.0-5
- Patch pyparted to handle PED_DISK_TYPE_PARTITION_TYPE_ID for the
msdos disk type and PED_DISK_TYPE_PARTITION_TYPE_UUID for the gpt
label (#2098792)
* Mon Jun 20 2022 Adam Williamson <awilliam@redhat.com> - 1:3.12.0-4
- Backport PR #92 to fix tests with parted 3.5 (#2098792)
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1:3.12.0-3
- Rebuilt for Python 3.11
* Mon Mar 07 2022 David Cantrell <dcantrell@redhat.com> - 3.12.0-2
- BR python3-setuptools
* Mon Mar 07 2022 David Cantrell <dcantrell@redhat.com> - 3.12.0-1
- Upgrade to pyparted-3.12.0
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.7-5