Compare commits

...

No commits in common. "c8s" and "c9s" have entirely different histories.
c8s ... c9s

12 changed files with 300 additions and 1656 deletions

14
.gitignore vendored
View File

@ -1,2 +1,14 @@
SOURCES/pyparted-3.11.7.tar.gz
/pyparted-3.10.6.tar.gz
/pyparted-3.10.7.tar.gz
/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

1
EMPTY
View File

@ -1 +0,0 @@

View File

@ -1,8 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
- fedora-*
decision_context: bodhi_update_push_testing
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build.rpminspect.static-analysis}
- !PassingTestCaseRule {test_case_name: osci.brew-build.installability.functional}
- !PassingTestCaseRule {test_case_name: dist.depcheck}

BIN
keyring.gpg Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

115
pyparted-3.12.0-types.patch Normal file
View File

@ -0,0 +1,115 @@
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-07-14 12:28:09.687155151 -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-07-14 12:59:46.270416021 -0400
@@ -648,42 +648,20 @@ MOD_INIT(_ped) {
PyModule_AddIntConstant(m, "PARTITION_BIOS_GRUB", PED_PARTITION_BIOS_GRUB);
PyModule_AddIntConstant(m, "PARTITION_DIAG", PED_PARTITION_DIAG);
PyModule_AddIntConstant(m, "PARTITION_LEGACY_BOOT", PED_PARTITION_LEGACY_BOOT);
-
- /* NOTE: You cannot evaluate the enum PED_PARTITION_* values using the
- * preprocessor. DO NOT use #if or #ifdef with them.
- *
- * Conditionally add constants, based on PED_PARTITION_LAST_FLAG, and what
- * we know about parted/disk.h
- */
-#if PED_PARTITION_LAST_FLAG > 15
PyModule_AddIntConstant(m, "PARTITION_MSFT_DATA", PED_PARTITION_MSFT_DATA);
-#endif
-
-#if PED_PARTITION_LAST_FLAG > 16
PyModule_AddIntConstant(m, "PARTITION_IRST", PED_PARTITION_IRST);
-#endif
-
-#if PED_PARTITION_LAST_FLAG > 17
PyModule_AddIntConstant(m, "PARTITION_ESP", PED_PARTITION_ESP);
-#endif
-
-#if PED_PARTITION_LAST_FLAG > 18
PyModule_AddIntConstant(m, "PARTITION_CHROMEOS_KERNEL", PED_PARTITION_CHROMEOS_KERNEL);
-#endif
-
-#if PED_PARTITION_LAST_FLAG > 19
PyModule_AddIntConstant(m, "PARTITION_BLS_BOOT", PED_PARTITION_BLS_BOOT);
-#endif
-
-#if PED_PARTITION_LAST_FLAG > 20
PyModule_AddIntConstant(m, "PARTITION_LINUX_HOME", PED_PARTITION_LINUX_HOME);
-#endif
PyModule_AddIntConstant(m, "DISK_CYLINDER_ALIGNMENT", PED_DISK_CYLINDER_ALIGNMENT);
PyModule_AddIntConstant(m, "DISK_GPT_PMBR_BOOT", PED_DISK_GPT_PMBR_BOOT);
PyModule_AddIntConstant(m, "DISK_TYPE_EXTENDED", PED_DISK_TYPE_EXTENDED);
PyModule_AddIntConstant(m, "DISK_TYPE_PARTITION_NAME", PED_DISK_TYPE_PARTITION_NAME);
+ PyModule_AddIntConstant(m, "DISK_TYPE_PARTITION_TYPE_ID", PED_DISK_TYPE_PARTITION_TYPE_ID);
+ PyModule_AddIntConstant(m, "DISK_TYPE_PARTITION_TYPE_UUID", PED_DISK_TYPE_PARTITION_TYPE_UUID);
/* add PedFileSystemType as _ped.FileSystemType */
if (PyType_Ready(&_ped_FileSystemType_Type_obj) < 0)
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-07-14 12:28:09.687155151 -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,7 +22,7 @@
%bcond_without python3
%endif
%if %{fedora} > 28
%if %{fedora} > 31
# disable python2 by default
%bcond_with python2
%else
@ -30,29 +30,35 @@
%endif
%endif
%global py2dir python2-build
Summary: Python module for GNU parted
Name: pyparted
Epoch: 1
Version: 3.11.7
Release: 4%{?dist}
Version: 3.12.0
Release: 1%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: https://github.com/rhinstaller/pyparted
URL: https://github.com/dcantrell/pyparted
Source0: https://github.com/rhinstaller/pyparted/archive/%{name}-%{version}.tar.gz
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
Patch0: pyparted-3.11.7-covscan.patch
# 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-types.patch
BuildRequires: make
BuildRequires: gcc
BuildRequires: parted-devel >= 3.2-18
BuildRequires: parted-devel >= 3.5
BuildRequires: pkgconfig
BuildRequires: e2fsprogs
BuildRequires: gnupg2
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-six
BuildRequires: python3-setuptools
%endif
%if %{with python2}
@ -80,11 +86,7 @@ Obsoletes: pyparted < %{epoch}:%{version}-%{release}
%if %{with python3}
%package -n python3-pyparted
Summary: Python 3 module for GNU parted
Group: System Environment/Libraries
%if !%{with python2}
Provides: pyparted = %{epoch}:%{version}-%{release}
%endif
Summary: Python 3 module for GNU parted
%description -n python3-pyparted
Python module for the parted library. It is used for manipulating
@ -92,55 +94,49 @@ 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 python2}
rm -rf ../%{py2dir}
mkdir -p ../%{py2dir}
cp -a . ../%{py2dir}
mv ../%{py2dir} .
%if %{with python3}
everything=$(ls)
mkdir -p py3dir
cp -a $everything py3dir
%endif
%build
%if %{with python3}
PYTHON=python3 CFLAGS="%{optflags}" make %{?_smp_mflags}
%if %{with python2}
PYTHON=python2 %make_build CFLAGS="%{optflags} -fcommon"
%endif
%if %{with python2}
pushd %{py2dir}
PYTHON=python2 CFLAGS="%{optflags}" make %{?_smp_mflags}
%if %{with python3}
pushd py3dir
PYTHON=python3 %make_build CFLAGS="%{optflags} -fcommon"
popd
%endif
%check
%if %{with python3}
PYTHON=python3 CFLAGS="%{optflags}" make test
%if %{with python2}
PYTHON=python2 make test
%endif
%if %{with python2}
pushd %{py2dir}
PYTHON=python2 CFLAGS="%{optflags}" make test
%if %{with python3}
pushd py3dir
PYTHON=python3 make test
popd
%endif
%install
%if %{with python3}
PYTHON=python3 CFLAGS="%{optflags}" make install DESTDIR=%{buildroot}
%endif
%if %{with python2}
pushd %{py2dir}
PYTHON=python2 CFLAGS="%{optflags}" make install DESTDIR=%{buildroot}
popd
PYTHON=python2 %make_install
%endif
%if %{with python3}
%files -n python3-pyparted
%doc AUTHORS COPYING NEWS README TODO
%{python3_sitearch}/_ped.*.so
%{python3_sitearch}/parted
%{python3_sitearch}/%{name}-%{version}-*.egg-info
pushd py3dir
PYTHON=python3 %make_install
popd
%endif
%if %{with python2}
@ -151,57 +147,114 @@ popd
%{python2_sitearch}/%{name}-%{version}-*.egg-info
%endif
%if %{with python3}
%files -n python3-pyparted
%doc AUTHORS COPYING NEWS README TODO
%{python3_sitearch}/_ped.*.so
%{python3_sitearch}/parted
%{python3_sitearch}/%{name}-%{version}-*.egg-info
%endif
%changelog
* Mon Jul 12 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.7-4
- Rebuild for gating
Related: rhbz#1927379
* Tue Jun 21 2022 David Cantrell <dcantrell@redhat.com> - 1:3.12.0-1
- 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
Resolves: rhbz#2103243
* Fri Jul 09 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.7-3
- More covscan patch followup
Related: rhbz#1927379
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.11.7-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Jul 09 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.7-2
- Patched errors found by covscan
Related: rhbz#1927379
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:3.11.7-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Jul 08 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.7-1
- Upgrade to pyparted-3.11.7
Resolves: rhbz#1927379
* 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
* Tue May 18 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-21
- Rebuild for gating
Related: rhbz#1927379
* 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 May 18 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-20
- Fixes for gating
Related: rhbz#1927379
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 1:3.11.5-3
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Mon May 17 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-19
- Rebuild for gating
Related: rhbz#1927379
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 1:3.11.5-2
- Rebuilt for Python 3.9
* Mon May 17 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-18
- Rebuild for gating
Related: rhbz#1927379
* 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)
* Mon May 17 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-17
- Rebuild
Related: rhbz#1927379
* 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
* Tue Feb 23 2021 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-16
- Handle PED_EXCEPTION_FIX (Fix/Ignore) exceptions
Resolves: rhbz#1927379
* 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
* Wed Jul 25 2018 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-13
- Do not build python2 subpackage
Resolves: rhbz#1565329
* Fri Nov 15 2019 David Cantrell <dcantrell@redhat.com> - 1:3.11.3-1
- Fix deprecation warning in parted/cachedlist.py (#1772060)
* Thu Jul 19 2018 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-12
- Have python3-pyparted package provide 'pyparted'
Resolves: rhbz#1602333
* Sun Oct 20 2019 Miro Hrončok <mhroncok@redhat.com> - 1:3.11.2-5
- Remove python2-pyparted from Fedora 32+
* Mon May 28 2018 Charalampos Stratakis <cstratak@redhat.com> - 1:3.11.0-11
- Conditionalize the python2 subpackage
* 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
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 David Cantrell <dcantrell@redhat.com> - 1:3.11.2-1
- pyparted-3.11.2 (dcantrell)
- Do not remove the generated tarballs. (dcantrell)
- Update the RELEASE file. (dcantrell)
- tests: Fix flag_get_name tests (bcl)
- Avoid potential NULL dereferences in pydisk.c and pytimer.c
(dcantrell)
- New - example to query device capacity (jflorian)
- correct spelling mistake (edward)
- _ped's *_flag_get_name methods now throw a PartedException instead of
ValueError on unsupported flags. (lukasz.zemczak)
- Make the partition name a property on parted.Partition objects (#34)
(dcantrell)
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 1:3.11.0-17
- Rebuild with fixed binutils
* Fri Jul 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:3.11.0-16
- Rebuild for new binutils
* Thu Jul 26 2018 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-15
- Do not disable python2 builds by default. There are still some packages
that have not been updated to python3 and require python2-pyparted.
* Wed Jul 25 2018 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-14
- Conditionalize python2 and python3 builds to make the SRPM more portable
across releases. On RHEL > 7 and Fedora > 28, do not build for python2.
On RHEL <= 7, do not build for python3.
* Tue Jul 24 2018 David Cantrell <dcantrell@redhat.com> - 1:3.11.0-13
- Use 'python2' when building the Python 2.x bindings (#1605566)
- BuildRequires gcc (#1605566)
- %%{python_sitearch} -> %%{python2_sitearch} (#1605566)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 1:3.11.0-11
- Rebuilt for Python 3.7
* Mon Apr 02 2018 Adam Williamson <awilliam@redhat.com> - 1:3.11.0-10
- Make pyparted provides/obsoletes include the epoch

View File

@ -1,5 +0,0 @@
---
changedfiles:
# ignore the Python bytecode files; they change with every build
ignore:
- "*.pyc"

View File

@ -1 +1,2 @@
SHA512 (pyparted-3.11.7.tar.gz) = 41018989c21aab577cd1d51f521128d072b346afb9dcdcc27490cdbc2ed4382a854e4bd16780da72a0a95bbd521f14ee0e7f02816f34656cbae734d43a4f0b83
SHA512 (pyparted-3.12.0.tar.gz) = 0179e5334be8c04287b10b47d407ad339933cd3e20514d2142fe968acf8a36c40e541ee5165e2b3699a40b133d8f1948d8d12ccf307d3a1736090fb33f28b7e7
SHA512 (pyparted-3.12.0.tar.gz.asc) = 452d386fbc8b84fa0dc186bb75c6c12eb051c8a37575e5a3a0cf504d13c4b2a0134d7e486928f9af7d142d25802bda05c97fd95ff80721ae6f6c0abedb8b1614

29
tests/scripts/run_tests.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
PATH=/usr/bin
TMPDIR="$(mktemp -d)"
CWD="$(pwd)"
PACKAGE=pyparted
BRANCH=
# clone the dist-git tree for this package
cd ${TMPDIR}
fedpkg co ${PACKAGE}
cd ${PACKAGE}
[ -z "${BRANCH}" ] || fedpkg switch-branch ${BRANCH}
fedpkg prep
# scramble together the extracted source tree name
SRCDIR="${PACKAGE}-$(grep Version: ${PACKAGE}.spec | cut -d ' ' -f 2)"
# run the tests
cd ${SRCDIR}
#make check # this runs pylint, which is sometimes wrong/noisy
make test
RET=$?
# clean up and exit
cd ${CWD}
rm -rf ${TMPDIR}
exit ${RET}

View File

@ -2,20 +2,14 @@
- hosts: localhost
roles:
# Fetch package source
- role: standard-test-source
tags:
- classic
- role: standard-test-basic
tags:
- classic
required_packages:
- gcc
- make
- parted-devel
- python3-devel
- redhat-rpm-config
- fedpkg
tests:
- simple:
dir: source/
run: make test PYTHON=python3
dir: scripts/
run: ./run_tests.sh

BIN
trustdb.gpg Normal file

Binary file not shown.