Compare commits

..

No commits in common. "f37" and "master" have entirely different histories.
f37 ... master

6 changed files with 31 additions and 201 deletions

9
.gitignore vendored
View File

@ -3,12 +3,3 @@
/pyparted-3.11.0.tar.gz
/pyparted-3.11.2.tar.gz
/pyparted-3.11.2.tar.gz.asc
/pyparted-3.11.3.tar.gz
/pyparted-3.11.4.tar.gz
/pyparted-3.11.4.tar.gz.asc
/pyparted-3.11.5.tar.gz
/pyparted-3.11.5.tar.gz.asc
/pyparted-3.11.7.tar.gz
/pyparted-3.11.7.tar.gz.asc
/pyparted-3.12.0.tar.gz
/pyparted-3.12.0.tar.gz.asc

Binary file not shown.

View File

@ -1,85 +0,0 @@
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

@ -22,43 +22,41 @@
%bcond_without python3
%endif
%if %{fedora} > 31
# disable python2 by default
%bcond_with python2
%else
# XXX: uncomment this when things that use python2-pyparted can use
# the python3 version. Be sure to change '28' to the appropriate
# version number. Also, replace all the '@' signs with '%' because
# I cannot remember this macro construct, I'm just commenting it out.
# --dcantrell
#@if @{fedora} > 28
## disable python2 by default
#@bcond_with python2
#@else
#@bcond_without python2
#@endif
# XXX: And delete this when you can disable python2 by default. --dcantrell
%bcond_without python2
%endif
%endif
Summary: Python module for GNU parted
Name: pyparted
Epoch: 1
Version: 3.12.0
Release: 6%{?dist}
Version: 3.11.2
Release: 3%{?dist}
License: GPLv2+
URL: https://github.com/dcantrell/pyparted
URL: https://github.com/rhinstaller/pyparted
Source0: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc
Source2: keyring.gpg
Source3: trustdb.gpg
Source0: https://github.com/rhinstaller/pyparted/archive/%{name}-%{version}.tar.gz
# 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
BuildRequires: parted-devel >= 3.2-18
BuildRequires: pkgconfig
BuildRequires: e2fsprogs
BuildRequires: gnupg2
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-six
BuildRequires: python3-setuptools
%endif
%if %{with python2}
@ -94,26 +92,22 @@ partition tables. This package provides Python 3 bindings for parted.
%endif
%prep
# Verify source archive signature
gpg --no-default-keyring --keyring %{SOURCE2} --trustdb-name %{SOURCE3} --verify %{SOURCE1} %{SOURCE0} || exit 1
%setup -q
%patch0 -p1
%if %{with python3}
everything=$(ls)
mkdir -p py3dir
cp -a $everything py3dir
rm -rf %{py3dir}
mkdir -p %{py3dir}
cp -a . %{py3dir}
%endif
%build
%if %{with python2}
PYTHON=python2 %make_build CFLAGS="%{optflags} -fcommon"
PYTHON=python2 make %{?_smp_mflags}
%endif
%if %{with python3}
pushd py3dir
PYTHON=python3 %make_build CFLAGS="%{optflags} -fcommon"
pushd %{py3dir}
PYTHON=python3 make %{?_smp_mflags}
popd
%endif
@ -123,19 +117,19 @@ PYTHON=python2 make test
%endif
%if %{with python3}
pushd py3dir
pushd %{py3dir}
PYTHON=python3 make test
popd
%endif
%install
%if %{with python2}
PYTHON=python2 %make_install
PYTHON=python2 make install DESTDIR=%{buildroot}
%endif
%if %{with python3}
pushd py3dir
PYTHON=python3 %make_install
pushd %{py3dir}
PYTHON=python3 make install DESTDIR=%{buildroot}
popd
%endif
@ -156,76 +150,6 @@ popd
%endif
%changelog
* 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
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 03 2021 Python Maint <python-maint@redhat.com> - 1:3.11.7-3
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Oct 23 2020 David Cantrell <dcantrell@redhat.com> - 1:3.11.7-1
- Upgrade to pyparted-3.11.7 (BZ#1890443)
- Set PY_SSIZE_T_CLEAN for the build (bcl)
- add nvme support
- Update RELEASE file to make last step be "make pypi" (dcantrell)
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 1:3.11.5-3
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 1:3.11.5-2
- Rebuilt for Python 3.9
* Mon Mar 09 2020 David Cantrell <dcantrell@redhat.com> - 1:3.11.5-1
- Require at least libparted 3.3 and python 3.7 (dcantrell)
- pedmodule.c: Fix partition enum flag handling (bcl)
- Add support for chromeos_kernel and bls_boot partition flags (bcl)
- Move exception declarations to _pedmodule.c (dcantrell)
* Tue Feb 11 2020 David Cantrell <dcantrell@redhat.com> - 1:3.11.4-1
- Use Decimal for Device.getSize() operations, return a
float (#1801355)
- Update the 'twine upload' line in the Makefile
- Don't intentionally prohibit Python 2 usage (#67)
- mips64 support
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Nov 15 2019 David Cantrell <dcantrell@redhat.com> - 1:3.11.3-1
- Fix deprecation warning in parted/cachedlist.py (#1772060)
* Sun Oct 20 2019 Miro Hrončok <mhroncok@redhat.com> - 1:3.11.2-5
- Remove python2-pyparted from Fedora 32+
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1:3.11.2-4
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 1:3.11.2-3
- Rebuilt for Python 3.8

View File

@ -1,2 +1,2 @@
SHA512 (pyparted-3.12.0.tar.gz) = 0179e5334be8c04287b10b47d407ad339933cd3e20514d2142fe968acf8a36c40e541ee5165e2b3699a40b133d8f1948d8d12ccf307d3a1736090fb33f28b7e7
SHA512 (pyparted-3.12.0.tar.gz.asc) = 452d386fbc8b84fa0dc186bb75c6c12eb051c8a37575e5a3a0cf504d13c4b2a0134d7e486928f9af7d142d25802bda05c97fd95ff80721ae6f6c0abedb8b1614
SHA512 (pyparted-3.11.2.tar.gz) = c91b3113951f3bb032f5c1309b5c301754b1aa9a5347a3bf4bbd6d6d23c929da63fbbe8e922660af6249c1037e9594ceb73fd28b77c2fda5f0833b1816f002f3
SHA512 (pyparted-3.11.2.tar.gz.asc) = 4fba573c319518db3b3c9d80f65a8869f687c7abc028b3a153088adfe09b203987983b8e8f4e79e8ff3e0a6c6e584df140d13ac1d276e4f3a691d4e1dd33b60d

Binary file not shown.