dcantrel pushed to pyparted (f21). "Upgrade to pyparted-3.10.4 for multiple fixes and to add a Python 3 (..more)"
notifications at fedoraproject.org
notifications at fedoraproject.org
Tue May 5 12:56:22 UTC 2015
>From 3404ffe17b456caacf48fae99524e0a27394240f Mon Sep 17 00:00:00 2001
From: David Cantrell <dcantrell at redhat.com>
Date: Tue, 5 May 2015 08:55:52 -0400
Subject: Upgrade to pyparted-3.10.4 for multiple fixes and to add a Python 3
subpackage (#1196402)
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 <Python.h>
- #include <structmember.h>
-
-@@ -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 <dcantrell at redhat.com>
-
--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 <dcantrell at redhat.com> - 1:3.9.5-4
-- Add Python 3 subpackage (#1196402)
+* Tue May 05 2015 David Cantrell <dcantrell at redhat.com> - 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 <awilliam at redhat.com> - 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
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/pyparted.git/commit/?h=f21&id=3404ffe17b456caacf48fae99524e0a27394240f
More information about the scm-commits
mailing list