From 62102d2a5f95d394e068658d34bef8a2ad0e70ad Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 26 Nov 2014 09:38:27 -0500 Subject: [PATCH 01/22] Upgrade to pyparted-3.10.2 --- .gitignore | 1 + pyparted.spec | 11 +++++++---- sources | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f0061cb..9de9b33 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ pyparted-3.9.2.tar.gz /pyparted-3.9.3.tar.gz /pyparted-3.9.4.tar.gz /pyparted-3.9.5.tar.gz +/pyparted-pyparted-3.10.2.tar.gz diff --git a/pyparted.spec b/pyparted.spec index 0a31842..30e7c6e 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -1,13 +1,13 @@ Summary: Python module for GNU parted Name: pyparted Epoch: 1 -Version: 3.9.5 -Release: 2%{?dist} +Version: 3.10.2 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries -URL: http://fedorahosted.org/pyparted +URL: https://github.com/dcantrell/%{name} -Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz +Source0: https://github.com/dcantrell/%{name}/releases/%{name}-%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel @@ -43,6 +43,9 @@ rm -rf %{buildroot} %{python_sitearch}/%{name}-%{version}-*.egg-info %changelog +* Wed Nov 26 2014 David Cantrell - 1:3.10.2-1 +- Upgrade to pyparted-3.10.2 + * Sun Aug 17 2014 Fedora Release Engineering - 1:3.9.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild diff --git a/sources b/sources index 001af75..3d6e5a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9cf098ec38b9fe0af98782671027c5d6 pyparted-3.9.5.tar.gz +7d5cde0e75c3ae92ebf76dec2e68da7b pyparted-pyparted-3.10.2.tar.gz From 6fb03fbad5143e97603bb50c5fb6a59a76fd1fa0 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 26 Nov 2014 09:48:18 -0500 Subject: [PATCH 02/22] Upgrade to pyparted-3.10.2 --- pyparted.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyparted.spec b/pyparted.spec index 30e7c6e..2a8c40f 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -20,7 +20,7 @@ Python module for the parted library. It is used for manipulating partition tables. %prep -%setup -q +%setup -q -n %{name}-%{name}-%{version} %build make %{?_smp_mflags} From d13f4de811e168460cfd76eb86abd5e9789b08e2 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 26 Nov 2014 10:19:59 -0500 Subject: [PATCH 03/22] Upgrade to pyparted-3.10.2 --- pyparted.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyparted.spec b/pyparted.spec index 2a8c40f..d64bd9e 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -37,8 +37,8 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc AUTHORS BUGS COPYING ChangeLog NEWS README TODO -%{python_sitearch}/_pedmodule.so +%doc AUTHORS BUGS COPYING NEWS README TODO +%{python_sitearch}/_ped.so %{python_sitearch}/parted %{python_sitearch}/%{name}-%{version}-*.egg-info From b3664bfc34877e863418cb28f8bba808cacb3819 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 1 Dec 2014 23:51:06 -0800 Subject: [PATCH 04/22] Revert "Upgrade to pyparted-3.10.2" this reverts the previous three commits and returns us to 3.9.5-2 state. 3.10 should never have landed in f21, we need a 3.9.5 with the single required new function backported. --- .gitignore | 1 - pyparted.spec | 17 +++++++---------- sources | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 9de9b33..f0061cb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ pyparted-3.9.2.tar.gz /pyparted-3.9.3.tar.gz /pyparted-3.9.4.tar.gz /pyparted-3.9.5.tar.gz -/pyparted-pyparted-3.10.2.tar.gz diff --git a/pyparted.spec b/pyparted.spec index d64bd9e..0a31842 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -1,13 +1,13 @@ Summary: Python module for GNU parted Name: pyparted Epoch: 1 -Version: 3.10.2 -Release: 1%{?dist} +Version: 3.9.5 +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Libraries -URL: https://github.com/dcantrell/%{name} +URL: http://fedorahosted.org/pyparted -Source0: https://github.com/dcantrell/%{name}/releases/%{name}-%{name}-%{version}.tar.gz +Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel @@ -20,7 +20,7 @@ Python module for the parted library. It is used for manipulating partition tables. %prep -%setup -q -n %{name}-%{name}-%{version} +%setup -q %build make %{?_smp_mflags} @@ -37,15 +37,12 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc AUTHORS BUGS COPYING NEWS README TODO -%{python_sitearch}/_ped.so +%doc AUTHORS BUGS COPYING ChangeLog NEWS README TODO +%{python_sitearch}/_pedmodule.so %{python_sitearch}/parted %{python_sitearch}/%{name}-%{version}-*.egg-info %changelog -* Wed Nov 26 2014 David Cantrell - 1:3.10.2-1 -- Upgrade to pyparted-3.10.2 - * Sun Aug 17 2014 Fedora Release Engineering - 1:3.9.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild diff --git a/sources b/sources index 3d6e5a8..001af75 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7d5cde0e75c3ae92ebf76dec2e68da7b pyparted-pyparted-3.10.2.tar.gz +9cf098ec38b9fe0af98782671027c5d6 pyparted-3.9.5.tar.gz From 621cb0c7aa413fffb09ba7d67587fe148d80da4a Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 2 Dec 2014 00:14:53 -0800 Subject: [PATCH 05/22] backport resetNumber() function from 3.10 (for RHBZ #1166598) --- add_partition_reset_num_method.patch | 82 ++++++++++++++++++++++++++++ pyparted.spec | 9 ++- 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 add_partition_reset_num_method.patch diff --git a/add_partition_reset_num_method.patch b/add_partition_reset_num_method.patch new file mode 100644 index 0000000..39b4420 --- /dev/null +++ b/add_partition_reset_num_method.patch @@ -0,0 +1,82 @@ +diff --git a/include/docstrings/pydisk.h b/include/docstrings/pydisk.h +index 77a399f..f9f6f09 100644 +--- a/include/docstrings/pydisk.h ++++ b/include/docstrings/pydisk.h +@@ -82,6 +82,12 @@ PyDoc_STRVAR(partition_get_path_doc, + "level. For instance, on Linux this could return '/dev/sda' for a partition.\n" + "If an error occurs, _ped.PartitionException is raised."); + ++PyDoc_STRVAR(partition_reset_num_doc, ++"reset_num(self) -> boolean\n\n" ++"Reset the partition's number to value allowing it to be set correctly when\n" ++"the partition is added to _ped.PartedDisk. The returned value means\n" ++"success/failure"); ++ + PyDoc_STRVAR(disk_duplicate_doc, + "duplicate(self) -> Disk\n\n" + "Return a new Disk that is a copy of self. This method raises\n" +diff --git a/include/pydisk.h b/include/pydisk.h +index 6f6bff7..ef37a58 100644 +--- a/include/pydisk.h ++++ b/include/pydisk.h +@@ -134,6 +134,7 @@ PyObject *py_ped_partition_set_name(_ped_Partition *, PyObject *); + PyObject *py_ped_partition_get_name(_ped_Partition *, PyObject *); + PyObject *py_ped_partition_is_busy(_ped_Partition *, PyObject *); + PyObject *py_ped_partition_get_path(_ped_Partition *, PyObject *); ++PyObject *py_ped_partition_reset_num(_ped_Partition *, PyObject *); + PyObject *py_ped_partition_type_get_name(PyObject *, PyObject *); + PyObject *py_ped_partition_flag_get_name(PyObject *, PyObject *); + PyObject *py_ped_partition_flag_get_by_name(PyObject *, PyObject *); +diff --git a/include/typeobjects/pydisk.h b/include/typeobjects/pydisk.h +index 3cadf7d..3adca3f 100644 +--- a/include/typeobjects/pydisk.h ++++ b/include/typeobjects/pydisk.h +@@ -60,6 +60,8 @@ static PyMethodDef _ped_Partition_methods[] = { + partition_is_busy_doc}, + {"get_path", (PyCFunction) py_ped_partition_get_path, METH_VARARGS, + partition_get_path_doc}, ++ {"reset_num", (PyCFunction) py_ped_partition_reset_num, METH_VARARGS, ++ partition_reset_num_doc}, + {NULL} + }; + +diff --git a/src/parted/partition.py b/src/parted/partition.py +index ee3e2d0..c91dbc4 100644 +--- a/src/parted/partition.py ++++ b/src/parted/partition.py +@@ -246,6 +246,10 @@ class Partition(object): + For internal module use only.""" + return self.__partition + ++ def resetNumber(self): ++ """Reset the partition's number to default""" ++ return self.__partition.reset_num() ++ + # collect all partition flags and store them in a hash + partitionFlag = {} + __flag = _ped.partition_flag_next(0) +diff --git a/src/pydisk.c b/src/pydisk.c +index 5a525a1..aea6282 100644 +--- a/src/pydisk.c ++++ b/src/pydisk.c +@@ -1377,6 +1377,20 @@ PyObject *py_ped_partition_get_path(_ped_Partition *s, PyObject *args) { + return PyString_FromString(ret); + } + ++PyObject *py_ped_partition_reset_num(_ped_Partition *s, PyObject *args) { ++ PedPartition *part = NULL; ++ ++ part = _ped_Partition2PedPartition(s); ++ if (part == NULL) { ++ Py_RETURN_FALSE; ++ } ++ ++ part->num = -1; ++ ++ Py_RETURN_TRUE; ++} ++ ++ + PyObject *py_ped_partition_type_get_name(PyObject *s, PyObject *args) { + long type; + char *ret = NULL; diff --git a/pyparted.spec b/pyparted.spec index 0a31842..2635853 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -2,12 +2,15 @@ Summary: Python module for GNU parted Name: pyparted Epoch: 1 Version: 3.9.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://fedorahosted.org/pyparted Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz +# https://github.com/dcantrell/pyparted/commit/3aaf84837822ae2df044b583b52c5940ce01482c +# backported to 3.9.5 by vpodzime. Needed for blivet fix for RHBZ #1166598 +Patch0: add_partition_reset_num_method.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel @@ -21,6 +24,7 @@ partition tables. %prep %setup -q +%patch0 -p1 %build make %{?_smp_mflags} @@ -43,6 +47,9 @@ rm -rf %{buildroot} %{python_sitearch}/%{name}-%{version}-*.egg-info %changelog +* Mon Dec 01 2014 Adam Williamson - 1:3.9.5-3 +- backport resetNumber() function from 3.10 (needed to fix RHBZ #1166598) + * Sun Aug 17 2014 Fedora Release Engineering - 1:3.9.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From a50fa115855d47c584429db7f42f45734e9e3aed Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 13:22:54 -0400 Subject: [PATCH 06/22] Add Python 3 subpackage (#1196402) --- pyparted.spec | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/pyparted.spec b/pyparted.spec index 2635853..f19daeb 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -1,8 +1,10 @@ +%define with_python3 1 + Summary: Python module for GNU parted Name: pyparted Epoch: 1 Version: 3.9.5 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://fedorahosted.org/pyparted @@ -14,6 +16,9 @@ Patch0: add_partition_reset_num_method.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel +%if 0%{?with_python3} +BuildRequires: python3-devel +%endif BuildRequires: parted-devel >= 3.1-14 BuildRequires: pkgconfig BuildRequires: e2fsprogs @@ -22,20 +27,53 @@ BuildRequires: e2fsprogs Python module for the parted library. It is used for manipulating partition tables. +%if 0%{?with_python3} +%package -n python3-pyparted +Summary: Python 3 module for GNU parted +Group: System Environment/Libraries + +%description -n python3-pyparted +Python module for the parted library. It is used for manipulating +partition tables. This package provides Python 3 bindings for parted. +%endif + %prep %setup -q %patch0 -p1 +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + %build make %{?_smp_mflags} +%if 0%{?with_python3} +pushd %{py3dir} +PYTHON=python3 make %{?_smp_mflags} +popd +%endif + %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} +%if 0%{?with_python3} +pushd %{py3dir} +PYTHON=python3 make install DESTDIR=%{buildroot} +popd +%endif + %check make test +%if 0%{?with_python3} +pushd %{py3dir} +PYTHON=python3 make test +popd +%endif + %clean rm -rf %{buildroot} @@ -46,7 +84,19 @@ rm -rf %{buildroot} %{python_sitearch}/parted %{python_sitearch}/%{name}-%{version}-*.egg-info +%if 0%{?with_python3} +%files -n python3-pyparted +%defattr(-,root,root,-) +%doc AUTHORS BUGS COPYING NEWS README TODO +%{python3_sitearch}/_ped.*.so +%{python3_sitearch}/parted +%{python3_sitearch}/%{name}-%{version}-*.egg-info +%endif + %changelog +* Fri Apr 24 2015 David Cantrell - 1:3.9.5-4 +- Add Python 3 subpackage (#1196402) + * Mon Dec 01 2014 Adam Williamson - 1:3.9.5-3 - backport resetNumber() function from 3.10 (needed to fix RHBZ #1166598) From 0d03a735ddc973fc0b4a2fe877757fead6fc6de2 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 14:04:12 -0400 Subject: [PATCH 07/22] Add Python 3 subpackage (#1196402) --- pyparted.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyparted.spec b/pyparted.spec index f19daeb..c554333 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -13,6 +13,7 @@ Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz # https://github.com/dcantrell/pyparted/commit/3aaf84837822ae2df044b583b52c5940ce01482c # backported to 3.9.5 by vpodzime. Needed for blivet fix for RHBZ #1166598 Patch0: add_partition_reset_num_method.patch +Patch1: pyparted-3.9.5-rhbz1196402.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel @@ -40,6 +41,7 @@ partition tables. This package provides Python 3 bindings for parted. %prep %setup -q %patch0 -p1 +%patch1 -p1 %if 0%{?with_python3} rm -rf %{py3dir} From 5643ba66b0df6e2136d3944bf224045bed5a3e85 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 14:07:12 -0400 Subject: [PATCH 08/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pyparted-3.9.5-rhbz1196402.patch diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch new file mode 100644 index 0000000..4bebdec --- /dev/null +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -0,0 +1,27 @@ +diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py +--- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 ++++ pyparted-3.9.5/setup.py 2015-04-24 14:03:10.983767442 -0400 +@@ -17,7 +17,7 @@ + # + # Author(s): David Cantrell + +-import commands ++import subprocess + import glob + import os + import platform +@@ -43,12 +43,12 @@ if python_version[0] < need_python_versi + # http://code.activestate.com/recipes/502261-python-distutils-pkg-config/ + def pkgconfig(*packages, **kwargs): + flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} +- for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): ++ for token in subprocess.check_output(["pkg-config", "--libs", "--cflags"] + list(packages)).decode('utf-8').split(): + kwargs.setdefault(flag_map.get(token[:2]), []).append(token[2:]) + return kwargs + + def check_mod_version(module, version): +- modversion = commands.getoutput("pkg-config --modversion %s" % module) ++ modversion = subprocess.check_output(["pkg-config", "--modversion", module]) + if not float(modversion) >= float(version): + sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,)) + sys.exit(1) From a1060dff7a2d6ad0277a9fe7292a0923a0c6dfaa Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 14:17:11 -0400 Subject: [PATCH 09/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 4bebdec..1dc0b90 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -1,6 +1,6 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py --- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 -+++ pyparted-3.9.5/setup.py 2015-04-24 14:03:10.983767442 -0400 ++++ pyparted-3.9.5/setup.py 2015-04-24 14:16:59.522767442 -0400 @@ -17,7 +17,7 @@ # # Author(s): David Cantrell @@ -10,7 +10,17 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py import glob import os import platform -@@ -43,12 +43,12 @@ if python_version[0] < need_python_versi +@@ -34,8 +34,7 @@ python_version = platform.python_version + need_libparted_version = '3.1' + need_python_version = [2, 7] + +-if python_version[0] < need_python_version[0] or \ +- python_version[1] < need_python_version[1]: ++if python_version < need_python_version: + raise RuntimeError("pyparted requires Python version %d.%d or higher" + % (need_python_version[0], need_python_version[1],)) + +@@ -43,12 +42,12 @@ if python_version[0] < need_python_versi # http://code.activestate.com/recipes/502261-python-distutils-pkg-config/ def pkgconfig(*packages, **kwargs): flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} From 3a3ef55da8f30601542f57ffeea22bc720424c6c Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 14:22:08 -0400 Subject: [PATCH 10/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 1dc0b90..54754d0 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -1,6 +1,6 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py --- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 -+++ pyparted-3.9.5/setup.py 2015-04-24 14:16:59.522767442 -0400 ++++ pyparted-3.9.5/setup.py 2015-04-24 14:21:58.264767442 -0400 @@ -17,7 +17,7 @@ # # Author(s): David Cantrell @@ -10,7 +10,13 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py import glob import os import platform -@@ -34,8 +34,7 @@ python_version = platform.python_version +@@ -29,13 +29,12 @@ from distutils.core import setup + from distutils.core import Extension + + pyparted_version = '3.9.5' +-python_version = platform.python_version_tuple() ++python_version = sys.version_info + need_libparted_version = '3.1' need_python_version = [2, 7] From f89295ccd26b19b6e4b7058f913cb2946f1784f2 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 14:30:17 -0400 Subject: [PATCH 11/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 54754d0..f352ef5 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -1,6 +1,6 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py --- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 -+++ pyparted-3.9.5/setup.py 2015-04-24 14:21:58.264767442 -0400 ++++ pyparted-3.9.5/setup.py 2015-04-24 14:30:06.641767442 -0400 @@ -17,7 +17,7 @@ # # Author(s): David Cantrell @@ -18,7 +18,8 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py +python_version = sys.version_info need_libparted_version = '3.1' - need_python_version = [2, 7] +-need_python_version = [2, 7] ++need_python_version = (2, 7) -if python_version[0] < need_python_version[0] or \ - python_version[1] < need_python_version[1]: From c58dcd32b103251b561703ebe8518bb3062f93e2 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 14:47:26 -0400 Subject: [PATCH 12/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 157 ++++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 3 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index f352ef5..8b093cf 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -1,6 +1,39 @@ -diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py ---- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 -+++ pyparted-3.9.5/setup.py 2015-04-24 14:30:06.641767442 -0400 +diff -up pyparted-3.9.5/include/pytimer.h.orig pyparted-3.9.5/include/pytimer.h +--- pyparted-3.9.5/include/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/pytimer.h 2015-04-24 14:47:07.086767442 -0400 +@@ -52,7 +52,6 @@ typedef struct { + } _ped_Timer; + + void _ped_Timer_dealloc(_ped_Timer *); +-int _ped_Timer_compare(_ped_Timer *, PyObject *); + PyObject *_ped_Timer_richcompare(_ped_Timer *, PyObject *, int); + PyObject *_ped_Timer_str(_ped_Timer *); + int _ped_Timer_traverse(_ped_Timer *, visitproc, void *); +diff -up pyparted-3.9.5/include/typeobjects/pytimer.h.orig pyparted-3.9.5/include/typeobjects/pytimer.h +--- pyparted-3.9.5/include/typeobjects/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/typeobjects/pytimer.h 2015-04-24 14:46:46.316767442 -0400 +@@ -68,7 +68,6 @@ PyTypeObject _ped_Timer_Type_obj = { + .tp_dealloc = (destructor) _ped_Timer_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Timer_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +diff -up pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h.orig pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h +--- pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h 2015-04-24 14:46:46.316767442 -0400 +@@ -68,7 +68,6 @@ PyTypeObject _ped_Timer_Type_obj = { + .tp_dealloc = (destructor) _ped_Timer_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Timer_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +diff -up pyparted-3.9.5/%{py3dir}/setup.py.orig pyparted-3.9.5/%{py3dir}/setup.py +--- pyparted-3.9.5/%{py3dir}/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 ++++ pyparted-3.9.5/%{py3dir}/setup.py 2015-04-24 14:46:46.316767442 -0400 @@ -17,7 +17,7 @@ # # Author(s): David Cantrell @@ -42,3 +75,121 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py if not float(modversion) >= float(version): sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,)) sys.exit(1) +diff -up pyparted-3.9.5/%{py3dir}/src/pytimer.c.orig pyparted-3.9.5/%{py3dir}/src/pytimer.c +--- pyparted-3.9.5/%{py3dir}/src/pytimer.c.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/%{py3dir}/src/pytimer.c 2015-04-24 14:46:46.316767442 -0400 +@@ -35,33 +35,6 @@ void _ped_Timer_dealloc(_ped_Timer *self + PyObject_GC_Del(self); + } + +-int _ped_Timer_compare(_ped_Timer *self, PyObject *obj) { +- _ped_Timer *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Timer_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Timer"); +- return -1; +- } +- +- comp = (_ped_Timer *) obj; +- if ((self->frac == comp->frac) && +- (self->start == comp->start) && +- (self->now == comp->now) && +- (self->predicted_end == comp->predicted_end) && +- (!strcmp(self->state_name, comp->state_name)) && +- (self->handler == comp->handler) && +- (self->context == comp->context)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_Timer_richcompare(_ped_Timer *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { +diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py +--- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 ++++ pyparted-3.9.5/setup.py 2015-04-24 14:46:46.316767442 -0400 +@@ -17,7 +17,7 @@ + # + # Author(s): David Cantrell + +-import commands ++import subprocess + import glob + import os + import platform +@@ -29,13 +29,12 @@ from distutils.core import setup + from distutils.core import Extension + + pyparted_version = '3.9.5' +-python_version = platform.python_version_tuple() ++python_version = sys.version_info + + need_libparted_version = '3.1' +-need_python_version = [2, 7] ++need_python_version = (2, 7) + +-if python_version[0] < need_python_version[0] or \ +- python_version[1] < need_python_version[1]: ++if python_version < need_python_version: + raise RuntimeError("pyparted requires Python version %d.%d or higher" + % (need_python_version[0], need_python_version[1],)) + +@@ -43,12 +42,12 @@ if python_version[0] < need_python_versi + # http://code.activestate.com/recipes/502261-python-distutils-pkg-config/ + def pkgconfig(*packages, **kwargs): + flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} +- for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): ++ for token in subprocess.check_output(["pkg-config", "--libs", "--cflags"] + list(packages)).decode('utf-8').split(): + kwargs.setdefault(flag_map.get(token[:2]), []).append(token[2:]) + return kwargs + + def check_mod_version(module, version): +- modversion = commands.getoutput("pkg-config --modversion %s" % module) ++ modversion = subprocess.check_output(["pkg-config", "--modversion", module]) + if not float(modversion) >= float(version): + sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,)) + sys.exit(1) +diff -up pyparted-3.9.5/src/pytimer.c.orig pyparted-3.9.5/src/pytimer.c +--- pyparted-3.9.5/src/pytimer.c.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/pytimer.c 2015-04-24 14:46:46.316767442 -0400 +@@ -35,33 +35,6 @@ void _ped_Timer_dealloc(_ped_Timer *self + PyObject_GC_Del(self); + } + +-int _ped_Timer_compare(_ped_Timer *self, PyObject *obj) { +- _ped_Timer *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Timer_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Timer"); +- return -1; +- } +- +- comp = (_ped_Timer *) obj; +- if ((self->frac == comp->frac) && +- (self->start == comp->start) && +- (self->now == comp->now) && +- (self->predicted_end == comp->predicted_end) && +- (!strcmp(self->state_name, comp->state_name)) && +- (self->handler == comp->handler) && +- (self->context == comp->context)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_Timer_richcompare(_ped_Timer *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { From a2b9d33dcd672eb3efe6fc28c481649fefa160da Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 14:53:05 -0400 Subject: [PATCH 13/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 92 -------------------------------- 1 file changed, 92 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 8b093cf..48c5afd 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -20,98 +20,6 @@ diff -up pyparted-3.9.5/include/typeobjects/pytimer.h.orig pyparted-3.9.5/includ /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ -diff -up pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h.orig pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h ---- pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/%{py3dir}/include/typeobjects/pytimer.h 2015-04-24 14:46:46.316767442 -0400 -@@ -68,7 +68,6 @@ PyTypeObject _ped_Timer_Type_obj = { - .tp_dealloc = (destructor) _ped_Timer_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Timer_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -diff -up pyparted-3.9.5/%{py3dir}/setup.py.orig pyparted-3.9.5/%{py3dir}/setup.py ---- pyparted-3.9.5/%{py3dir}/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 -+++ pyparted-3.9.5/%{py3dir}/setup.py 2015-04-24 14:46:46.316767442 -0400 -@@ -17,7 +17,7 @@ - # - # Author(s): David Cantrell - --import commands -+import subprocess - import glob - import os - import platform -@@ -29,13 +29,12 @@ from distutils.core import setup - from distutils.core import Extension - - pyparted_version = '3.9.5' --python_version = platform.python_version_tuple() -+python_version = sys.version_info - - need_libparted_version = '3.1' --need_python_version = [2, 7] -+need_python_version = (2, 7) - --if python_version[0] < need_python_version[0] or \ -- python_version[1] < need_python_version[1]: -+if python_version < need_python_version: - raise RuntimeError("pyparted requires Python version %d.%d or higher" - % (need_python_version[0], need_python_version[1],)) - -@@ -43,12 +42,12 @@ if python_version[0] < need_python_versi - # http://code.activestate.com/recipes/502261-python-distutils-pkg-config/ - def pkgconfig(*packages, **kwargs): - flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} -- for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): -+ for token in subprocess.check_output(["pkg-config", "--libs", "--cflags"] + list(packages)).decode('utf-8').split(): - kwargs.setdefault(flag_map.get(token[:2]), []).append(token[2:]) - return kwargs - - def check_mod_version(module, version): -- modversion = commands.getoutput("pkg-config --modversion %s" % module) -+ modversion = subprocess.check_output(["pkg-config", "--modversion", module]) - if not float(modversion) >= float(version): - sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,)) - sys.exit(1) -diff -up pyparted-3.9.5/%{py3dir}/src/pytimer.c.orig pyparted-3.9.5/%{py3dir}/src/pytimer.c ---- pyparted-3.9.5/%{py3dir}/src/pytimer.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/%{py3dir}/src/pytimer.c 2015-04-24 14:46:46.316767442 -0400 -@@ -35,33 +35,6 @@ void _ped_Timer_dealloc(_ped_Timer *self - PyObject_GC_Del(self); - } - --int _ped_Timer_compare(_ped_Timer *self, PyObject *obj) { -- _ped_Timer *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Timer_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Timer"); -- return -1; -- } -- -- comp = (_ped_Timer *) obj; -- if ((self->frac == comp->frac) && -- (self->start == comp->start) && -- (self->now == comp->now) && -- (self->predicted_end == comp->predicted_end) && -- (!strcmp(self->state_name, comp->state_name)) && -- (self->handler == comp->handler) && -- (self->context == comp->context)) { -- return 0; -- } else { -- return 1; -- } --} -- - PyObject *_ped_Timer_richcompare(_ped_Timer *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py --- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 +++ pyparted-3.9.5/setup.py 2015-04-24 14:46:46.316767442 -0400 From 18fef2b4f38cb9f0f536e91bb1ba409262116d4a Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 15:05:46 -0400 Subject: [PATCH 14/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 472 +++++++++++++++++++++++++++++++ 1 file changed, 472 insertions(+) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 48c5afd..2bed97b 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -1,3 +1,101 @@ +diff -up pyparted-3.9.5/include/pyconstraint.h.orig pyparted-3.9.5/include/pyconstraint.h +--- pyparted-3.9.5/include/pyconstraint.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/pyconstraint.h 2015-04-24 15:01:00.385767442 -0400 +@@ -55,7 +55,6 @@ typedef struct { + } _ped_Constraint; + + void _ped_Constraint_dealloc(_ped_Constraint *); +-int _ped_Constraint_compare(_ped_Constraint *, PyObject *); + PyObject *_ped_Constraint_richcompare(_ped_Constraint *, PyObject *, int); + PyObject *_ped_Constraint_str(_ped_Constraint *); + int _ped_Constraint_traverse(_ped_Constraint *, visitproc, void *); +diff -up pyparted-3.9.5/include/pydevice.h.orig pyparted-3.9.5/include/pydevice.h +--- pyparted-3.9.5/include/pydevice.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/pydevice.h 2015-04-24 15:03:54.071767442 -0400 +@@ -39,7 +39,6 @@ typedef struct { + } _ped_CHSGeometry; + + void _ped_CHSGeometry_dealloc(_ped_CHSGeometry *); +-int _ped_CHSGeometry_compare(_ped_CHSGeometry *, PyObject *); + PyObject *_ped_CHSGeometry_richcompare(_ped_CHSGeometry *, PyObject *, int); + PyObject *_ped_CHSGeometry_str(_ped_CHSGeometry *); + int _ped_CHSGeometry_traverse(_ped_CHSGeometry *, visitproc, void *); +@@ -72,7 +71,6 @@ typedef struct { + } _ped_Device; + + void _ped_Device_dealloc(_ped_Device *); +-int _ped_Device_compare(_ped_Device *, PyObject *); + PyObject *_ped_Device_richcompare(_ped_Device *, PyObject *, int); + PyObject *_ped_Device_str(_ped_Device *); + int _ped_Device_traverse(_ped_Device *, visitproc, void *); +diff -up pyparted-3.9.5/include/pydisk.h.orig pyparted-3.9.5/include/pydisk.h +--- pyparted-3.9.5/include/pydisk.h.orig 2015-04-24 14:46:46.311767442 -0400 ++++ pyparted-3.9.5/include/pydisk.h 2015-04-24 15:04:05.623767442 -0400 +@@ -47,7 +47,6 @@ typedef struct { + } _ped_Partition; + + void _ped_Partition_dealloc(_ped_Partition *); +-int _ped_Partition_compare(_ped_Partition *, PyObject *); + PyObject *_ped_Partition_richcompare(_ped_Partition *, PyObject *, int); + PyObject *_ped_Partition_str(_ped_Partition *); + int _ped_Partition_traverse(_ped_Partition *, visitproc, void *); +@@ -71,7 +70,6 @@ typedef struct { + } _ped_Disk; + + void _ped_Disk_dealloc(_ped_Disk *); +-int _ped_Disk_compare(_ped_Disk *, PyObject *); + PyObject *_ped_Disk_richcompare(_ped_Disk *, PyObject *, int); + PyObject *_ped_Disk_str(_ped_Disk *); + int _ped_Disk_traverse(_ped_Disk *, visitproc, void *); +@@ -90,7 +88,6 @@ typedef struct { + } _ped_DiskType; + + void _ped_DiskType_dealloc(_ped_DiskType *); +-int _ped_DiskType_compare(_ped_DiskType *, PyObject *); + PyObject *_ped_DiskType_richcompare(_ped_DiskType *, PyObject *, int); + PyObject *_ped_DiskType_str(_ped_DiskType *); + int _ped_DiskType_traverse(_ped_DiskType *, visitproc, void *); +diff -up pyparted-3.9.5/include/pyfilesys.h.orig pyparted-3.9.5/include/pyfilesys.h +--- pyparted-3.9.5/include/pyfilesys.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/pyfilesys.h 2015-04-24 15:04:12.455767442 -0400 +@@ -48,7 +48,6 @@ typedef struct { + } _ped_FileSystemType; + + void _ped_FileSystemType_dealloc(_ped_FileSystemType *); +-int _ped_FileSystemType_compare(_ped_FileSystemType *, PyObject *); + PyObject *_ped_FileSystemType_richcompare(_ped_FileSystemType *, PyObject *, + int); + PyObject *_ped_FileSystemType_str(_ped_FileSystemType *); +@@ -72,7 +71,6 @@ typedef struct { + } _ped_FileSystem; + + void _ped_FileSystem_dealloc(_ped_FileSystem *); +-int _ped_FileSystem_compare(_ped_FileSystem *, PyObject *); + PyObject *_ped_FileSystem_richcompare(_ped_FileSystem *, PyObject *, int); + PyObject *_ped_FileSystem_str(_ped_FileSystem *); + int _ped_FileSystem_traverse(_ped_FileSystem *, visitproc, void *); +diff -up pyparted-3.9.5/include/pygeom.h.orig pyparted-3.9.5/include/pygeom.h +--- pyparted-3.9.5/include/pygeom.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/pygeom.h 2015-04-24 15:04:17.463767442 -0400 +@@ -58,7 +58,6 @@ typedef struct { + } _ped_Geometry; + + void _ped_Geometry_dealloc(_ped_Geometry *); +-int _ped_Geometry_compare(_ped_Geometry *, PyObject *); + PyObject *_ped_Geometry_richcompare(_ped_Geometry *, PyObject *, int); + PyObject *_ped_Geometry_str(_ped_Geometry *); + int _ped_Geometry_traverse(_ped_Geometry *, visitproc, void *); +diff -up pyparted-3.9.5/include/pynatmath.h.orig pyparted-3.9.5/include/pynatmath.h +--- pyparted-3.9.5/include/pynatmath.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/pynatmath.h 2015-04-24 15:04:21.471767442 -0400 +@@ -47,7 +47,6 @@ typedef struct { + } _ped_Alignment; + + void _ped_Alignment_dealloc(_ped_Alignment *); +-int _ped_Alignment_compare(_ped_Alignment *, PyObject *); + PyObject *_ped_Alignment_richcompare(_ped_Alignment *, PyObject *, int); + PyObject *_ped_Alignment_str(_ped_Alignment *); + int _ped_Alignment_traverse(_ped_Alignment *, visitproc, void *); diff -up pyparted-3.9.5/include/pytimer.h.orig pyparted-3.9.5/include/pytimer.h --- pyparted-3.9.5/include/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 +++ pyparted-3.9.5/include/pytimer.h 2015-04-24 14:47:07.086767442 -0400 @@ -9,6 +107,105 @@ diff -up pyparted-3.9.5/include/pytimer.h.orig pyparted-3.9.5/include/pytimer.h PyObject *_ped_Timer_richcompare(_ped_Timer *, PyObject *, int); PyObject *_ped_Timer_str(_ped_Timer *); int _ped_Timer_traverse(_ped_Timer *, visitproc, void *); +diff -up pyparted-3.9.5/include/pyunit.h.orig pyparted-3.9.5/include/pyunit.h +diff -up pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig pyparted-3.9.5/include/typeobjects/pyconstraint.h +--- pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/typeobjects/pyconstraint.h 2015-04-24 15:00:47.089767442 -0400 +@@ -73,7 +73,6 @@ PyTypeObject _ped_Constraint_Type_obj = + .tp_dealloc = (destructor) _ped_Constraint_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Constraint_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/include/typeobjects/pydevice.h +--- pyparted-3.9.5/include/typeobjects/pydevice.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/typeobjects/pydevice.h 2015-04-24 15:05:02.927767442 -0400 +@@ -58,7 +58,6 @@ PyTypeObject _ped_CHSGeometry_Type_obj = + .tp_dealloc = (destructor) _ped_CHSGeometry_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_CHSGeometry_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +@@ -221,7 +220,6 @@ PyTypeObject _ped_Device_Type_obj = { + .tp_dealloc = (destructor) _ped_Device_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Device_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +diff -up pyparted-3.9.5/include/typeobjects/pydisk.h.orig pyparted-3.9.5/include/typeobjects/pydisk.h +--- pyparted-3.9.5/include/typeobjects/pydisk.h.orig 2015-04-24 14:46:46.312767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pydisk.h 2015-04-24 15:05:10.159767442 -0400 +@@ -81,7 +81,6 @@ PyTypeObject _ped_Partition_Type_obj = { + .tp_dealloc = (destructor) _ped_Partition_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Partition_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +@@ -221,7 +220,6 @@ PyTypeObject _ped_Disk_Type_obj = { + .tp_dealloc = (destructor) _ped_Disk_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Disk_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +@@ -286,7 +284,6 @@ PyTypeObject _ped_DiskType_Type_obj = { + .tp_dealloc = (destructor) _ped_DiskType_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_DiskType_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +diff -up pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig pyparted-3.9.5/include/typeobjects/pyfilesys.h +--- pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/typeobjects/pyfilesys.h 2015-04-24 15:05:17.039767442 -0400 +@@ -51,7 +51,6 @@ PyTypeObject _ped_FileSystemType_Type_ob + .tp_dealloc = (destructor) _ped_FileSystemType_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_FileSystemType_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +@@ -106,7 +105,6 @@ PyTypeObject _ped_FileSystem_Type_obj = + .tp_dealloc = (destructor) _ped_FileSystem_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_FileSystemType_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +diff -up pyparted-3.9.5/include/typeobjects/pygeom.h.orig pyparted-3.9.5/include/typeobjects/pygeom.h +--- pyparted-3.9.5/include/typeobjects/pygeom.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/typeobjects/pygeom.h 2015-04-24 15:05:21.399767442 -0400 +@@ -91,7 +91,6 @@ PyTypeObject _ped_Geometry_Type_obj = { + .tp_dealloc = (destructor) _ped_Geometry_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Geometry_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ +diff -up pyparted-3.9.5/include/typeobjects/pynatmath.h.orig pyparted-3.9.5/include/typeobjects/pynatmath.h +--- pyparted-3.9.5/include/typeobjects/pynatmath.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/typeobjects/pynatmath.h 2015-04-24 15:05:25.518767442 -0400 +@@ -67,7 +67,6 @@ PyTypeObject _ped_Alignment_Type_obj = { + .tp_dealloc = (destructor) _ped_Alignment_dealloc, + /* .tp_getattr = XXX */ + /* .tp_setattr = XXX */ +- .tp_compare = (cmpfunc) _ped_Alignment_compare, + /* .tp_repr = XXX */ + /* .tp_as_number = XXX */ + /* .tp_as_sequence = XXX */ diff -up pyparted-3.9.5/include/typeobjects/pytimer.h.orig pyparted-3.9.5/include/typeobjects/pytimer.h --- pyparted-3.9.5/include/typeobjects/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 +++ pyparted-3.9.5/include/typeobjects/pytimer.h 2015-04-24 14:46:46.316767442 -0400 @@ -64,6 +261,280 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py if not float(modversion) >= float(version): sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,)) sys.exit(1) +diff -up pyparted-3.9.5/src/pyconstraint.c.orig pyparted-3.9.5/src/pyconstraint.c +--- pyparted-3.9.5/src/pyconstraint.c.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/pyconstraint.c 2015-04-24 15:01:20.001767442 -0400 +@@ -50,32 +50,6 @@ void _ped_Constraint_dealloc(_ped_Constr + PyObject_GC_Del(self); + } + +-int _ped_Constraint_compare(_ped_Constraint *self, PyObject *obj) { +- _ped_Constraint *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Constraint_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Constraint"); +- return -1; +- } +- +- comp = (_ped_Constraint *) obj; +- if ((_ped_Alignment_Type_obj.tp_richcompare(self->start_align, comp->start_align, Py_EQ)) && +- (_ped_Alignment_Type_obj.tp_richcompare(self->end_align, comp->end_align, Py_EQ)) && +- (_ped_Geometry_Type_obj.tp_richcompare(self->start_range, comp->start_range, Py_EQ)) && +- (_ped_Geometry_Type_obj.tp_richcompare(self->end_range, comp->end_range, Py_EQ)) && +- (self->min_size == comp->min_size) && +- (self->max_size == comp->max_size)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_Constraint_richcompare(_ped_Constraint *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_Constraint_Type_obj.tp_compare((PyObject *) a, b))) { +diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c +--- pyparted-3.9.5/src/pydevice.c.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/pydevice.c 2015-04-24 15:02:02.152767442 -0400 +@@ -36,29 +36,6 @@ void _ped_CHSGeometry_dealloc(_ped_CHSGe + PyObject_GC_Del(self); + } + +-int _ped_CHSGeometry_compare(_ped_CHSGeometry *self, PyObject *obj) { +- _ped_CHSGeometry *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_CHSGeometry_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.CHSGeometry"); +- return -1; +- } +- +- comp = (_ped_CHSGeometry *) obj; +- if ((self->cylinders == comp->cylinders) && +- (self->heads == comp->heads) && +- (self->sectors == comp->sectors)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_CHSGeometry_richcompare(_ped_CHSGeometry *a, PyObject *b, + int op) { + if (op == Py_EQ) { +@@ -139,41 +116,6 @@ void _ped_Device_dealloc(_ped_Device *se + PyObject_GC_Del(self); + } + +-int _ped_Device_compare(_ped_Device *self, PyObject *obj) { +- _ped_Device *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Device_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Device"); +- return -1; +- } +- +- comp = (_ped_Device *) obj; +- if ((!strcmp(self->model, comp->model)) && +- (!strcmp(self->path, comp->path)) && +- (self->type == comp->type) && +- (self->sector_size == comp->sector_size) && +- (self->phys_sector_size == comp->phys_sector_size) && +- (self->length == comp->length) && +- (self->open_count == comp->open_count) && +- (self->read_only == comp->read_only) && +- (self->external_mode == comp->external_mode) && +- (self->dirty == comp->dirty) && +- (self->boot_dirty == comp->dirty) && +- (_ped_CHSGeometry_Type_obj.tp_richcompare(self->hw_geom, comp->hw_geom, Py_EQ)) && +- (_ped_CHSGeometry_Type_obj.tp_richcompare(self->bios_geom, comp->bios_geom, Py_EQ)) && +- (self->host == comp->host) && +- (self->did == comp->did)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_Device_richcompare(_ped_Device *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_Device_Type_obj.tp_compare((PyObject *) a, b))) { +diff -up pyparted-3.9.5/src/pydisk.c.orig pyparted-3.9.5/src/pydisk.c +--- pyparted-3.9.5/src/pydisk.c.orig 2015-04-24 14:46:46.312767442 -0400 ++++ pyparted-3.9.5/src/pydisk.c 2015-04-24 15:02:16.280767442 -0400 +@@ -47,31 +47,6 @@ void _ped_Partition_dealloc(_ped_Partiti + PyObject_GC_Del(self); + } + +-int _ped_Partition_compare(_ped_Partition *self, PyObject *obj) { +- _ped_Partition *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Partition_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Partition"); +- return -1; +- } +- +- comp = (_ped_Partition *) obj; +- if ((_ped_Disk_Type_obj.tp_richcompare(self->disk, comp->disk, Py_EQ)) && +- (_ped_Geometry_Type_obj.tp_richcompare(self->geom, comp->geom, Py_EQ)) && +- (self->ped_partition->num == comp->ped_partition->num) && +- (self->type == comp->type) && +- (_ped_FileSystemType_Type_obj.tp_richcompare(self->fs_type, comp->fs_type, Py_EQ))) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_Partition_richcompare(_ped_Partition *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_Partition_Type_obj.tp_compare((PyObject *) a, b))) { +diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c +--- pyparted-3.9.5/src/pyfilesys.c.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/pyfilesys.c 2015-04-24 15:02:40.112767442 -0400 +@@ -38,27 +38,6 @@ void _ped_FileSystemType_dealloc(_ped_Fi + PyObject_GC_Del(self); + } + +-int _ped_FileSystemType_compare(_ped_FileSystemType *self, PyObject *obj) { +- _ped_FileSystemType *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_FileSystemType_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.FileSystemType"); +- return -1; +- } +- +- comp = (_ped_FileSystemType *) obj; +- if (!strcmp(self->name, comp->name)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_FileSystemType_richcompare(_ped_FileSystemType *a, PyObject *b, + int op) { + if (op == Py_EQ) { +@@ -137,30 +116,6 @@ void _ped_FileSystem_dealloc(_ped_FileSy + PyObject_GC_Del(self); + } + +-int _ped_FileSystem_compare(_ped_FileSystem *self, PyObject *obj) { +- _ped_FileSystem *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_FileSystem_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.FileSystem"); +- return -1; +- } +- +- comp = (_ped_FileSystem *) obj; +- if ((_ped_FileSystemType_Type_obj.tp_richcompare(self->type, comp->type, Py_EQ)) && +- (_ped_Geometry_Type_obj.tp_richcompare(self->geom, comp->geom, Py_EQ)) && +- (self->checked == comp->checked)) { +- return 0; +- } else { +- return 1; +- } +- +-} +- + PyObject *_ped_FileSystem_richcompare(_ped_FileSystem *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_FileSystem_Type_obj.tp_compare((PyObject *) a, b))) { +diff -up pyparted-3.9.5/src/pygeom.c.orig pyparted-3.9.5/src/pygeom.c +--- pyparted-3.9.5/src/pygeom.c.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/pygeom.c 2015-04-24 15:02:53.984767442 -0400 +@@ -43,30 +43,6 @@ void _ped_Geometry_dealloc(_ped_Geometry + PyObject_GC_Del(self); + } + +-int _ped_Geometry_compare(_ped_Geometry *self, PyObject *obj) { +- _ped_Geometry *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Geometry_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Geometry"); +- return -1; +- } +- +- comp = (_ped_Geometry *) obj; +- if ((_ped_Geometry_Type_obj.tp_richcompare(self->dev, comp->dev, Py_EQ)) && +- (self->ped_geometry->start == comp->ped_geometry->start) && +- (self->ped_geometry->length == comp->ped_geometry->length) && +- (self->ped_geometry->end == comp->ped_geometry->end)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_Geometry_richcompare(_ped_Geometry *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_Geometry_Type_obj.tp_compare((PyObject *) a, b))) { +diff -up pyparted-3.9.5/src/pynatmath.c.orig pyparted-3.9.5/src/pynatmath.c +--- pyparted-3.9.5/src/pynatmath.c.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/pynatmath.c 2015-04-24 15:03:07.816767442 -0400 +@@ -36,28 +36,6 @@ void _ped_Alignment_dealloc(_ped_Alignme + PyObject_GC_Del(self); + } + +-int _ped_Alignment_compare(_ped_Alignment *self, PyObject *obj) { +- _ped_Alignment *comp = NULL; +- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Alignment_Type_obj); +- +- if (PyErr_Occurred()) { +- return -1; +- } +- +- if (!check) { +- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Alignment"); +- return -1; +- } +- +- comp = (_ped_Alignment *) obj; +- if ((self->offset == comp->offset) && +- (self->grain_size == comp->grain_size)) { +- return 0; +- } else { +- return 1; +- } +-} +- + PyObject *_ped_Alignment_richcompare(_ped_Alignment *a, PyObject *b, int op) { + if (op == Py_EQ) { + if (!(_ped_Alignment_Type_obj.tp_compare((PyObject *) a, b))) { diff -up pyparted-3.9.5/src/pytimer.c.orig pyparted-3.9.5/src/pytimer.c --- pyparted-3.9.5/src/pytimer.c.orig 2014-06-24 13:06:32.000000000 -0400 +++ pyparted-3.9.5/src/pytimer.c 2015-04-24 14:46:46.316767442 -0400 @@ -101,3 +572,4 @@ diff -up pyparted-3.9.5/src/pytimer.c.orig pyparted-3.9.5/src/pytimer.c PyObject *_ped_Timer_richcompare(_ped_Timer *a, PyObject *b, int op) { if (op == Py_EQ) { if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { +diff -up pyparted-3.9.5/src/pyunit.c.orig pyparted-3.9.5/src/pyunit.c From 6ce3efea74639f8ef51ac412f7245cde8adebc51 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 15:14:24 -0400 Subject: [PATCH 15/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 155 ++++++++++++++++++++++++++++--- 1 file changed, 144 insertions(+), 11 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 2bed97b..61d84d6 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -1,3 +1,20 @@ +diff -up pyparted-3.9.5/include/convert.h.orig pyparted-3.9.5/include/convert.h +--- pyparted-3.9.5/include/convert.h.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/include/convert.h 2015-04-24 15:14:10.756767442 -0400 +@@ -35,6 +35,13 @@ + #include "pynatmath.h" + #include "pytimer.h" + ++#if PY_MAJOR_VERSION < 3 ++#define PyUnicode_AsUTF8 PyString_AsString ++#define TP_FLAGS (Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_RICHCOMPARE) ++#else ++#define TP_FLAGS (Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE) ++#endif ++ + PedAlignment *_ped_Alignment2PedAlignment(PyObject *); + _ped_Alignment *PedAlignment2_ped_Alignment(PedAlignment *); + diff -up pyparted-3.9.5/include/pyconstraint.h.orig pyparted-3.9.5/include/pyconstraint.h --- pyparted-3.9.5/include/pyconstraint.h.orig 2014-06-24 13:06:32.000000000 -0400 +++ pyparted-3.9.5/include/pyconstraint.h 2015-04-24 15:01:00.385767442 -0400 @@ -110,7 +127,7 @@ diff -up pyparted-3.9.5/include/pytimer.h.orig pyparted-3.9.5/include/pytimer.h diff -up pyparted-3.9.5/include/pyunit.h.orig pyparted-3.9.5/include/pyunit.h diff -up pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig pyparted-3.9.5/include/typeobjects/pyconstraint.h --- pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pyconstraint.h 2015-04-24 15:00:47.089767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pyconstraint.h 2015-04-24 15:10:33.717767442 -0400 @@ -73,7 +73,6 @@ PyTypeObject _ped_Constraint_Type_obj = .tp_dealloc = (destructor) _ped_Constraint_dealloc, /* .tp_getattr = XXX */ @@ -119,9 +136,20 @@ diff -up pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig pyparted-3.9.5/i /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ +@@ -84,9 +83,7 @@ PyTypeObject _ped_Constraint_Type_obj = + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_Constraint_doc, + .tp_traverse = (traverseproc) _ped_Constraint_traverse, + .tp_clear = (inquiry) _ped_Constraint_clear, diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/include/typeobjects/pydevice.h --- pyparted-3.9.5/include/typeobjects/pydevice.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pydevice.h 2015-04-24 15:05:02.927767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pydevice.h 2015-04-24 15:10:53.861767442 -0400 @@ -58,7 +58,6 @@ PyTypeObject _ped_CHSGeometry_Type_obj = .tp_dealloc = (destructor) _ped_CHSGeometry_dealloc, /* .tp_getattr = XXX */ @@ -130,7 +158,17 @@ diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/inclu /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ -@@ -221,7 +220,6 @@ PyTypeObject _ped_Device_Type_obj = { +@@ -69,8 +68,7 @@ PyTypeObject _ped_CHSGeometry_Type_obj = + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_CHSGeometry_doc, + .tp_traverse = (traverseproc) _ped_CHSGeometry_traverse, + .tp_clear = (inquiry) _ped_CHSGeometry_clear, +@@ -221,7 +219,6 @@ PyTypeObject _ped_Device_Type_obj = { .tp_dealloc = (destructor) _ped_Device_dealloc, /* .tp_getattr = XXX */ /* .tp_setattr = XXX */ @@ -138,9 +176,19 @@ diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/inclu /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ +@@ -232,8 +229,7 @@ PyTypeObject _ped_Device_Type_obj = { + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_Device_doc, + .tp_traverse = (traverseproc) _ped_Device_traverse, + .tp_clear = (inquiry) _ped_Device_clear, diff -up pyparted-3.9.5/include/typeobjects/pydisk.h.orig pyparted-3.9.5/include/typeobjects/pydisk.h --- pyparted-3.9.5/include/typeobjects/pydisk.h.orig 2015-04-24 14:46:46.312767442 -0400 -+++ pyparted-3.9.5/include/typeobjects/pydisk.h 2015-04-24 15:05:10.159767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pydisk.h 2015-04-24 15:11:22.317767442 -0400 @@ -81,7 +81,6 @@ PyTypeObject _ped_Partition_Type_obj = { .tp_dealloc = (destructor) _ped_Partition_dealloc, /* .tp_getattr = XXX */ @@ -149,7 +197,18 @@ diff -up pyparted-3.9.5/include/typeobjects/pydisk.h.orig pyparted-3.9.5/include /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ -@@ -221,7 +220,6 @@ PyTypeObject _ped_Disk_Type_obj = { +@@ -92,9 +91,7 @@ PyTypeObject _ped_Partition_Type_obj = { + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_Partition_doc, + .tp_traverse = (traverseproc) _ped_Partition_traverse, + .tp_clear = (inquiry) _ped_Partition_clear, +@@ -221,7 +218,6 @@ PyTypeObject _ped_Disk_Type_obj = { .tp_dealloc = (destructor) _ped_Disk_dealloc, /* .tp_getattr = XXX */ /* .tp_setattr = XXX */ @@ -157,7 +216,17 @@ diff -up pyparted-3.9.5/include/typeobjects/pydisk.h.orig pyparted-3.9.5/include /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ -@@ -286,7 +284,6 @@ PyTypeObject _ped_DiskType_Type_obj = { +@@ -232,8 +228,7 @@ PyTypeObject _ped_Disk_Type_obj = { + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_Disk_doc, + .tp_traverse = (traverseproc) _ped_Disk_traverse, + .tp_clear = (inquiry) _ped_Disk_clear, +@@ -286,7 +281,6 @@ PyTypeObject _ped_DiskType_Type_obj = { .tp_dealloc = (destructor) _ped_DiskType_dealloc, /* .tp_getattr = XXX */ /* .tp_setattr = XXX */ @@ -165,9 +234,20 @@ diff -up pyparted-3.9.5/include/typeobjects/pydisk.h.orig pyparted-3.9.5/include /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ +@@ -297,9 +291,7 @@ PyTypeObject _ped_DiskType_Type_obj = { + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_DiskType_doc, + .tp_traverse = (traverseproc) _ped_DiskType_traverse, + .tp_clear = (inquiry) _ped_DiskType_clear, diff -up pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig pyparted-3.9.5/include/typeobjects/pyfilesys.h --- pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pyfilesys.h 2015-04-24 15:05:17.039767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pyfilesys.h 2015-04-24 15:11:41.964767442 -0400 @@ -51,7 +51,6 @@ PyTypeObject _ped_FileSystemType_Type_ob .tp_dealloc = (destructor) _ped_FileSystemType_dealloc, /* .tp_getattr = XXX */ @@ -176,7 +256,18 @@ diff -up pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig pyparted-3.9.5/incl /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ -@@ -106,7 +105,6 @@ PyTypeObject _ped_FileSystem_Type_obj = +@@ -62,9 +61,7 @@ PyTypeObject _ped_FileSystemType_Type_ob + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_FileSystemType_doc, + .tp_traverse = (traverseproc) _ped_FileSystemType_traverse, + .tp_clear = (inquiry) _ped_FileSystemType_clear, +@@ -106,7 +103,6 @@ PyTypeObject _ped_FileSystem_Type_obj = .tp_dealloc = (destructor) _ped_FileSystem_dealloc, /* .tp_getattr = XXX */ /* .tp_setattr = XXX */ @@ -184,9 +275,20 @@ diff -up pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig pyparted-3.9.5/incl /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ +@@ -117,9 +113,7 @@ PyTypeObject _ped_FileSystem_Type_obj = + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_FileSystem_doc, + .tp_traverse = (traverseproc) _ped_FileSystem_traverse, + .tp_clear = (inquiry) _ped_FileSystem_clear, diff -up pyparted-3.9.5/include/typeobjects/pygeom.h.orig pyparted-3.9.5/include/typeobjects/pygeom.h --- pyparted-3.9.5/include/typeobjects/pygeom.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pygeom.h 2015-04-24 15:05:21.399767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pygeom.h 2015-04-24 15:11:52.836767442 -0400 @@ -91,7 +91,6 @@ PyTypeObject _ped_Geometry_Type_obj = { .tp_dealloc = (destructor) _ped_Geometry_dealloc, /* .tp_getattr = XXX */ @@ -195,9 +297,19 @@ diff -up pyparted-3.9.5/include/typeobjects/pygeom.h.orig pyparted-3.9.5/include /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ +@@ -102,8 +101,7 @@ PyTypeObject _ped_Geometry_Type_obj = { + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_Geometry_doc, + .tp_traverse = (traverseproc) _ped_Geometry_traverse, + .tp_clear = (inquiry) _ped_Geometry_clear, diff -up pyparted-3.9.5/include/typeobjects/pynatmath.h.orig pyparted-3.9.5/include/typeobjects/pynatmath.h --- pyparted-3.9.5/include/typeobjects/pynatmath.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pynatmath.h 2015-04-24 15:05:25.518767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pynatmath.h 2015-04-24 15:12:01.852767442 -0400 @@ -67,7 +67,6 @@ PyTypeObject _ped_Alignment_Type_obj = { .tp_dealloc = (destructor) _ped_Alignment_dealloc, /* .tp_getattr = XXX */ @@ -206,9 +318,19 @@ diff -up pyparted-3.9.5/include/typeobjects/pynatmath.h.orig pyparted-3.9.5/incl /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ +@@ -78,8 +77,7 @@ PyTypeObject _ped_Alignment_Type_obj = { + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = _ped_Alignment_doc, + .tp_traverse = (traverseproc) _ped_Alignment_traverse, + .tp_clear = (inquiry) _ped_Alignment_clear, diff -up pyparted-3.9.5/include/typeobjects/pytimer.h.orig pyparted-3.9.5/include/typeobjects/pytimer.h --- pyparted-3.9.5/include/typeobjects/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pytimer.h 2015-04-24 14:46:46.316767442 -0400 ++++ pyparted-3.9.5/include/typeobjects/pytimer.h 2015-04-24 15:12:11.964767442 -0400 @@ -68,7 +68,6 @@ PyTypeObject _ped_Timer_Type_obj = { .tp_dealloc = (destructor) _ped_Timer_dealloc, /* .tp_getattr = XXX */ @@ -217,6 +339,17 @@ diff -up pyparted-3.9.5/include/typeobjects/pytimer.h.orig pyparted-3.9.5/includ /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ +@@ -79,9 +78,7 @@ PyTypeObject _ped_Timer_Type_obj = { + .tp_getattro = PyObject_GenericGetAttr, + .tp_setattro = PyObject_GenericSetAttr, + /* .tp_as_buffer = XXX */ +- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | +- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | +- Py_TPFLAGS_HAVE_RICHCOMPARE, ++ .tp_flags = TP_FLAGS, + .tp_doc = "PedTimer objects", + .tp_traverse = (traverseproc) _ped_Timer_traverse, + .tp_clear = (inquiry) _ped_Timer_clear, diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py --- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 +++ pyparted-3.9.5/setup.py 2015-04-24 14:46:46.316767442 -0400 From f8a84b4ea12d78ef8259cc856a827452e8ca2ea5 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 15:31:24 -0400 Subject: [PATCH 16/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 267 +++++++++++++++++++++++++++---- 1 file changed, 236 insertions(+), 31 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 61d84d6..99d44b5 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -396,8 +396,8 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py sys.exit(1) diff -up pyparted-3.9.5/src/pyconstraint.c.orig pyparted-3.9.5/src/pyconstraint.c --- pyparted-3.9.5/src/pyconstraint.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pyconstraint.c 2015-04-24 15:01:20.001767442 -0400 -@@ -50,32 +50,6 @@ void _ped_Constraint_dealloc(_ped_Constr ++++ pyparted-3.9.5/src/pyconstraint.c 2015-04-24 15:23:08.200767442 -0400 +@@ -50,45 +50,12 @@ void _ped_Constraint_dealloc(_ped_Constr PyObject_GC_Del(self); } @@ -428,12 +428,30 @@ diff -up pyparted-3.9.5/src/pyconstraint.c.orig pyparted-3.9.5/src/pyconstraint. -} - PyObject *_ped_Constraint_richcompare(_ped_Constraint *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Constraint_Type_obj.tp_compare((PyObject *) a, b))) { +- if (op == Py_EQ) { +- if (!(_ped_Constraint_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_Constraint_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_Constraint_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Constraint"); diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c --- pyparted-3.9.5/src/pydevice.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pydevice.c 2015-04-24 15:02:02.152767442 -0400 -@@ -36,29 +36,6 @@ void _ped_CHSGeometry_dealloc(_ped_CHSGe ++++ pyparted-3.9.5/src/pydevice.c 2015-04-24 15:24:38.791767442 -0400 +@@ -36,43 +36,13 @@ void _ped_CHSGeometry_dealloc(_ped_CHSGe PyObject_GC_Del(self); } @@ -462,8 +480,27 @@ diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c - PyObject *_ped_CHSGeometry_richcompare(_ped_CHSGeometry *a, PyObject *b, int op) { - if (op == Py_EQ) { -@@ -139,41 +116,6 @@ void _ped_Device_dealloc(_ped_Device *se +- if (op == Py_EQ) { +- if (!(_ped_CHSGeometry_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_CHSGeometry_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_CHSGeometry_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.CHSGeometry"); +@@ -139,54 +109,12 @@ void _ped_Device_dealloc(_ped_Device *se PyObject_GC_Del(self); } @@ -503,12 +540,30 @@ diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c -} - PyObject *_ped_Device_richcompare(_ped_Device *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Device_Type_obj.tp_compare((PyObject *) a, b))) { +- if (op == Py_EQ) { +- if (!(_ped_Device_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_Device_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_Device_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Device"); diff -up pyparted-3.9.5/src/pydisk.c.orig pyparted-3.9.5/src/pydisk.c --- pyparted-3.9.5/src/pydisk.c.orig 2015-04-24 14:46:46.312767442 -0400 -+++ pyparted-3.9.5/src/pydisk.c 2015-04-24 15:02:16.280767442 -0400 -@@ -47,31 +47,6 @@ void _ped_Partition_dealloc(_ped_Partiti ++++ pyparted-3.9.5/src/pydisk.c 2015-04-24 15:28:45.030767442 -0400 +@@ -47,40 +47,15 @@ void _ped_Partition_dealloc(_ped_Partiti PyObject_GC_Del(self); } @@ -539,11 +594,70 @@ diff -up pyparted-3.9.5/src/pydisk.c.orig pyparted-3.9.5/src/pydisk.c - PyObject *_ped_Partition_richcompare(_ped_Partition *a, PyObject *b, int op) { if (op == Py_EQ) { - if (!(_ped_Partition_Type_obj.tp_compare((PyObject *) a, b))) { +- if (!(_ped_Partition_Type_obj.tp_compare((PyObject *) a, b))) { ++ if ((_ped_Partition_Type_obj.tp_richcompare((PyObject *) a, b, Py_EQ))) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; + } + } else if (op == Py_NE) { +- if (_ped_Partition_Type_obj.tp_compare((PyObject *) a, b)) { ++ if (!(_ped_Partition_Type_obj.tp_richcompare((PyObject *) a, b, Py_EQ))) { + Py_RETURN_TRUE; + } else { + Py_RETURN_FALSE; +@@ -324,18 +299,11 @@ int _ped_Disk_compare(_ped_Disk *self, P + } + + PyObject *_ped_Disk_richcompare(_ped_Disk *a, PyObject *b, int op) { +- if (op == Py_EQ) { +- if (!(_ped_Disk_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_Disk_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_Disk_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Disk"); +@@ -476,18 +444,11 @@ int _ped_DiskType_compare(_ped_DiskType + } + + PyObject *_ped_DiskType_richcompare(_ped_DiskType *a, PyObject *b, int op) { +- if (op == Py_EQ) { +- if (!(_ped_DiskType_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_DiskType_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_DiskType_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.DiskType"); diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c --- pyparted-3.9.5/src/pyfilesys.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pyfilesys.c 2015-04-24 15:02:40.112767442 -0400 -@@ -38,27 +38,6 @@ void _ped_FileSystemType_dealloc(_ped_Fi ++++ pyparted-3.9.5/src/pyfilesys.c 2015-04-24 15:29:53.925767442 -0400 +@@ -38,41 +38,13 @@ void _ped_FileSystemType_dealloc(_ped_Fi PyObject_GC_Del(self); } @@ -570,8 +684,27 @@ diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c - PyObject *_ped_FileSystemType_richcompare(_ped_FileSystemType *a, PyObject *b, int op) { - if (op == Py_EQ) { -@@ -137,30 +116,6 @@ void _ped_FileSystem_dealloc(_ped_FileSy +- if (op == Py_EQ) { +- if (!(_ped_FileSystemType_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_FileSystemType_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_FileSystemType_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.FileSystemType"); +@@ -137,43 +109,12 @@ void _ped_FileSystem_dealloc(_ped_FileSy PyObject_GC_Del(self); } @@ -600,12 +733,30 @@ diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c -} - PyObject *_ped_FileSystem_richcompare(_ped_FileSystem *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_FileSystem_Type_obj.tp_compare((PyObject *) a, b))) { +- if (op == Py_EQ) { +- if (!(_ped_FileSystem_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_FileSystem_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_FileSystem_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.FileSystem"); diff -up pyparted-3.9.5/src/pygeom.c.orig pyparted-3.9.5/src/pygeom.c --- pyparted-3.9.5/src/pygeom.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pygeom.c 2015-04-24 15:02:53.984767442 -0400 -@@ -43,30 +43,6 @@ void _ped_Geometry_dealloc(_ped_Geometry ++++ pyparted-3.9.5/src/pygeom.c 2015-04-24 15:30:20.477767442 -0400 +@@ -43,43 +43,12 @@ void _ped_Geometry_dealloc(_ped_Geometry PyObject_GC_Del(self); } @@ -634,12 +785,30 @@ diff -up pyparted-3.9.5/src/pygeom.c.orig pyparted-3.9.5/src/pygeom.c -} - PyObject *_ped_Geometry_richcompare(_ped_Geometry *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Geometry_Type_obj.tp_compare((PyObject *) a, b))) { +- if (op == Py_EQ) { +- if (!(_ped_Geometry_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_Geometry_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_Geometry_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Geometry"); diff -up pyparted-3.9.5/src/pynatmath.c.orig pyparted-3.9.5/src/pynatmath.c --- pyparted-3.9.5/src/pynatmath.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pynatmath.c 2015-04-24 15:03:07.816767442 -0400 -@@ -36,28 +36,6 @@ void _ped_Alignment_dealloc(_ped_Alignme ++++ pyparted-3.9.5/src/pynatmath.c 2015-04-24 15:30:48.821767442 -0400 +@@ -36,41 +36,12 @@ void _ped_Alignment_dealloc(_ped_Alignme PyObject_GC_Del(self); } @@ -666,12 +835,30 @@ diff -up pyparted-3.9.5/src/pynatmath.c.orig pyparted-3.9.5/src/pynatmath.c -} - PyObject *_ped_Alignment_richcompare(_ped_Alignment *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Alignment_Type_obj.tp_compare((PyObject *) a, b))) { +- if (op == Py_EQ) { +- if (!(_ped_Alignment_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_Alignment_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_Alignment_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Alignment"); diff -up pyparted-3.9.5/src/pytimer.c.orig pyparted-3.9.5/src/pytimer.c --- pyparted-3.9.5/src/pytimer.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pytimer.c 2015-04-24 14:46:46.316767442 -0400 -@@ -35,33 +35,6 @@ void _ped_Timer_dealloc(_ped_Timer *self ++++ pyparted-3.9.5/src/pytimer.c 2015-04-24 15:31:12.269767442 -0400 +@@ -35,46 +35,12 @@ void _ped_Timer_dealloc(_ped_Timer *self PyObject_GC_Del(self); } @@ -703,6 +890,24 @@ diff -up pyparted-3.9.5/src/pytimer.c.orig pyparted-3.9.5/src/pytimer.c -} - PyObject *_ped_Timer_richcompare(_ped_Timer *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { +- if (op == Py_EQ) { +- if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } +- } else if (op == Py_NE) { +- if (_ped_Timer_Type_obj.tp_compare((PyObject *) a, b)) { +- Py_RETURN_TRUE; +- } else { +- Py_RETURN_FALSE; +- } ++ if (op == Py_EQ || op == Py_NE) { ++ int rv = _ped_Timer_compare(a, b); ++ if (PyErr_Occurred()) ++ return NULL; ++ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); + } else if ((op == Py_LT) || (op == Py_LE) || + (op == Py_GT) || (op == Py_GE)) { + PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Timer"); diff -up pyparted-3.9.5/src/pyunit.c.orig pyparted-3.9.5/src/pyunit.c From 9ecfa2114b5ddb71ded52d1b0633c9f8446dd4ef Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 16:03:31 -0400 Subject: [PATCH 17/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 99d44b5..4ed4501 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -149,8 +149,17 @@ diff -up pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig pyparted-3.9.5/i .tp_clear = (inquiry) _ped_Constraint_clear, diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/include/typeobjects/pydevice.h --- pyparted-3.9.5/include/typeobjects/pydevice.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pydevice.h 2015-04-24 15:10:53.861767442 -0400 -@@ -58,7 +58,6 @@ PyTypeObject _ped_CHSGeometry_Type_obj = ++++ pyparted-3.9.5/include/typeobjects/pydevice.h 2015-04-24 16:03:20.431767442 -0400 +@@ -25,6 +25,8 @@ + #ifndef TYPEOBJECTS_PYDEVICE_H_INCLUDED + #define TYPEOBJECTS_PYDEVICE_H_INCLUDED + ++#define PyGC_HEAD_SIZE 0 ++ + #include + #include + +@@ -58,7 +60,6 @@ PyTypeObject _ped_CHSGeometry_Type_obj = .tp_dealloc = (destructor) _ped_CHSGeometry_dealloc, /* .tp_getattr = XXX */ /* .tp_setattr = XXX */ @@ -158,7 +167,7 @@ diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/inclu /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ -@@ -69,8 +68,7 @@ PyTypeObject _ped_CHSGeometry_Type_obj = +@@ -69,8 +70,7 @@ PyTypeObject _ped_CHSGeometry_Type_obj = .tp_getattro = PyObject_GenericGetAttr, .tp_setattro = PyObject_GenericSetAttr, /* .tp_as_buffer = XXX */ @@ -168,7 +177,7 @@ diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/inclu .tp_doc = _ped_CHSGeometry_doc, .tp_traverse = (traverseproc) _ped_CHSGeometry_traverse, .tp_clear = (inquiry) _ped_CHSGeometry_clear, -@@ -221,7 +219,6 @@ PyTypeObject _ped_Device_Type_obj = { +@@ -221,7 +221,6 @@ PyTypeObject _ped_Device_Type_obj = { .tp_dealloc = (destructor) _ped_Device_dealloc, /* .tp_getattr = XXX */ /* .tp_setattr = XXX */ @@ -176,7 +185,7 @@ diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/inclu /* .tp_repr = XXX */ /* .tp_as_number = XXX */ /* .tp_as_sequence = XXX */ -@@ -232,8 +229,7 @@ PyTypeObject _ped_Device_Type_obj = { +@@ -232,8 +231,7 @@ PyTypeObject _ped_Device_Type_obj = { .tp_getattro = PyObject_GenericGetAttr, .tp_setattro = PyObject_GenericSetAttr, /* .tp_as_buffer = XXX */ From ee2ec6a6569737a9820b2481ae0dcb886db11376 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 16:16:03 -0400 Subject: [PATCH 18/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 203 +++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index 4ed4501..f7314f4 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -403,6 +403,209 @@ diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py if not float(modversion) >= float(version): sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,)) sys.exit(1) +diff -up pyparted-3.9.5/src/parted/alignment.py.orig pyparted-3.9.5/src/parted/alignment.py +--- pyparted-3.9.5/src/parted/alignment.py.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/parted/alignment.py 2015-04-24 16:14:05.875767442 -0400 +@@ -45,7 +45,7 @@ class Alignment(object): + self.__alignment = _ped.Alignment(kwargs.get("offset"), + kwargs.get("grainSize")) + else: +- raise parted.AlignmentException, "no offset+grainSize or PedAlignment specified" ++ raise parted.AlignmentException("no offset+grainSize or PedAlignment specified") + + offset = property(lambda s: s.__alignment.offset, lambda s, v: setattr(s.__alignment, "offset", v)) + grainSize = property(lambda s: s.__alignment.grain_size, lambda s, v: setattr(s.__alignment, "grain_size", v)) +@@ -106,10 +106,10 @@ class Alignment(object): + """Determine whether sector lies inside geom and satisfies the + alignment constraint self.""" + if not geom: +- raise TypeError, "missing parted.Geometry parameter" ++ raise TypeError("missing parted.Geometry parameter") + + if sector is None: +- raise TypeError, "missing sector parameter" ++ raise TypeError("missing sector parameter") + + return self.__alignment.is_aligned(geom.getPedGeometry(), sector) + +diff -up pyparted-3.9.5/src/parted/constraint.py.orig pyparted-3.9.5/src/parted/constraint.py +--- pyparted-3.9.5/src/parted/constraint.py.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/parted/constraint.py 2015-04-24 16:15:10.650767442 -0400 +@@ -80,7 +80,7 @@ class Constraint(object): + self.__constraint = _ped.Constraint(starta, enda, startr, endr, + mins, maxs) + else: +- raise parted.ConstraintException, "missing initialization parameters" ++ raise parted.ConstraintException("missing initialization parameters") + + def __eq__(self, other): + return not self.__ne__(other) +diff -up pyparted-3.9.5/src/parted/device.py.orig pyparted-3.9.5/src/parted/device.py +--- pyparted-3.9.5/src/parted/device.py.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/parted/device.py 2015-04-24 16:15:40.418767442 -0400 +@@ -53,7 +53,7 @@ class Device(object): + elif path is not None: + self.__device = _ped.device_get(path) + else: +- raise parted.DeviceException, "no path or PedDevice specified" ++ raise parted.DeviceException("no path or PedDevice specified") + + def __eq__(self, other): + return not self.__ne__(other) +@@ -293,7 +293,7 @@ class Device(object): + lunit = unit.lower() + + if lunit not in parted._exponent.keys(): +- raise SyntaxError, "invalid unit %s given" % (unit,) ++ raise SyntaxError("invalid unit %s given" % unit) + + size = float(self.__device.length) + size /= math.pow(1024.0, parted._exponent[lunit]) +diff -up pyparted-3.9.5/src/parted/disk.py.orig pyparted-3.9.5/src/parted/disk.py +--- pyparted-3.9.5/src/parted/disk.py.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/parted/disk.py 2015-04-24 16:13:15.763767442 -0400 +@@ -46,7 +46,7 @@ class Disk(object): + else: + self._device = device + elif device is None: +- raise parted.DiskException, "no device specified" ++ raise parted.DiskException("no device specified") + else: + self.__disk = _ped.Disk(device.getPedDevice()) + self._device = device +@@ -245,7 +245,7 @@ class Disk(object): + result = self.__disk.add_partition(partition.getPedPartition(), + constraint.getPedConstraint()) + elif not partition: +- raise parted.DiskException, "no partition or constraint specified" ++ raise parted.DiskException("no partition or constraint specified") + else: + result = self.__disk.add_partition(partition.getPedPartition()) + +@@ -264,7 +264,7 @@ class Disk(object): + actually destroyed unless you use the deletePartition() + method.""" + if not partition: +- raise parted.DiskException, "no partition specified" ++ raise parted.DiskException("no partition specified") + + if self.__disk.remove_partition(partition.getPedPartition()): + self.partitions.invalidate() +@@ -299,10 +299,10 @@ class Disk(object): + does not modify the partition contents, just the partition + table.""" + if not partition or not constraint: +- raise parted.DiskException, "no partition or constraint specified" ++ raise parted.DiskException("no partition or constraint specified") + + if not start or not end: +- raise parted.DiskException, "no start or end geometry specified" ++ raise parted.DiskException("no start or end geometry specified") + + return self.__disk.set_partition_geom(partition.getPedPartition(), + constraint.getPedConstraint(), +@@ -313,7 +313,7 @@ class Disk(object): + """Grow the Partition's Geometry to the maximum possible subject + to Constraint.""" + if not partition: +- raise parted.DiskException, "no partition specified" ++ raise parted.DiskException("no partition specified") + + if constraint: + return self.__disk.maximize_partition(partition.getPedPartition(), +@@ -326,7 +326,7 @@ class Disk(object): + """Get the maximum Geometry the Partition can be grown to, + subject to the given Constraint.""" + if not partition: +- raise parted.DiskException, "no partition specified" ++ raise parted.DiskException("no partition specified") + + if constraint: + return parted.Geometry(PedGeometry=self.__disk.get_max_partition_geometry(partition.getPedPartition(), constraint.getPedConstraint())) +diff -up pyparted-3.9.5/src/parted/filesystem.py.orig pyparted-3.9.5/src/parted/filesystem.py +--- pyparted-3.9.5/src/parted/filesystem.py.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/parted/filesystem.py 2015-04-24 16:13:37.291767442 -0400 +@@ -38,9 +38,9 @@ class FileSystem(object): + + if PedFileSystem is None: + if type is None: +- raise parted.FileSystemException, "no type specified" ++ raise parted.FileSystemException("no type specified") + elif geometry is None: +- raise parted.FileSystemException, "no geometry specified" ++ raise parted.FileSystemException("no geometry specified") + + self._type = type + self._geometry = geometry +diff -up pyparted-3.9.5/src/parted/geometry.py.orig pyparted-3.9.5/src/parted/geometry.py +--- pyparted-3.9.5/src/parted/geometry.py.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/parted/geometry.py 2015-04-24 16:12:14.740767442 -0400 +@@ -60,7 +60,7 @@ class Geometry(object): + self._device = device + self.__geometry = _ped.Geometry(self.device.getPedDevice(), start, length, end=end) + else: +- raise parted.GeometryException, "must specify PedGeometry or (device, start, length) or (device, start, end) or (device, start, length, end)" ++ raise parted.GeometryException("must specify PedGeometry or (device, start, length) or (device, start, end) or (device, start, length, end)") + + def __eq__(self, other): + return not self.__ne__(other) +@@ -126,7 +126,7 @@ class Geometry(object): + size = self.length * self.device.sectorSize + + if lunit not in parted._exponent.keys(): +- raise SyntaxError, "invalid unit %s given" % (unit,) ++ raise SyntaxError("invalid unit %s given" % unit) + + return (size / math.pow(1024.0, parted._exponent[lunit])) + +diff -up pyparted-3.9.5/src/parted/__init__.py.orig pyparted-3.9.5/src/parted/__init__.py +--- pyparted-3.9.5/src/parted/__init__.py.orig 2014-06-24 13:06:32.000000000 -0400 ++++ pyparted-3.9.5/src/parted/__init__.py 2015-04-24 16:11:37.228767442 -0400 +@@ -413,7 +413,7 @@ def freshDisk(device, ty): + if type(ty) == str: + ty = diskType[ty] + elif not isinstance(ty, DiskType): +- raise SyntaxError, "type must be a key or value in parted.diskType" ++ raise SyntaxError("type must be a key or value in parted.diskType") + + peddisk = disk_new_fresh(device.getPedDevice(), ty) + return Disk(PedDisk=peddisk) +diff -up pyparted-3.9.5/src/parted/partition.py.orig pyparted-3.9.5/src/parted/partition.py +--- pyparted-3.9.5/src/parted/partition.py.orig 2015-04-24 14:46:46.312767442 -0400 ++++ pyparted-3.9.5/src/parted/partition.py 2015-04-24 16:14:49.467767442 -0400 +@@ -38,11 +38,11 @@ class Partition(object): + def __init__(self, disk=None, type=None, fs=None, geometry=None, PedPartition=None): + if PedPartition is None: + if disk is None: +- raise parted.PartitionException, "no disk specified" ++ raise parted.PartitionException("no disk specified") + elif type is None: +- raise parted.PartitionException, "no type specified" ++ raise parted.PartitionException("no type specified") + elif geometry is None: +- raise parted.PartitionException, "no geometry specified" ++ raise parted.PartitionException("no geometry specified") + + self._fileSystem = fs + self._geometry = geometry +@@ -96,7 +96,7 @@ class Partition(object): + return s + + def __writeOnly(self, property): +- raise parted.WriteOnlyProperty, property ++ raise parted.WriteOnlyProperty(property) + + @property + @localeC +@@ -224,7 +224,7 @@ class Partition(object): + lunit = unit.lower() + + if lunit not in parted._exponent.keys(): +- raise SyntaxError, "invalid unit %s given" % (unit,) ++ raise SyntaxError("invalid unit %s given" % unit) + + maxLength = self.geometry.length + sectorSize = self.geometry.device.sectorSize diff -up pyparted-3.9.5/src/pyconstraint.c.orig pyparted-3.9.5/src/pyconstraint.c --- pyparted-3.9.5/src/pyconstraint.c.orig 2014-06-24 13:06:32.000000000 -0400 +++ pyparted-3.9.5/src/pyconstraint.c 2015-04-24 15:23:08.200767442 -0400 From 8c89f71bca44017721c2e033551b847d38d6206c Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Fri, 24 Apr 2015 16:34:49 -0400 Subject: [PATCH 19/22] Add Python 3 subpackage (#1196402) --- pyparted-3.9.5-rhbz1196402.patch | 357 +++---------------------------- 1 file changed, 28 insertions(+), 329 deletions(-) diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch index f7314f4..4bec85e 100644 --- a/pyparted-3.9.5-rhbz1196402.patch +++ b/pyparted-3.9.5-rhbz1196402.patch @@ -16,114 +16,12 @@ diff -up pyparted-3.9.5/include/convert.h.orig pyparted-3.9.5/include/convert.h _ped_Alignment *PedAlignment2_ped_Alignment(PedAlignment *); diff -up pyparted-3.9.5/include/pyconstraint.h.orig pyparted-3.9.5/include/pyconstraint.h ---- pyparted-3.9.5/include/pyconstraint.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/pyconstraint.h 2015-04-24 15:01:00.385767442 -0400 -@@ -55,7 +55,6 @@ typedef struct { - } _ped_Constraint; - - void _ped_Constraint_dealloc(_ped_Constraint *); --int _ped_Constraint_compare(_ped_Constraint *, PyObject *); - PyObject *_ped_Constraint_richcompare(_ped_Constraint *, PyObject *, int); - PyObject *_ped_Constraint_str(_ped_Constraint *); - int _ped_Constraint_traverse(_ped_Constraint *, visitproc, void *); diff -up pyparted-3.9.5/include/pydevice.h.orig pyparted-3.9.5/include/pydevice.h ---- pyparted-3.9.5/include/pydevice.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/pydevice.h 2015-04-24 15:03:54.071767442 -0400 -@@ -39,7 +39,6 @@ typedef struct { - } _ped_CHSGeometry; - - void _ped_CHSGeometry_dealloc(_ped_CHSGeometry *); --int _ped_CHSGeometry_compare(_ped_CHSGeometry *, PyObject *); - PyObject *_ped_CHSGeometry_richcompare(_ped_CHSGeometry *, PyObject *, int); - PyObject *_ped_CHSGeometry_str(_ped_CHSGeometry *); - int _ped_CHSGeometry_traverse(_ped_CHSGeometry *, visitproc, void *); -@@ -72,7 +71,6 @@ typedef struct { - } _ped_Device; - - void _ped_Device_dealloc(_ped_Device *); --int _ped_Device_compare(_ped_Device *, PyObject *); - PyObject *_ped_Device_richcompare(_ped_Device *, PyObject *, int); - PyObject *_ped_Device_str(_ped_Device *); - int _ped_Device_traverse(_ped_Device *, visitproc, void *); diff -up pyparted-3.9.5/include/pydisk.h.orig pyparted-3.9.5/include/pydisk.h ---- pyparted-3.9.5/include/pydisk.h.orig 2015-04-24 14:46:46.311767442 -0400 -+++ pyparted-3.9.5/include/pydisk.h 2015-04-24 15:04:05.623767442 -0400 -@@ -47,7 +47,6 @@ typedef struct { - } _ped_Partition; - - void _ped_Partition_dealloc(_ped_Partition *); --int _ped_Partition_compare(_ped_Partition *, PyObject *); - PyObject *_ped_Partition_richcompare(_ped_Partition *, PyObject *, int); - PyObject *_ped_Partition_str(_ped_Partition *); - int _ped_Partition_traverse(_ped_Partition *, visitproc, void *); -@@ -71,7 +70,6 @@ typedef struct { - } _ped_Disk; - - void _ped_Disk_dealloc(_ped_Disk *); --int _ped_Disk_compare(_ped_Disk *, PyObject *); - PyObject *_ped_Disk_richcompare(_ped_Disk *, PyObject *, int); - PyObject *_ped_Disk_str(_ped_Disk *); - int _ped_Disk_traverse(_ped_Disk *, visitproc, void *); -@@ -90,7 +88,6 @@ typedef struct { - } _ped_DiskType; - - void _ped_DiskType_dealloc(_ped_DiskType *); --int _ped_DiskType_compare(_ped_DiskType *, PyObject *); - PyObject *_ped_DiskType_richcompare(_ped_DiskType *, PyObject *, int); - PyObject *_ped_DiskType_str(_ped_DiskType *); - int _ped_DiskType_traverse(_ped_DiskType *, visitproc, void *); diff -up pyparted-3.9.5/include/pyfilesys.h.orig pyparted-3.9.5/include/pyfilesys.h ---- pyparted-3.9.5/include/pyfilesys.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/pyfilesys.h 2015-04-24 15:04:12.455767442 -0400 -@@ -48,7 +48,6 @@ typedef struct { - } _ped_FileSystemType; - - void _ped_FileSystemType_dealloc(_ped_FileSystemType *); --int _ped_FileSystemType_compare(_ped_FileSystemType *, PyObject *); - PyObject *_ped_FileSystemType_richcompare(_ped_FileSystemType *, PyObject *, - int); - PyObject *_ped_FileSystemType_str(_ped_FileSystemType *); -@@ -72,7 +71,6 @@ typedef struct { - } _ped_FileSystem; - - void _ped_FileSystem_dealloc(_ped_FileSystem *); --int _ped_FileSystem_compare(_ped_FileSystem *, PyObject *); - PyObject *_ped_FileSystem_richcompare(_ped_FileSystem *, PyObject *, int); - PyObject *_ped_FileSystem_str(_ped_FileSystem *); - int _ped_FileSystem_traverse(_ped_FileSystem *, visitproc, void *); diff -up pyparted-3.9.5/include/pygeom.h.orig pyparted-3.9.5/include/pygeom.h ---- pyparted-3.9.5/include/pygeom.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/pygeom.h 2015-04-24 15:04:17.463767442 -0400 -@@ -58,7 +58,6 @@ typedef struct { - } _ped_Geometry; - - void _ped_Geometry_dealloc(_ped_Geometry *); --int _ped_Geometry_compare(_ped_Geometry *, PyObject *); - PyObject *_ped_Geometry_richcompare(_ped_Geometry *, PyObject *, int); - PyObject *_ped_Geometry_str(_ped_Geometry *); - int _ped_Geometry_traverse(_ped_Geometry *, visitproc, void *); diff -up pyparted-3.9.5/include/pynatmath.h.orig pyparted-3.9.5/include/pynatmath.h ---- pyparted-3.9.5/include/pynatmath.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/pynatmath.h 2015-04-24 15:04:21.471767442 -0400 -@@ -47,7 +47,6 @@ typedef struct { - } _ped_Alignment; - - void _ped_Alignment_dealloc(_ped_Alignment *); --int _ped_Alignment_compare(_ped_Alignment *, PyObject *); - PyObject *_ped_Alignment_richcompare(_ped_Alignment *, PyObject *, int); - PyObject *_ped_Alignment_str(_ped_Alignment *); - int _ped_Alignment_traverse(_ped_Alignment *, visitproc, void *); diff -up pyparted-3.9.5/include/pytimer.h.orig pyparted-3.9.5/include/pytimer.h ---- pyparted-3.9.5/include/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/pytimer.h 2015-04-24 14:47:07.086767442 -0400 -@@ -52,7 +52,6 @@ typedef struct { - } _ped_Timer; - - void _ped_Timer_dealloc(_ped_Timer *); --int _ped_Timer_compare(_ped_Timer *, PyObject *); - PyObject *_ped_Timer_richcompare(_ped_Timer *, PyObject *, int); - PyObject *_ped_Timer_str(_ped_Timer *); - int _ped_Timer_traverse(_ped_Timer *, visitproc, void *); diff -up pyparted-3.9.5/include/pyunit.h.orig pyparted-3.9.5/include/pyunit.h diff -up pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig pyparted-3.9.5/include/typeobjects/pyconstraint.h --- pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig 2014-06-24 13:06:32.000000000 -0400 @@ -608,37 +506,10 @@ diff -up pyparted-3.9.5/src/parted/partition.py.orig pyparted-3.9.5/src/parted/p sectorSize = self.geometry.device.sectorSize diff -up pyparted-3.9.5/src/pyconstraint.c.orig pyparted-3.9.5/src/pyconstraint.c --- pyparted-3.9.5/src/pyconstraint.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pyconstraint.c 2015-04-24 15:23:08.200767442 -0400 -@@ -50,45 +50,12 @@ void _ped_Constraint_dealloc(_ped_Constr - PyObject_GC_Del(self); ++++ pyparted-3.9.5/src/pyconstraint.c 2015-04-24 16:28:13.589767442 -0400 +@@ -77,18 +77,11 @@ int _ped_Constraint_compare(_ped_Constra } --int _ped_Constraint_compare(_ped_Constraint *self, PyObject *obj) { -- _ped_Constraint *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Constraint_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Constraint"); -- return -1; -- } -- -- comp = (_ped_Constraint *) obj; -- if ((_ped_Alignment_Type_obj.tp_richcompare(self->start_align, comp->start_align, Py_EQ)) && -- (_ped_Alignment_Type_obj.tp_richcompare(self->end_align, comp->end_align, Py_EQ)) && -- (_ped_Geometry_Type_obj.tp_richcompare(self->start_range, comp->start_range, Py_EQ)) && -- (_ped_Geometry_Type_obj.tp_richcompare(self->end_range, comp->end_range, Py_EQ)) && -- (self->min_size == comp->min_size) && -- (self->max_size == comp->max_size)) { -- return 0; -- } else { -- return 1; -- } --} -- PyObject *_ped_Constraint_richcompare(_ped_Constraint *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Constraint_Type_obj.tp_compare((PyObject *) a, b))) { @@ -662,34 +533,9 @@ diff -up pyparted-3.9.5/src/pyconstraint.c.orig pyparted-3.9.5/src/pyconstraint. PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Constraint"); diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c --- pyparted-3.9.5/src/pydevice.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pydevice.c 2015-04-24 15:24:38.791767442 -0400 -@@ -36,43 +36,13 @@ void _ped_CHSGeometry_dealloc(_ped_CHSGe - PyObject_GC_Del(self); - } ++++ pyparted-3.9.5/src/pydevice.c 2015-04-24 16:29:19.613767442 -0400 +@@ -61,18 +61,11 @@ int _ped_CHSGeometry_compare(_ped_CHSGeo --int _ped_CHSGeometry_compare(_ped_CHSGeometry *self, PyObject *obj) { -- _ped_CHSGeometry *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_CHSGeometry_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.CHSGeometry"); -- return -1; -- } -- -- comp = (_ped_CHSGeometry *) obj; -- if ((self->cylinders == comp->cylinders) && -- (self->heads == comp->heads) && -- (self->sectors == comp->sectors)) { -- return 0; -- } else { -- return 1; -- } --} -- PyObject *_ped_CHSGeometry_richcompare(_ped_CHSGeometry *a, PyObject *b, int op) { - if (op == Py_EQ) { @@ -712,45 +558,9 @@ diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c } else if ((op == Py_LT) || (op == Py_LE) || (op == Py_GT) || (op == Py_GE)) { PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.CHSGeometry"); -@@ -139,54 +109,12 @@ void _ped_Device_dealloc(_ped_Device *se - PyObject_GC_Del(self); +@@ -175,18 +168,11 @@ int _ped_Device_compare(_ped_Device *sel } --int _ped_Device_compare(_ped_Device *self, PyObject *obj) { -- _ped_Device *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Device_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Device"); -- return -1; -- } -- -- comp = (_ped_Device *) obj; -- if ((!strcmp(self->model, comp->model)) && -- (!strcmp(self->path, comp->path)) && -- (self->type == comp->type) && -- (self->sector_size == comp->sector_size) && -- (self->phys_sector_size == comp->phys_sector_size) && -- (self->length == comp->length) && -- (self->open_count == comp->open_count) && -- (self->read_only == comp->read_only) && -- (self->external_mode == comp->external_mode) && -- (self->dirty == comp->dirty) && -- (self->boot_dirty == comp->dirty) && -- (_ped_CHSGeometry_Type_obj.tp_richcompare(self->hw_geom, comp->hw_geom, Py_EQ)) && -- (_ped_CHSGeometry_Type_obj.tp_richcompare(self->bios_geom, comp->bios_geom, Py_EQ)) && -- (self->host == comp->host) && -- (self->did == comp->did)) { -- return 0; -- } else { -- return 1; -- } --} -- PyObject *_ped_Device_richcompare(_ped_Device *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Device_Type_obj.tp_compare((PyObject *) a, b))) { @@ -774,7 +584,7 @@ diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Device"); diff -up pyparted-3.9.5/src/pydisk.c.orig pyparted-3.9.5/src/pydisk.c --- pyparted-3.9.5/src/pydisk.c.orig 2015-04-24 14:46:46.312767442 -0400 -+++ pyparted-3.9.5/src/pydisk.c 2015-04-24 15:28:45.030767442 -0400 ++++ pyparted-3.9.5/src/pydisk.c 2015-04-24 16:30:15.132767442 -0400 @@ -47,40 +47,15 @@ void _ped_Partition_dealloc(_ped_Partiti PyObject_GC_Del(self); } @@ -868,32 +678,9 @@ diff -up pyparted-3.9.5/src/pydisk.c.orig pyparted-3.9.5/src/pydisk.c PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.DiskType"); diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c --- pyparted-3.9.5/src/pyfilesys.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pyfilesys.c 2015-04-24 15:29:53.925767442 -0400 -@@ -38,41 +38,13 @@ void _ped_FileSystemType_dealloc(_ped_Fi - PyObject_GC_Del(self); - } ++++ pyparted-3.9.5/src/pyfilesys.c 2015-04-24 16:31:06.244767442 -0400 +@@ -61,18 +61,11 @@ int _ped_FileSystemType_compare(_ped_Fil --int _ped_FileSystemType_compare(_ped_FileSystemType *self, PyObject *obj) { -- _ped_FileSystemType *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_FileSystemType_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.FileSystemType"); -- return -1; -- } -- -- comp = (_ped_FileSystemType *) obj; -- if (!strcmp(self->name, comp->name)) { -- return 0; -- } else { -- return 1; -- } --} -- PyObject *_ped_FileSystemType_richcompare(_ped_FileSystemType *a, PyObject *b, int op) { - if (op == Py_EQ) { @@ -916,34 +703,13 @@ diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c } else if ((op == Py_LT) || (op == Py_LE) || (op == Py_GT) || (op == Py_GE)) { PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.FileSystemType"); -@@ -137,43 +109,12 @@ void _ped_FileSystem_dealloc(_ped_FileSy - PyObject_GC_Del(self); +@@ -158,22 +151,14 @@ int _ped_FileSystem_compare(_ped_FileSys + } else { + return 1; + } +- } --int _ped_FileSystem_compare(_ped_FileSystem *self, PyObject *obj) { -- _ped_FileSystem *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_FileSystem_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.FileSystem"); -- return -1; -- } -- -- comp = (_ped_FileSystem *) obj; -- if ((_ped_FileSystemType_Type_obj.tp_richcompare(self->type, comp->type, Py_EQ)) && -- (_ped_Geometry_Type_obj.tp_richcompare(self->geom, comp->geom, Py_EQ)) && -- (self->checked == comp->checked)) { -- return 0; -- } else { -- return 1; -- } -- --} -- PyObject *_ped_FileSystem_richcompare(_ped_FileSystem *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_FileSystem_Type_obj.tp_compare((PyObject *) a, b))) { @@ -967,35 +733,19 @@ diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.FileSystem"); diff -up pyparted-3.9.5/src/pygeom.c.orig pyparted-3.9.5/src/pygeom.c --- pyparted-3.9.5/src/pygeom.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pygeom.c 2015-04-24 15:30:20.477767442 -0400 -@@ -43,43 +43,12 @@ void _ped_Geometry_dealloc(_ped_Geometry - PyObject_GC_Del(self); ++++ pyparted-3.9.5/src/pygeom.c 2015-04-24 16:31:28.724767442 -0400 +@@ -57,7 +57,7 @@ int _ped_Geometry_compare(_ped_Geometry + } + + comp = (_ped_Geometry *) obj; +- if ((_ped_Geometry_Type_obj.tp_richcompare(self->dev, comp->dev, Py_EQ)) && ++ if (PyObject_RichCompareBool(self->dev, comp->dev, Py_EQ) && + (self->ped_geometry->start == comp->ped_geometry->start) && + (self->ped_geometry->length == comp->ped_geometry->length) && + (self->ped_geometry->end == comp->ped_geometry->end)) { +@@ -68,18 +68,11 @@ int _ped_Geometry_compare(_ped_Geometry } --int _ped_Geometry_compare(_ped_Geometry *self, PyObject *obj) { -- _ped_Geometry *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Geometry_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Geometry"); -- return -1; -- } -- -- comp = (_ped_Geometry *) obj; -- if ((_ped_Geometry_Type_obj.tp_richcompare(self->dev, comp->dev, Py_EQ)) && -- (self->ped_geometry->start == comp->ped_geometry->start) && -- (self->ped_geometry->length == comp->ped_geometry->length) && -- (self->ped_geometry->end == comp->ped_geometry->end)) { -- return 0; -- } else { -- return 1; -- } --} -- PyObject *_ped_Geometry_richcompare(_ped_Geometry *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Geometry_Type_obj.tp_compare((PyObject *) a, b))) { @@ -1019,33 +769,10 @@ diff -up pyparted-3.9.5/src/pygeom.c.orig pyparted-3.9.5/src/pygeom.c PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Geometry"); diff -up pyparted-3.9.5/src/pynatmath.c.orig pyparted-3.9.5/src/pynatmath.c --- pyparted-3.9.5/src/pynatmath.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pynatmath.c 2015-04-24 15:30:48.821767442 -0400 -@@ -36,41 +36,12 @@ void _ped_Alignment_dealloc(_ped_Alignme - PyObject_GC_Del(self); ++++ pyparted-3.9.5/src/pynatmath.c 2015-04-24 16:31:44.660767442 -0400 +@@ -59,18 +59,11 @@ int _ped_Alignment_compare(_ped_Alignmen } --int _ped_Alignment_compare(_ped_Alignment *self, PyObject *obj) { -- _ped_Alignment *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Alignment_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Alignment"); -- return -1; -- } -- -- comp = (_ped_Alignment *) obj; -- if ((self->offset == comp->offset) && -- (self->grain_size == comp->grain_size)) { -- return 0; -- } else { -- return 1; -- } --} -- PyObject *_ped_Alignment_richcompare(_ped_Alignment *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Alignment_Type_obj.tp_compare((PyObject *) a, b))) { @@ -1069,38 +796,10 @@ diff -up pyparted-3.9.5/src/pynatmath.c.orig pyparted-3.9.5/src/pynatmath.c PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Alignment"); diff -up pyparted-3.9.5/src/pytimer.c.orig pyparted-3.9.5/src/pytimer.c --- pyparted-3.9.5/src/pytimer.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pytimer.c 2015-04-24 15:31:12.269767442 -0400 -@@ -35,46 +35,12 @@ void _ped_Timer_dealloc(_ped_Timer *self - PyObject_GC_Del(self); ++++ pyparted-3.9.5/src/pytimer.c 2015-04-24 16:32:05.076767442 -0400 +@@ -63,18 +63,11 @@ int _ped_Timer_compare(_ped_Timer *self, } --int _ped_Timer_compare(_ped_Timer *self, PyObject *obj) { -- _ped_Timer *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Timer_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Timer"); -- return -1; -- } -- -- comp = (_ped_Timer *) obj; -- if ((self->frac == comp->frac) && -- (self->start == comp->start) && -- (self->now == comp->now) && -- (self->predicted_end == comp->predicted_end) && -- (!strcmp(self->state_name, comp->state_name)) && -- (self->handler == comp->handler) && -- (self->context == comp->context)) { -- return 0; -- } else { -- return 1; -- } --} -- PyObject *_ped_Timer_richcompare(_ped_Timer *a, PyObject *b, int op) { - if (op == Py_EQ) { - if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { From 3404ffe17b456caacf48fae99524e0a27394240f Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 5 May 2015 08:55:52 -0400 Subject: [PATCH 20/22] Upgrade to pyparted-3.10.4 for multiple fixes and to add a Python 3 subpackage (#1196402) --- .gitignore | 5 +- add_partition_reset_num_method.patch | 82 --- pyparted-3.9.5-rhbz1196402.patch | 824 --------------------------- pyparted.spec | 15 +- sources | 2 +- 5 files changed, 7 insertions(+), 921 deletions(-) delete mode 100644 add_partition_reset_num_method.patch delete mode 100644 pyparted-3.9.5-rhbz1196402.patch diff --git a/.gitignore b/.gitignore index f0061cb..09746ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ -pyparted-3.9.2.tar.gz -/pyparted-3.9.3.tar.gz -/pyparted-3.9.4.tar.gz -/pyparted-3.9.5.tar.gz +/pyparted-pyparted-3.10.4.tar.gz diff --git a/add_partition_reset_num_method.patch b/add_partition_reset_num_method.patch deleted file mode 100644 index 39b4420..0000000 --- a/add_partition_reset_num_method.patch +++ /dev/null @@ -1,82 +0,0 @@ -diff --git a/include/docstrings/pydisk.h b/include/docstrings/pydisk.h -index 77a399f..f9f6f09 100644 ---- a/include/docstrings/pydisk.h -+++ b/include/docstrings/pydisk.h -@@ -82,6 +82,12 @@ PyDoc_STRVAR(partition_get_path_doc, - "level. For instance, on Linux this could return '/dev/sda' for a partition.\n" - "If an error occurs, _ped.PartitionException is raised."); - -+PyDoc_STRVAR(partition_reset_num_doc, -+"reset_num(self) -> boolean\n\n" -+"Reset the partition's number to value allowing it to be set correctly when\n" -+"the partition is added to _ped.PartedDisk. The returned value means\n" -+"success/failure"); -+ - PyDoc_STRVAR(disk_duplicate_doc, - "duplicate(self) -> Disk\n\n" - "Return a new Disk that is a copy of self. This method raises\n" -diff --git a/include/pydisk.h b/include/pydisk.h -index 6f6bff7..ef37a58 100644 ---- a/include/pydisk.h -+++ b/include/pydisk.h -@@ -134,6 +134,7 @@ PyObject *py_ped_partition_set_name(_ped_Partition *, PyObject *); - PyObject *py_ped_partition_get_name(_ped_Partition *, PyObject *); - PyObject *py_ped_partition_is_busy(_ped_Partition *, PyObject *); - PyObject *py_ped_partition_get_path(_ped_Partition *, PyObject *); -+PyObject *py_ped_partition_reset_num(_ped_Partition *, PyObject *); - PyObject *py_ped_partition_type_get_name(PyObject *, PyObject *); - PyObject *py_ped_partition_flag_get_name(PyObject *, PyObject *); - PyObject *py_ped_partition_flag_get_by_name(PyObject *, PyObject *); -diff --git a/include/typeobjects/pydisk.h b/include/typeobjects/pydisk.h -index 3cadf7d..3adca3f 100644 ---- a/include/typeobjects/pydisk.h -+++ b/include/typeobjects/pydisk.h -@@ -60,6 +60,8 @@ static PyMethodDef _ped_Partition_methods[] = { - partition_is_busy_doc}, - {"get_path", (PyCFunction) py_ped_partition_get_path, METH_VARARGS, - partition_get_path_doc}, -+ {"reset_num", (PyCFunction) py_ped_partition_reset_num, METH_VARARGS, -+ partition_reset_num_doc}, - {NULL} - }; - -diff --git a/src/parted/partition.py b/src/parted/partition.py -index ee3e2d0..c91dbc4 100644 ---- a/src/parted/partition.py -+++ b/src/parted/partition.py -@@ -246,6 +246,10 @@ class Partition(object): - For internal module use only.""" - return self.__partition - -+ def resetNumber(self): -+ """Reset the partition's number to default""" -+ return self.__partition.reset_num() -+ - # collect all partition flags and store them in a hash - partitionFlag = {} - __flag = _ped.partition_flag_next(0) -diff --git a/src/pydisk.c b/src/pydisk.c -index 5a525a1..aea6282 100644 ---- a/src/pydisk.c -+++ b/src/pydisk.c -@@ -1377,6 +1377,20 @@ PyObject *py_ped_partition_get_path(_ped_Partition *s, PyObject *args) { - return PyString_FromString(ret); - } - -+PyObject *py_ped_partition_reset_num(_ped_Partition *s, PyObject *args) { -+ PedPartition *part = NULL; -+ -+ part = _ped_Partition2PedPartition(s); -+ if (part == NULL) { -+ Py_RETURN_FALSE; -+ } -+ -+ part->num = -1; -+ -+ Py_RETURN_TRUE; -+} -+ -+ - PyObject *py_ped_partition_type_get_name(PyObject *s, PyObject *args) { - long type; - char *ret = NULL; diff --git a/pyparted-3.9.5-rhbz1196402.patch b/pyparted-3.9.5-rhbz1196402.patch deleted file mode 100644 index 4bec85e..0000000 --- a/pyparted-3.9.5-rhbz1196402.patch +++ /dev/null @@ -1,824 +0,0 @@ -diff -up pyparted-3.9.5/include/convert.h.orig pyparted-3.9.5/include/convert.h ---- pyparted-3.9.5/include/convert.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/convert.h 2015-04-24 15:14:10.756767442 -0400 -@@ -35,6 +35,13 @@ - #include "pynatmath.h" - #include "pytimer.h" - -+#if PY_MAJOR_VERSION < 3 -+#define PyUnicode_AsUTF8 PyString_AsString -+#define TP_FLAGS (Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_RICHCOMPARE) -+#else -+#define TP_FLAGS (Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE) -+#endif -+ - PedAlignment *_ped_Alignment2PedAlignment(PyObject *); - _ped_Alignment *PedAlignment2_ped_Alignment(PedAlignment *); - -diff -up pyparted-3.9.5/include/pyconstraint.h.orig pyparted-3.9.5/include/pyconstraint.h -diff -up pyparted-3.9.5/include/pydevice.h.orig pyparted-3.9.5/include/pydevice.h -diff -up pyparted-3.9.5/include/pydisk.h.orig pyparted-3.9.5/include/pydisk.h -diff -up pyparted-3.9.5/include/pyfilesys.h.orig pyparted-3.9.5/include/pyfilesys.h -diff -up pyparted-3.9.5/include/pygeom.h.orig pyparted-3.9.5/include/pygeom.h -diff -up pyparted-3.9.5/include/pynatmath.h.orig pyparted-3.9.5/include/pynatmath.h -diff -up pyparted-3.9.5/include/pytimer.h.orig pyparted-3.9.5/include/pytimer.h -diff -up pyparted-3.9.5/include/pyunit.h.orig pyparted-3.9.5/include/pyunit.h -diff -up pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig pyparted-3.9.5/include/typeobjects/pyconstraint.h ---- pyparted-3.9.5/include/typeobjects/pyconstraint.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pyconstraint.h 2015-04-24 15:10:33.717767442 -0400 -@@ -73,7 +73,6 @@ PyTypeObject _ped_Constraint_Type_obj = - .tp_dealloc = (destructor) _ped_Constraint_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Constraint_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -84,9 +83,7 @@ PyTypeObject _ped_Constraint_Type_obj = - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_Constraint_doc, - .tp_traverse = (traverseproc) _ped_Constraint_traverse, - .tp_clear = (inquiry) _ped_Constraint_clear, -diff -up pyparted-3.9.5/include/typeobjects/pydevice.h.orig pyparted-3.9.5/include/typeobjects/pydevice.h ---- pyparted-3.9.5/include/typeobjects/pydevice.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pydevice.h 2015-04-24 16:03:20.431767442 -0400 -@@ -25,6 +25,8 @@ - #ifndef TYPEOBJECTS_PYDEVICE_H_INCLUDED - #define TYPEOBJECTS_PYDEVICE_H_INCLUDED - -+#define PyGC_HEAD_SIZE 0 -+ - #include - #include - -@@ -58,7 +60,6 @@ PyTypeObject _ped_CHSGeometry_Type_obj = - .tp_dealloc = (destructor) _ped_CHSGeometry_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_CHSGeometry_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -69,8 +70,7 @@ PyTypeObject _ped_CHSGeometry_Type_obj = - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_CHSGeometry_doc, - .tp_traverse = (traverseproc) _ped_CHSGeometry_traverse, - .tp_clear = (inquiry) _ped_CHSGeometry_clear, -@@ -221,7 +221,6 @@ PyTypeObject _ped_Device_Type_obj = { - .tp_dealloc = (destructor) _ped_Device_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Device_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -232,8 +231,7 @@ PyTypeObject _ped_Device_Type_obj = { - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_Device_doc, - .tp_traverse = (traverseproc) _ped_Device_traverse, - .tp_clear = (inquiry) _ped_Device_clear, -diff -up pyparted-3.9.5/include/typeobjects/pydisk.h.orig pyparted-3.9.5/include/typeobjects/pydisk.h ---- pyparted-3.9.5/include/typeobjects/pydisk.h.orig 2015-04-24 14:46:46.312767442 -0400 -+++ pyparted-3.9.5/include/typeobjects/pydisk.h 2015-04-24 15:11:22.317767442 -0400 -@@ -81,7 +81,6 @@ PyTypeObject _ped_Partition_Type_obj = { - .tp_dealloc = (destructor) _ped_Partition_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Partition_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -92,9 +91,7 @@ PyTypeObject _ped_Partition_Type_obj = { - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_Partition_doc, - .tp_traverse = (traverseproc) _ped_Partition_traverse, - .tp_clear = (inquiry) _ped_Partition_clear, -@@ -221,7 +218,6 @@ PyTypeObject _ped_Disk_Type_obj = { - .tp_dealloc = (destructor) _ped_Disk_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Disk_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -232,8 +228,7 @@ PyTypeObject _ped_Disk_Type_obj = { - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_Disk_doc, - .tp_traverse = (traverseproc) _ped_Disk_traverse, - .tp_clear = (inquiry) _ped_Disk_clear, -@@ -286,7 +281,6 @@ PyTypeObject _ped_DiskType_Type_obj = { - .tp_dealloc = (destructor) _ped_DiskType_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_DiskType_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -297,9 +291,7 @@ PyTypeObject _ped_DiskType_Type_obj = { - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_DiskType_doc, - .tp_traverse = (traverseproc) _ped_DiskType_traverse, - .tp_clear = (inquiry) _ped_DiskType_clear, -diff -up pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig pyparted-3.9.5/include/typeobjects/pyfilesys.h ---- pyparted-3.9.5/include/typeobjects/pyfilesys.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pyfilesys.h 2015-04-24 15:11:41.964767442 -0400 -@@ -51,7 +51,6 @@ PyTypeObject _ped_FileSystemType_Type_ob - .tp_dealloc = (destructor) _ped_FileSystemType_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_FileSystemType_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -62,9 +61,7 @@ PyTypeObject _ped_FileSystemType_Type_ob - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_FileSystemType_doc, - .tp_traverse = (traverseproc) _ped_FileSystemType_traverse, - .tp_clear = (inquiry) _ped_FileSystemType_clear, -@@ -106,7 +103,6 @@ PyTypeObject _ped_FileSystem_Type_obj = - .tp_dealloc = (destructor) _ped_FileSystem_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_FileSystemType_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -117,9 +113,7 @@ PyTypeObject _ped_FileSystem_Type_obj = - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_FileSystem_doc, - .tp_traverse = (traverseproc) _ped_FileSystem_traverse, - .tp_clear = (inquiry) _ped_FileSystem_clear, -diff -up pyparted-3.9.5/include/typeobjects/pygeom.h.orig pyparted-3.9.5/include/typeobjects/pygeom.h ---- pyparted-3.9.5/include/typeobjects/pygeom.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pygeom.h 2015-04-24 15:11:52.836767442 -0400 -@@ -91,7 +91,6 @@ PyTypeObject _ped_Geometry_Type_obj = { - .tp_dealloc = (destructor) _ped_Geometry_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Geometry_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -102,8 +101,7 @@ PyTypeObject _ped_Geometry_Type_obj = { - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_Geometry_doc, - .tp_traverse = (traverseproc) _ped_Geometry_traverse, - .tp_clear = (inquiry) _ped_Geometry_clear, -diff -up pyparted-3.9.5/include/typeobjects/pynatmath.h.orig pyparted-3.9.5/include/typeobjects/pynatmath.h ---- pyparted-3.9.5/include/typeobjects/pynatmath.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pynatmath.h 2015-04-24 15:12:01.852767442 -0400 -@@ -67,7 +67,6 @@ PyTypeObject _ped_Alignment_Type_obj = { - .tp_dealloc = (destructor) _ped_Alignment_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Alignment_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -78,8 +77,7 @@ PyTypeObject _ped_Alignment_Type_obj = { - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = _ped_Alignment_doc, - .tp_traverse = (traverseproc) _ped_Alignment_traverse, - .tp_clear = (inquiry) _ped_Alignment_clear, -diff -up pyparted-3.9.5/include/typeobjects/pytimer.h.orig pyparted-3.9.5/include/typeobjects/pytimer.h ---- pyparted-3.9.5/include/typeobjects/pytimer.h.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/include/typeobjects/pytimer.h 2015-04-24 15:12:11.964767442 -0400 -@@ -68,7 +68,6 @@ PyTypeObject _ped_Timer_Type_obj = { - .tp_dealloc = (destructor) _ped_Timer_dealloc, - /* .tp_getattr = XXX */ - /* .tp_setattr = XXX */ -- .tp_compare = (cmpfunc) _ped_Timer_compare, - /* .tp_repr = XXX */ - /* .tp_as_number = XXX */ - /* .tp_as_sequence = XXX */ -@@ -79,9 +78,7 @@ PyTypeObject _ped_Timer_Type_obj = { - .tp_getattro = PyObject_GenericGetAttr, - .tp_setattro = PyObject_GenericSetAttr, - /* .tp_as_buffer = XXX */ -- .tp_flags = Py_TPFLAGS_HAVE_CLASS | Py_TPFLAGS_CHECKTYPES | -- Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE | -- Py_TPFLAGS_HAVE_RICHCOMPARE, -+ .tp_flags = TP_FLAGS, - .tp_doc = "PedTimer objects", - .tp_traverse = (traverseproc) _ped_Timer_traverse, - .tp_clear = (inquiry) _ped_Timer_clear, -diff -up pyparted-3.9.5/setup.py.orig pyparted-3.9.5/setup.py ---- pyparted-3.9.5/setup.py.orig 2014-06-24 13:33:17.000000000 -0400 -+++ pyparted-3.9.5/setup.py 2015-04-24 14:46:46.316767442 -0400 -@@ -17,7 +17,7 @@ - # - # Author(s): David Cantrell - --import commands -+import subprocess - import glob - import os - import platform -@@ -29,13 +29,12 @@ from distutils.core import setup - from distutils.core import Extension - - pyparted_version = '3.9.5' --python_version = platform.python_version_tuple() -+python_version = sys.version_info - - need_libparted_version = '3.1' --need_python_version = [2, 7] -+need_python_version = (2, 7) - --if python_version[0] < need_python_version[0] or \ -- python_version[1] < need_python_version[1]: -+if python_version < need_python_version: - raise RuntimeError("pyparted requires Python version %d.%d or higher" - % (need_python_version[0], need_python_version[1],)) - -@@ -43,12 +42,12 @@ if python_version[0] < need_python_versi - # http://code.activestate.com/recipes/502261-python-distutils-pkg-config/ - def pkgconfig(*packages, **kwargs): - flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} -- for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): -+ for token in subprocess.check_output(["pkg-config", "--libs", "--cflags"] + list(packages)).decode('utf-8').split(): - kwargs.setdefault(flag_map.get(token[:2]), []).append(token[2:]) - return kwargs - - def check_mod_version(module, version): -- modversion = commands.getoutput("pkg-config --modversion %s" % module) -+ modversion = subprocess.check_output(["pkg-config", "--modversion", module]) - if not float(modversion) >= float(version): - sys.stderr.write("*** Minimum required %s version: %s, found: %s\n" % (module, version, modversion,)) - sys.exit(1) -diff -up pyparted-3.9.5/src/parted/alignment.py.orig pyparted-3.9.5/src/parted/alignment.py ---- pyparted-3.9.5/src/parted/alignment.py.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/parted/alignment.py 2015-04-24 16:14:05.875767442 -0400 -@@ -45,7 +45,7 @@ class Alignment(object): - self.__alignment = _ped.Alignment(kwargs.get("offset"), - kwargs.get("grainSize")) - else: -- raise parted.AlignmentException, "no offset+grainSize or PedAlignment specified" -+ raise parted.AlignmentException("no offset+grainSize or PedAlignment specified") - - offset = property(lambda s: s.__alignment.offset, lambda s, v: setattr(s.__alignment, "offset", v)) - grainSize = property(lambda s: s.__alignment.grain_size, lambda s, v: setattr(s.__alignment, "grain_size", v)) -@@ -106,10 +106,10 @@ class Alignment(object): - """Determine whether sector lies inside geom and satisfies the - alignment constraint self.""" - if not geom: -- raise TypeError, "missing parted.Geometry parameter" -+ raise TypeError("missing parted.Geometry parameter") - - if sector is None: -- raise TypeError, "missing sector parameter" -+ raise TypeError("missing sector parameter") - - return self.__alignment.is_aligned(geom.getPedGeometry(), sector) - -diff -up pyparted-3.9.5/src/parted/constraint.py.orig pyparted-3.9.5/src/parted/constraint.py ---- pyparted-3.9.5/src/parted/constraint.py.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/parted/constraint.py 2015-04-24 16:15:10.650767442 -0400 -@@ -80,7 +80,7 @@ class Constraint(object): - self.__constraint = _ped.Constraint(starta, enda, startr, endr, - mins, maxs) - else: -- raise parted.ConstraintException, "missing initialization parameters" -+ raise parted.ConstraintException("missing initialization parameters") - - def __eq__(self, other): - return not self.__ne__(other) -diff -up pyparted-3.9.5/src/parted/device.py.orig pyparted-3.9.5/src/parted/device.py ---- pyparted-3.9.5/src/parted/device.py.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/parted/device.py 2015-04-24 16:15:40.418767442 -0400 -@@ -53,7 +53,7 @@ class Device(object): - elif path is not None: - self.__device = _ped.device_get(path) - else: -- raise parted.DeviceException, "no path or PedDevice specified" -+ raise parted.DeviceException("no path or PedDevice specified") - - def __eq__(self, other): - return not self.__ne__(other) -@@ -293,7 +293,7 @@ class Device(object): - lunit = unit.lower() - - if lunit not in parted._exponent.keys(): -- raise SyntaxError, "invalid unit %s given" % (unit,) -+ raise SyntaxError("invalid unit %s given" % unit) - - size = float(self.__device.length) - size /= math.pow(1024.0, parted._exponent[lunit]) -diff -up pyparted-3.9.5/src/parted/disk.py.orig pyparted-3.9.5/src/parted/disk.py ---- pyparted-3.9.5/src/parted/disk.py.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/parted/disk.py 2015-04-24 16:13:15.763767442 -0400 -@@ -46,7 +46,7 @@ class Disk(object): - else: - self._device = device - elif device is None: -- raise parted.DiskException, "no device specified" -+ raise parted.DiskException("no device specified") - else: - self.__disk = _ped.Disk(device.getPedDevice()) - self._device = device -@@ -245,7 +245,7 @@ class Disk(object): - result = self.__disk.add_partition(partition.getPedPartition(), - constraint.getPedConstraint()) - elif not partition: -- raise parted.DiskException, "no partition or constraint specified" -+ raise parted.DiskException("no partition or constraint specified") - else: - result = self.__disk.add_partition(partition.getPedPartition()) - -@@ -264,7 +264,7 @@ class Disk(object): - actually destroyed unless you use the deletePartition() - method.""" - if not partition: -- raise parted.DiskException, "no partition specified" -+ raise parted.DiskException("no partition specified") - - if self.__disk.remove_partition(partition.getPedPartition()): - self.partitions.invalidate() -@@ -299,10 +299,10 @@ class Disk(object): - does not modify the partition contents, just the partition - table.""" - if not partition or not constraint: -- raise parted.DiskException, "no partition or constraint specified" -+ raise parted.DiskException("no partition or constraint specified") - - if not start or not end: -- raise parted.DiskException, "no start or end geometry specified" -+ raise parted.DiskException("no start or end geometry specified") - - return self.__disk.set_partition_geom(partition.getPedPartition(), - constraint.getPedConstraint(), -@@ -313,7 +313,7 @@ class Disk(object): - """Grow the Partition's Geometry to the maximum possible subject - to Constraint.""" - if not partition: -- raise parted.DiskException, "no partition specified" -+ raise parted.DiskException("no partition specified") - - if constraint: - return self.__disk.maximize_partition(partition.getPedPartition(), -@@ -326,7 +326,7 @@ class Disk(object): - """Get the maximum Geometry the Partition can be grown to, - subject to the given Constraint.""" - if not partition: -- raise parted.DiskException, "no partition specified" -+ raise parted.DiskException("no partition specified") - - if constraint: - return parted.Geometry(PedGeometry=self.__disk.get_max_partition_geometry(partition.getPedPartition(), constraint.getPedConstraint())) -diff -up pyparted-3.9.5/src/parted/filesystem.py.orig pyparted-3.9.5/src/parted/filesystem.py ---- pyparted-3.9.5/src/parted/filesystem.py.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/parted/filesystem.py 2015-04-24 16:13:37.291767442 -0400 -@@ -38,9 +38,9 @@ class FileSystem(object): - - if PedFileSystem is None: - if type is None: -- raise parted.FileSystemException, "no type specified" -+ raise parted.FileSystemException("no type specified") - elif geometry is None: -- raise parted.FileSystemException, "no geometry specified" -+ raise parted.FileSystemException("no geometry specified") - - self._type = type - self._geometry = geometry -diff -up pyparted-3.9.5/src/parted/geometry.py.orig pyparted-3.9.5/src/parted/geometry.py ---- pyparted-3.9.5/src/parted/geometry.py.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/parted/geometry.py 2015-04-24 16:12:14.740767442 -0400 -@@ -60,7 +60,7 @@ class Geometry(object): - self._device = device - self.__geometry = _ped.Geometry(self.device.getPedDevice(), start, length, end=end) - else: -- raise parted.GeometryException, "must specify PedGeometry or (device, start, length) or (device, start, end) or (device, start, length, end)" -+ raise parted.GeometryException("must specify PedGeometry or (device, start, length) or (device, start, end) or (device, start, length, end)") - - def __eq__(self, other): - return not self.__ne__(other) -@@ -126,7 +126,7 @@ class Geometry(object): - size = self.length * self.device.sectorSize - - if lunit not in parted._exponent.keys(): -- raise SyntaxError, "invalid unit %s given" % (unit,) -+ raise SyntaxError("invalid unit %s given" % unit) - - return (size / math.pow(1024.0, parted._exponent[lunit])) - -diff -up pyparted-3.9.5/src/parted/__init__.py.orig pyparted-3.9.5/src/parted/__init__.py ---- pyparted-3.9.5/src/parted/__init__.py.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/parted/__init__.py 2015-04-24 16:11:37.228767442 -0400 -@@ -413,7 +413,7 @@ def freshDisk(device, ty): - if type(ty) == str: - ty = diskType[ty] - elif not isinstance(ty, DiskType): -- raise SyntaxError, "type must be a key or value in parted.diskType" -+ raise SyntaxError("type must be a key or value in parted.diskType") - - peddisk = disk_new_fresh(device.getPedDevice(), ty) - return Disk(PedDisk=peddisk) -diff -up pyparted-3.9.5/src/parted/partition.py.orig pyparted-3.9.5/src/parted/partition.py ---- pyparted-3.9.5/src/parted/partition.py.orig 2015-04-24 14:46:46.312767442 -0400 -+++ pyparted-3.9.5/src/parted/partition.py 2015-04-24 16:14:49.467767442 -0400 -@@ -38,11 +38,11 @@ class Partition(object): - def __init__(self, disk=None, type=None, fs=None, geometry=None, PedPartition=None): - if PedPartition is None: - if disk is None: -- raise parted.PartitionException, "no disk specified" -+ raise parted.PartitionException("no disk specified") - elif type is None: -- raise parted.PartitionException, "no type specified" -+ raise parted.PartitionException("no type specified") - elif geometry is None: -- raise parted.PartitionException, "no geometry specified" -+ raise parted.PartitionException("no geometry specified") - - self._fileSystem = fs - self._geometry = geometry -@@ -96,7 +96,7 @@ class Partition(object): - return s - - def __writeOnly(self, property): -- raise parted.WriteOnlyProperty, property -+ raise parted.WriteOnlyProperty(property) - - @property - @localeC -@@ -224,7 +224,7 @@ class Partition(object): - lunit = unit.lower() - - if lunit not in parted._exponent.keys(): -- raise SyntaxError, "invalid unit %s given" % (unit,) -+ raise SyntaxError("invalid unit %s given" % unit) - - maxLength = self.geometry.length - sectorSize = self.geometry.device.sectorSize -diff -up pyparted-3.9.5/src/pyconstraint.c.orig pyparted-3.9.5/src/pyconstraint.c ---- pyparted-3.9.5/src/pyconstraint.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pyconstraint.c 2015-04-24 16:28:13.589767442 -0400 -@@ -77,18 +77,11 @@ int _ped_Constraint_compare(_ped_Constra - } - - PyObject *_ped_Constraint_richcompare(_ped_Constraint *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_Constraint_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_Constraint_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_Constraint_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Constraint"); -diff -up pyparted-3.9.5/src/pydevice.c.orig pyparted-3.9.5/src/pydevice.c ---- pyparted-3.9.5/src/pydevice.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pydevice.c 2015-04-24 16:29:19.613767442 -0400 -@@ -61,18 +61,11 @@ int _ped_CHSGeometry_compare(_ped_CHSGeo - - PyObject *_ped_CHSGeometry_richcompare(_ped_CHSGeometry *a, PyObject *b, - int op) { -- if (op == Py_EQ) { -- if (!(_ped_CHSGeometry_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_CHSGeometry_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_CHSGeometry_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.CHSGeometry"); -@@ -175,18 +168,11 @@ int _ped_Device_compare(_ped_Device *sel - } - - PyObject *_ped_Device_richcompare(_ped_Device *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_Device_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_Device_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_Device_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Device"); -diff -up pyparted-3.9.5/src/pydisk.c.orig pyparted-3.9.5/src/pydisk.c ---- pyparted-3.9.5/src/pydisk.c.orig 2015-04-24 14:46:46.312767442 -0400 -+++ pyparted-3.9.5/src/pydisk.c 2015-04-24 16:30:15.132767442 -0400 -@@ -47,40 +47,15 @@ void _ped_Partition_dealloc(_ped_Partiti - PyObject_GC_Del(self); - } - --int _ped_Partition_compare(_ped_Partition *self, PyObject *obj) { -- _ped_Partition *comp = NULL; -- int check = PyObject_IsInstance(obj, (PyObject *) &_ped_Partition_Type_obj); -- -- if (PyErr_Occurred()) { -- return -1; -- } -- -- if (!check) { -- PyErr_SetString(PyExc_ValueError, "object comparing to must be a _ped.Partition"); -- return -1; -- } -- -- comp = (_ped_Partition *) obj; -- if ((_ped_Disk_Type_obj.tp_richcompare(self->disk, comp->disk, Py_EQ)) && -- (_ped_Geometry_Type_obj.tp_richcompare(self->geom, comp->geom, Py_EQ)) && -- (self->ped_partition->num == comp->ped_partition->num) && -- (self->type == comp->type) && -- (_ped_FileSystemType_Type_obj.tp_richcompare(self->fs_type, comp->fs_type, Py_EQ))) { -- return 0; -- } else { -- return 1; -- } --} -- - PyObject *_ped_Partition_richcompare(_ped_Partition *a, PyObject *b, int op) { - if (op == Py_EQ) { -- if (!(_ped_Partition_Type_obj.tp_compare((PyObject *) a, b))) { -+ if ((_ped_Partition_Type_obj.tp_richcompare((PyObject *) a, b, Py_EQ))) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; - } - } else if (op == Py_NE) { -- if (_ped_Partition_Type_obj.tp_compare((PyObject *) a, b)) { -+ if (!(_ped_Partition_Type_obj.tp_richcompare((PyObject *) a, b, Py_EQ))) { - Py_RETURN_TRUE; - } else { - Py_RETURN_FALSE; -@@ -324,18 +299,11 @@ int _ped_Disk_compare(_ped_Disk *self, P - } - - PyObject *_ped_Disk_richcompare(_ped_Disk *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_Disk_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_Disk_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_Disk_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Disk"); -@@ -476,18 +444,11 @@ int _ped_DiskType_compare(_ped_DiskType - } - - PyObject *_ped_DiskType_richcompare(_ped_DiskType *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_DiskType_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_DiskType_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_DiskType_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.DiskType"); -diff -up pyparted-3.9.5/src/pyfilesys.c.orig pyparted-3.9.5/src/pyfilesys.c ---- pyparted-3.9.5/src/pyfilesys.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pyfilesys.c 2015-04-24 16:31:06.244767442 -0400 -@@ -61,18 +61,11 @@ int _ped_FileSystemType_compare(_ped_Fil - - PyObject *_ped_FileSystemType_richcompare(_ped_FileSystemType *a, PyObject *b, - int op) { -- if (op == Py_EQ) { -- if (!(_ped_FileSystemType_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_FileSystemType_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_FileSystemType_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.FileSystemType"); -@@ -158,22 +151,14 @@ int _ped_FileSystem_compare(_ped_FileSys - } else { - return 1; - } -- - } - - PyObject *_ped_FileSystem_richcompare(_ped_FileSystem *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_FileSystem_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_FileSystem_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_FileSystem_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.FileSystem"); -diff -up pyparted-3.9.5/src/pygeom.c.orig pyparted-3.9.5/src/pygeom.c ---- pyparted-3.9.5/src/pygeom.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pygeom.c 2015-04-24 16:31:28.724767442 -0400 -@@ -57,7 +57,7 @@ int _ped_Geometry_compare(_ped_Geometry - } - - comp = (_ped_Geometry *) obj; -- if ((_ped_Geometry_Type_obj.tp_richcompare(self->dev, comp->dev, Py_EQ)) && -+ if (PyObject_RichCompareBool(self->dev, comp->dev, Py_EQ) && - (self->ped_geometry->start == comp->ped_geometry->start) && - (self->ped_geometry->length == comp->ped_geometry->length) && - (self->ped_geometry->end == comp->ped_geometry->end)) { -@@ -68,18 +68,11 @@ int _ped_Geometry_compare(_ped_Geometry - } - - PyObject *_ped_Geometry_richcompare(_ped_Geometry *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_Geometry_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_Geometry_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_Geometry_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Geometry"); -diff -up pyparted-3.9.5/src/pynatmath.c.orig pyparted-3.9.5/src/pynatmath.c ---- pyparted-3.9.5/src/pynatmath.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pynatmath.c 2015-04-24 16:31:44.660767442 -0400 -@@ -59,18 +59,11 @@ int _ped_Alignment_compare(_ped_Alignmen - } - - PyObject *_ped_Alignment_richcompare(_ped_Alignment *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_Alignment_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_Alignment_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_Alignment_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Alignment"); -diff -up pyparted-3.9.5/src/pytimer.c.orig pyparted-3.9.5/src/pytimer.c ---- pyparted-3.9.5/src/pytimer.c.orig 2014-06-24 13:06:32.000000000 -0400 -+++ pyparted-3.9.5/src/pytimer.c 2015-04-24 16:32:05.076767442 -0400 -@@ -63,18 +63,11 @@ int _ped_Timer_compare(_ped_Timer *self, - } - - PyObject *_ped_Timer_richcompare(_ped_Timer *a, PyObject *b, int op) { -- if (op == Py_EQ) { -- if (!(_ped_Timer_Type_obj.tp_compare((PyObject *) a, b))) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -- } else if (op == Py_NE) { -- if (_ped_Timer_Type_obj.tp_compare((PyObject *) a, b)) { -- Py_RETURN_TRUE; -- } else { -- Py_RETURN_FALSE; -- } -+ if (op == Py_EQ || op == Py_NE) { -+ int rv = _ped_Timer_compare(a, b); -+ if (PyErr_Occurred()) -+ return NULL; -+ return PyBool_FromLong(op == Py_EQ ? rv == 0 : rv != 0); - } else if ((op == Py_LT) || (op == Py_LE) || - (op == Py_GT) || (op == Py_GE)) { - PyErr_SetString(PyExc_TypeError, "comparison operator not supported for _ped.Timer"); -diff -up pyparted-3.9.5/src/pyunit.c.orig pyparted-3.9.5/src/pyunit.c diff --git a/pyparted.spec b/pyparted.spec index c554333..338d9ec 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -3,17 +3,13 @@ Summary: Python module for GNU parted Name: pyparted Epoch: 1 -Version: 3.9.5 -Release: 4%{?dist} +Version: 3.10.4 +Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: http://fedorahosted.org/pyparted Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz -# https://github.com/dcantrell/pyparted/commit/3aaf84837822ae2df044b583b52c5940ce01482c -# backported to 3.9.5 by vpodzime. Needed for blivet fix for RHBZ #1166598 -Patch0: add_partition_reset_num_method.patch -Patch1: pyparted-3.9.5-rhbz1196402.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel @@ -40,8 +36,6 @@ partition tables. This package provides Python 3 bindings for parted. %prep %setup -q -%patch0 -p1 -%patch1 -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -96,8 +90,9 @@ rm -rf %{buildroot} %endif %changelog -* Fri Apr 24 2015 David Cantrell - 1:3.9.5-4 -- Add Python 3 subpackage (#1196402) +* Tue May 05 2015 David Cantrell - 1:3.10.4-1 +- Upgrade to pyparted-3.10.4 for multiple fixes and to add a Python 3 + subpackage (#1196402) * Mon Dec 01 2014 Adam Williamson - 1:3.9.5-3 - backport resetNumber() function from 3.10 (needed to fix RHBZ #1166598) diff --git a/sources b/sources index 001af75..4fe5625 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9cf098ec38b9fe0af98782671027c5d6 pyparted-3.9.5.tar.gz +f7b324cfd13210cc802c87628ecf8f35 pyparted-pyparted-3.10.4.tar.gz From 0f87bbcfeb97cb2c6fc7efc8bcc0044eefc32885 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 5 May 2015 09:37:38 -0400 Subject: [PATCH 21/22] Upgrade to pyparted-3.10.4 for multiple fixes and to add a Python 3 subpackage (#1196402) --- pyparted.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyparted.spec b/pyparted.spec index 338d9ec..43a8425 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -7,9 +7,9 @@ Version: 3.10.4 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Libraries -URL: http://fedorahosted.org/pyparted +URL: https://github.com/dcantrell/%{name} -Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz +Source0: https://github.com/dcantrell/%{name}/releases/%{name}-%{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) BuildRequires: python-devel From 8f1db7747753b5da8ccc7861efef538a9f76fbfc Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 5 May 2015 09:47:15 -0400 Subject: [PATCH 22/22] Upgrade to pyparted-3.10.4 for multiple fixes and to add a Python 3 subpackage (#1196402) --- pyparted.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyparted.spec b/pyparted.spec index 43a8425..59be362 100644 --- a/pyparted.spec +++ b/pyparted.spec @@ -35,7 +35,7 @@ partition tables. This package provides Python 3 bindings for parted. %endif %prep -%setup -q +%setup -q -n %{name}-%{name}-%{version} %if 0%{?with_python3} rm -rf %{py3dir} @@ -75,8 +75,8 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc AUTHORS BUGS COPYING ChangeLog NEWS README TODO -%{python_sitearch}/_pedmodule.so +%doc AUTHORS BUGS COPYING NEWS README TODO +%{python_sitearch}/_ped.so %{python_sitearch}/parted %{python_sitearch}/%{name}-%{version}-*.egg-info