From b10e8ef6856683a0d144229297982d8c099cea5d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:39:24 +0000 Subject: import pyparted-3.9-15.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0077624 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/pyparted-3.9.tar.gz diff --git a/.pyparted.metadata b/.pyparted.metadata new file mode 100644 index 0000000..35e83a1 --- /dev/null +++ b/.pyparted.metadata @@ -0,0 +1 @@ +c23529cf84429f80738b692ea593892cc9674cc8 SOURCES/pyparted-3.9.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Do-not-traceback-when-calling-setlocale-875354.patch b/SOURCES/0001-Do-not-traceback-when-calling-setlocale-875354.patch new file mode 100644 index 0000000..6f8123f --- /dev/null +++ b/SOURCES/0001-Do-not-traceback-when-calling-setlocale-875354.patch @@ -0,0 +1,42 @@ +From a43c9ca4e0fb600d425f50d11287f7c4fddee5f3 Mon Sep 17 00:00:00 2001 +From: Chris Lumens +Date: Fri, 14 Dec 2012 13:06:43 -0500 +Subject: [PATCH 01/03] Do not traceback when calling setlocale (#875354). + +This is just a debugging luxury. It's not worth additional tracebacks. +--- + src/parted/decorators.py | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/src/parted/decorators.py b/src/parted/decorators.py +index 2b583ad..737f72c 100644 +--- a/src/parted/decorators.py ++++ b/src/parted/decorators.py +@@ -24,13 +24,22 @@ import locale + import functools + + def localeC(fn): ++ # setlocale is not thread-safe, and anaconda (at least) may call this from ++ # another thread. This is just a luxury to have untranslated tracebacks, ++ # so it's not worth tracebacking itself. ++ def _setlocale(l): ++ try: ++ locale.setlocale(locale.LC_MESSAGES, l) ++ except: ++ pass ++ + @functools.wraps(fn) + def new(*args, **kwds): + oldlocale = locale.getlocale(locale.LC_MESSAGES) +- locale.setlocale(locale.LC_MESSAGES, 'C') ++ _setlocale('C') + try: + ret = fn(*args, **kwds) + finally: +- locale.setlocale(locale.LC_MESSAGES, oldlocale) ++ _setlocale(oldlocale) + return ret + return new +-- +1.8.1.2 + diff --git a/SOURCES/0001-Fix-some-tests-under-python-coverage-1057626.patch b/SOURCES/0001-Fix-some-tests-under-python-coverage-1057626.patch new file mode 100644 index 0000000..739b3be --- /dev/null +++ b/SOURCES/0001-Fix-some-tests-under-python-coverage-1057626.patch @@ -0,0 +1,90 @@ +From 37971c2c0a3e20aafbc587a666b0c7b7d6822be3 Mon Sep 17 00:00:00 2001 +From: David Cantrell +Date: Tue, 19 Aug 2014 13:43:32 -0400 +Subject: [PATCH] Fix some tests under python-coverage (#1057626) + +Fix some tests running under python-coverage, but disable some that are +problematic. It appears to be a problem with the unittest module and +python-coverage at the moment, but the bulk of test cases work. +--- + tests/test__ped_constraint.py | 6 ++++-- + tests/test_parted_constraint.py | 2 +- + tests/test_parted_parted.py | 4 ++-- + 3 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/tests/test__ped_constraint.py b/tests/test__ped_constraint.py +index ea27af2..6fdd139 100755 +--- a/tests/test__ped_constraint.py ++++ b/tests/test__ped_constraint.py +@@ -137,6 +137,7 @@ class ConstraintDuplicateTestCase(RequiresDevice): + self.assertEquals(self.c.end_range.length, self.dup.end_range.length) + self.assertEquals(self.c.end_range.end, self.dup.end_range.end) + ++@unittest.skip("Temporarily disabled due to unitted module problems.") + class ConstraintIntersectTestCase(RequiresDevice): + def setUp(self): + RequiresDevice.setUp(self) +@@ -169,7 +170,7 @@ class ConstraintIntersectTestCase(RequiresDevice): + min_size=minSize, max_size=maxSize) + + result = self.c1.intersect(self.c2) +- self.assertEquals(result, expected) ++ self.assertEqual(result, expected) + + class ConstraintSolveMaxTestCase(RequiresDevice): + def setUp(self): +@@ -181,6 +182,7 @@ class ConstraintSolveMaxTestCase(RequiresDevice): + self.assertEquals(result.dev, self._device) + self.assertTrue(result.length >= (self._device.length - 1)) + ++@unittest.skip("Temporarily disabled due to unitted module problems.") + class ConstraintSolveNearestTestCase(RequiresDevice): + def setUp(self): + RequiresDevice.setUp(self) +@@ -189,7 +191,7 @@ class ConstraintSolveNearestTestCase(RequiresDevice): + + def runTest(self): + result = self.c1.solve_nearest(self.g1) +- self.assertEquals(result, self.g1) ++ self.assertTrue(self.assertTrue(isinstance(result, _ped.Geometry))) + + class ConstraintIsSolutionTestCase(RequiresDevice): + def setUp(self): +diff --git a/tests/test_parted_constraint.py b/tests/test_parted_constraint.py +index 43cce37..9c387d2 100755 +--- a/tests/test_parted_constraint.py ++++ b/tests/test_parted_constraint.py +@@ -70,7 +70,7 @@ class ConstraintNewTestCase(RequiresDevice): + 10, 100) + c = parted.Constraint(PedConstraint=pc) + self.assert_(isinstance(c, parted.Constraint)) +- self.assertTrue(c.getPedConstraint() == pc) ++ self.assertIs(c.getPedConstraint(), pc) + + class ConstraintGetSetTestCase(RequiresDevice): + def setUp(self): +diff --git a/tests/test_parted_parted.py b/tests/test_parted_parted.py +index 9f323e3..f9cfaaa 100755 +--- a/tests/test_parted_parted.py ++++ b/tests/test_parted_parted.py +@@ -109,7 +109,7 @@ class FreshDiskTestCase(RequiresDevice): + # XXX: Skip over dvh for now (SGI disk label), which doesn't seem to have + # working libparted support. If anyone with an SGI cares, patches welcome. + for key in parted.diskType.keys(): +- if key == 'dvh': ++ if key in ['dvh', 'aix']: + continue + disk = parted.freshDisk(self.device, key) + self.assert_(isinstance(disk, parted.Disk)) +@@ -117,7 +117,7 @@ class FreshDiskTestCase(RequiresDevice): + + # Create a new disk each disk type value, verify each one + for value in parted.diskType.values(): +- if value.name == 'dvh': ++ if value.name in ['dvh', 'aix']: + continue + disk = parted.freshDisk(self.device, value) + self.assert_(isinstance(disk, parted.Disk)) +-- +1.8.3.1 + diff --git a/SOURCES/0001-support-ppc64le-in-pyparted.patch b/SOURCES/0001-support-ppc64le-in-pyparted.patch new file mode 100644 index 0000000..20b3127 --- /dev/null +++ b/SOURCES/0001-support-ppc64le-in-pyparted.patch @@ -0,0 +1,51 @@ +From d8a1ed4a28dfb8541b95b3635660dfe18fa37a19 Mon Sep 17 00:00:00 2001 +From: root +Date: Thu, 8 May 2014 15:32:51 -0500 +Subject: [PATCH 1/7] support ppc64le in pyparted + +Add ppc64le support to pyparted +--- + src/parted/__init__.py | 6 ++++-- + tests/test_parted_parted.py | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/parted/__init__.py b/src/parted/__init__.py +index 8208c75..ae7bc4b 100644 +--- a/src/parted/__init__.py ++++ b/src/parted/__init__.py +@@ -278,6 +278,8 @@ archLabels = {'i386': ['msdos', 'gpt'], + 'sparc': ['sun'], + 'ia64': ['msdos', 'gpt'], + 'ppc': ['msdos', 'mac', 'amiga', 'gpt'], ++ 'ppc64': ['msdos', 'mac', 'amiga', 'gpt'], ++ 'ppc64le': ['msdos', 'gpt'], + 'x86_64': ['msdos', 'gpt'], + 'aarch64': ['msdos', 'gpt']} + +@@ -313,9 +315,9 @@ def Deprecated(mod, deprecated={}): + __archLabels = (('amiga', 'ppc(64)?$'), + ('bsd', 'alpha$'), + ('dasd', 's390x?$'), +- ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64)?$|aarch64$'), ++ ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64|64le)?$|aarch64$'), + ('mac', 'ppc(64)?$'), +- ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64)?$|aarch64$'), ++ ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64|64le)?$|aarch64$'), + ('sun', 'sparc(64)?$')) + + def getLabels(arch=None): +diff --git a/tests/test_parted_parted.py b/tests/test_parted_parted.py +index 29aeb10..b2db935 100755 +--- a/tests/test_parted_parted.py ++++ b/tests/test_parted_parted.py +@@ -57,6 +57,7 @@ class GetLabelsTestCase(unittest.TestCase): + self.assertSetEqual(parted.getLabels('sparc64'), {'sun'}) + self.assertSetEqual(parted.getLabels('ppc'), {'amiga', 'gpt', 'mac', 'msdos'}) + self.assertSetEqual(parted.getLabels('ppc64'), {'amiga', 'gpt', 'mac', 'msdos'}) ++ self.assertSetEqual(parted.getLabels('ppc64le'), {'gpt', 'msdos'}) + self.assertSetEqual(parted.getLabels('alpha'), {'bsd', 'msdos'}) + self.assertSetEqual(parted.getLabels('ia64'), {'gpt', 'msdos'}) + self.assertSetEqual(parted.getLabels('aarch64'), {'gpt', 'msdos'}) +-- +1.8.3.1 + diff --git a/SOURCES/0002-Convert-Constraint-to-__ped.Constraint-in-partition..patch b/SOURCES/0002-Convert-Constraint-to-__ped.Constraint-in-partition..patch new file mode 100644 index 0000000..07b658e --- /dev/null +++ b/SOURCES/0002-Convert-Constraint-to-__ped.Constraint-in-partition..patch @@ -0,0 +1,26 @@ +From 760a3b7c39a59c2e0f131b40e0a48bdf8240f637 Mon Sep 17 00:00:00 2001 +From: Chris Tyler +Date: Fri, 11 Jan 2013 13:42:29 -0500 +Subject: [PATCH 02/03] Convert Constraint to __ped.Constraint in + partition.getMaxGeometry() + +--- + src/parted/partition.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/parted/partition.py b/src/parted/partition.py +index 20b6f41..ee3e2d0 100644 +--- a/src/parted/partition.py ++++ b/src/parted/partition.py +@@ -166,7 +166,7 @@ class Partition(object): + def getMaxGeometry(self, constraint): + """Given a constraint, return the maximum Geometry that self can be + grown to. Raises Partitionexception on error.""" +- return parted.Geometry(PedGeometry=self.disk.getPedDisk().get_max_partition_geometry(self.__partition, constraint)) ++ return parted.Geometry(PedGeometry=self.disk.getPedDisk().get_max_partition_geometry(self.__partition, constraint.getPedConstraint())) + + @localeC + def isFlagAvailable(self, flag): +-- +1.8.1.2 + diff --git a/SOURCES/0003-Subject-PATCH-pyparted-export-ped_disk_new-functiona.patch b/SOURCES/0003-Subject-PATCH-pyparted-export-ped_disk_new-functiona.patch new file mode 100644 index 0000000..39665f4 --- /dev/null +++ b/SOURCES/0003-Subject-PATCH-pyparted-export-ped_disk_new-functiona.patch @@ -0,0 +1,131 @@ +From 36384816c56d666bbf3492ddcc531bf4c4a38674 Mon Sep 17 00:00:00 2001 +From: Nageswara R Sastry +Date: Thu, 23 May 2013 09:14:10 -0400 +Subject: [PATCH 03/03] Subject: [PATCH] pyparted: export ped_disk_new + functionality + +Fixed Block Access (FBA) DASDs are mainframe-specific disk devices +which are layed out as a sequence of 512-byte sectors. In contrast +to ECKD DASDs, these disks do not require formatting and resemble +the LBA layout of non-mainframe disks. Despite this resemblance, +the Linux kernel applies special handling during partition detection +for FBA DASDs, resulting in a single, immutable partition being +reported. + +While actual FBA DASD hardware is no longer available, the z/VM +hypervisor can simulate FBA DASD disks, backed by either ECKD or +SCSI devices. + +This patch adds support for FBA DASD partitions and successful +installation by Anaconda. + +Signed-off-by: Nageswara R Sastry +--- + include/pydisk.h | 1 + + src/_pedmodule.c | 7 +++++++ + src/parted/__init__.py | 9 +++++++++ + src/pydisk.c | 32 ++++++++++++++++++++++++++++++++ + 4 files changed, 49 insertions(+) + +diff --git a/include/pydisk.h b/include/pydisk.h +index c0bf92e..a2bcc4f 100644 +--- a/include/pydisk.h ++++ b/include/pydisk.h +@@ -152,6 +152,7 @@ PyObject *py_ped_disk_get_partition(PyObject *, PyObject *); + PyObject *py_ped_disk_get_partition_by_sector(PyObject *, PyObject *); + PyObject *py_ped_disk_extended_partition(PyObject *, PyObject *); + PyObject *py_ped_disk_new_fresh(PyObject *, PyObject *); ++PyObject *py_ped_disk_new(PyObject *, PyObject *); + + #endif /* PYDISK_H_INCLUDED */ + +diff --git a/src/_pedmodule.c b/src/_pedmodule.c +index add0e8c..efdf831 100644 +--- a/src/_pedmodule.c ++++ b/src/_pedmodule.c +@@ -162,6 +162,11 @@ PyDoc_STRVAR(disk_new_fresh_doc, + "will have to use the commit_to_dev() method to write the new label to\n" + "the disk."); + ++PyDoc_STRVAR(disk_new_doc, ++"disk_new(Device) -> Disk\n\n" ++"Given the Device, create a new Disk object. And probe, read the details of\n" ++"the disk."); ++ + PyDoc_STRVAR(disk_flag_get_name_doc, + "disk_flag_get_name(integer) -> string\n\n" + "Return a name for a disk flag constant. If an invalid flag is provided,\n" +@@ -252,6 +257,8 @@ static struct PyMethodDef PyPedModuleMethods[] = { + METH_VARARGS, partition_flag_next_doc}, + {"disk_new_fresh", (PyCFunction) py_ped_disk_new_fresh, + METH_VARARGS, disk_new_fresh_doc}, ++ {"disk_new", (PyCFunction) py_ped_disk_new, ++ METH_VARARGS, disk_new_doc}, + {"disk_flag_get_name", (PyCFunction) py_ped_disk_flag_get_name, + METH_VARARGS, disk_flag_get_name_doc}, + {"disk_flag_get_by_name", (PyCFunction) py_ped_disk_flag_get_by_name, +diff --git a/src/parted/__init__.py b/src/parted/__init__.py +index 01f9575..0eb23d2 100644 +--- a/src/parted/__init__.py ++++ b/src/parted/__init__.py +@@ -418,6 +418,15 @@ def freshDisk(device, ty): + return Disk(PedDisk=peddisk) + + @localeC ++def newDisk(device): ++ """Return a Disk object for this Device. Read the partition table off ++ a device (if one is found).""" ++ from _ped import disk_new ++ ++ peddisk = disk_new(device.getPedDevice()) ++ return Disk(PedDisk=peddisk) ++ ++@localeC + def version(): + """Return a dict containing the pyparted and libparted versions.""" + from _ped import libparted_version +diff --git a/src/pydisk.c b/src/pydisk.c +index f58eeef..4e70f55 100644 +--- a/src/pydisk.c ++++ b/src/pydisk.c +@@ -2004,5 +2004,37 @@ PyObject *py_ped_disk_new_fresh(PyObject *s, PyObject *args) { + return (PyObject *) ret; + } + ++PyObject *py_ped_disk_new(PyObject *s, PyObject *args) { ++ _ped_Device *in_device = NULL; ++ PedDevice *device = NULL; ++ PedDisk *disk = NULL; ++ _ped_Disk *ret = NULL; ++ ++ if (!PyArg_ParseTuple(args, "O!", &_ped_Device_Type_obj, &in_device)) { ++ return NULL; ++ } ++ ++ if ((device = _ped_Device2PedDevice((PyObject *) in_device)) == NULL) { ++ return NULL; ++ } ++ ++ if ((disk = ped_disk_new(device)) == NULL) { ++ if (partedExnRaised) { ++ partedExnRaised = 0; ++ ++ if (!PyErr_ExceptionMatches(PartedException) && ++ !PyErr_ExceptionMatches(PyExc_NotImplementedError)) ++ PyErr_SetString(DiskException, partedExnMessage); ++ } else { ++ PyErr_Format(DiskException, "Could not create new disk label on %s", disk->dev->path); ++ } ++ ++ return NULL; ++ } ++ ++ ret = PedDisk2_ped_Disk(disk); ++ return (PyObject *) ret; ++} ++ + /* vim:tw=78:ts=4:et:sw=4 + */ +-- +1.8.1.2 + diff --git a/SOURCES/0004-Add-new-functions-to-extend-exception-handling.patch b/SOURCES/0004-Add-new-functions-to-extend-exception-handling.patch new file mode 100644 index 0000000..7659516 --- /dev/null +++ b/SOURCES/0004-Add-new-functions-to-extend-exception-handling.patch @@ -0,0 +1,222 @@ +From e701c277cdb07d849a9f7b67aabfc4ff391f8970 Mon Sep 17 00:00:00 2001 +From: Chris Lumens +Date: Tue, 13 Jan 2015 11:13:17 -0500 +Subject: [PATCH 4/7] Add new functions to extend exception handling. + +We've been avoiding this for an awful long time, but there is now a need for +users of pyparted to be able to specify what answers should be given to parted +exceptions that ask a question. Specifically, we need to be able to ask the +user whether to proceed with a disk containing a corrupted GPT disk label or not. + +This adds a function to register a callback that can prompt the user (among other +possible actions) and a function to clear this callback to restore default +behavior. +--- + src/_pedmodule.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 125 insertions(+), 10 deletions(-) + +diff --git a/src/_pedmodule.c b/src/_pedmodule.c +index a1c8947..7f02193 100644 +--- a/src/_pedmodule.c ++++ b/src/_pedmodule.c +@@ -5,7 +5,7 @@ + * Python module that implements the libparted functionality via Python + * classes and other high level language features. + * +- * Copyright (C) 2007, 2008 Red Hat, Inc. ++ * Copyright (C) 2007-2015 Red Hat, Inc. + * + * This copyrighted material is made available to anyone wishing to use, + * modify, copy, or redistribute it subject to the terms and conditions of +@@ -44,6 +44,8 @@ + char *partedExnMessage = NULL; + unsigned int partedExnRaised = 0; + ++PyObject *exn_handler = NULL; ++ + /* Docs strings are broken out of the module structure here to be at least a + * little bit readable. + */ +@@ -190,6 +192,25 @@ PyDoc_STRVAR(unit_get_by_name_doc, + "Returns a Unit given its textual representation. Returns one of the\n" + "UNIT_* constants."); + ++PyDoc_STRVAR(register_exn_handler_doc, ++"register_exn_handler(function)\n\n" ++"When parted raises an exception, the function registered here will be called\n" ++"to help determine what action to take. This does not bypass the exception\n" ++"handler pyparted uses. Instead, it can be used to pop up a dialog to ask the\n" ++"user which course of action to take, or to provide a different default answer,\n" ++"or other actions.\n\n" ++"The given function must accept as arguments: (1) an integer corresponding to\n" ++"one of the EXCEPTION_TYPE_* constants; (2) an integer corresponding to one of the\n" ++"EXCEPTION_OPT_* constants; and (3) a string that is the problem encountered by\n" ++"parted. This string will already be translated. The given function must return\n" ++"one of the EXCEPTION_RESOLVE_* constants instructing parted how to proceed."); ++ ++PyDoc_STRVAR(clear_exn_handler_doc, ++"clear_exn_handler()\n\n" ++"Clear any previously added exception handling function. This means the\n" ++"default behavior for all parted exceptions will be used, so only safe\n" ++"answers to any questions parted asks will be automatically provided."); ++ + PyDoc_STRVAR(_ped_doc, + "This module implements an interface to libparted.\n\n" + "pyparted provides two API layers: a lower level that exposes the complete\n" +@@ -204,6 +225,25 @@ PyDoc_STRVAR(_ped_doc, + "For complete documentation, refer to the docs strings for each _ped\n" + "method, exception class, and subclass."); + ++PyObject *py_ped_register_exn_handler(PyObject *s, PyObject *args) { ++ PyObject *fn = NULL; ++ ++ if (!PyArg_ParseTuple(args, "O", &fn)) { ++ return NULL; ++ } ++ ++ Py_DECREF(exn_handler); ++ exn_handler = fn; ++ ++ Py_RETURN_TRUE; ++} ++ ++PyObject *py_ped_clear_exn_handler(PyObject *s, PyObject *args) { ++ exn_handler = Py_None; ++ Py_INCREF(exn_handler); ++ Py_RETURN_TRUE; ++} ++ + /* all of the methods for the _ped module */ + static struct PyMethodDef PyPedModuleMethods[] = { + {"libparted_version", (PyCFunction) py_libparted_get_version, METH_VARARGS, +@@ -211,6 +251,11 @@ static struct PyMethodDef PyPedModuleMethods[] = { + {"pyparted_version", (PyCFunction) py_pyparted_version, METH_VARARGS, + pyparted_version_doc}, + ++ {"register_exn_handler", (PyCFunction) py_ped_register_exn_handler, METH_VARARGS, ++ register_exn_handler_doc}, ++ {"clear_exn_handler", (PyCFunction) py_ped_clear_exn_handler, METH_VARARGS, ++ clear_exn_handler_doc}, ++ + /* pyconstraint.c */ + {"constraint_new_from_min_max", (PyCFunction) py_ped_constraint_new_from_min_max, + METH_VARARGS, constraint_new_from_min_max_doc}, +@@ -337,6 +382,10 @@ PyObject *py_pyparted_version(PyObject *s, PyObject *args) { + * main motivation for this function is that methods in our parted module need + * to be able to raise specific, helpful exceptions instead of something + * generic. ++ * ++ * It is also possible for callers to specify a function to help in deciding ++ * what to do with parted exceptions. See the docs for the ++ * py_ped_register_exn_handler function. + */ + static PedExceptionOption partedExnHandler(PedException *e) { + switch (e->type) { +@@ -350,13 +399,29 @@ static PedExceptionOption partedExnHandler(PedException *e) { + + if (partedExnMessage == NULL) + PyErr_NoMemory(); +- +- /* +- * return 'no' for yes/no question exceptions in libparted, +- * prevent any potential disk destruction and pass up an +- * exception to our caller +- */ +- return PED_EXCEPTION_NO; ++ else if (exn_handler && PyCallable_Check(exn_handler)) { ++ PyObject *args, *retval; ++ ++ args = PyTuple_New(3); ++ PyTuple_SetItem(args, 0, PyInt_FromLong(e->type)); ++ PyTuple_SetItem(args, 1, PyInt_FromLong(e->options)); ++ PyTuple_SetItem(args, 2, PyUnicode_FromString(e->message)); ++ ++ retval = PyObject_CallObject(exn_handler, NULL); ++ Py_DECREF(args); ++ if (retval != NULL && (PyLong_AsLong(retval) == PED_EXCEPTION_UNHANDLED || (PyLong_AsLong(retval) & e->options) > 0)) ++ return PyLong_AsLong(retval); ++ else ++ /* Call failed, use the default value. */ ++ return PED_EXCEPTION_NO; ++ } ++ else { ++ /* If no exception handling function was registered to ++ * tell us what to do, return "no" for any yes/no ++ * questions to prevent any potential disk destruction. ++ */ ++ return PED_EXCEPTION_NO; ++ } + } else { + partedExnRaised = 0; + return PED_EXCEPTION_IGNORE; +@@ -372,8 +437,29 @@ static PedExceptionOption partedExnHandler(PedException *e) { + + if (partedExnMessage == NULL) + PyErr_NoMemory(); +- +- return PED_EXCEPTION_CANCEL; ++ else if (exn_handler && PyCallable_Check(exn_handler)) { ++ PyObject *args, *retval; ++ ++ args = PyTuple_New(3); ++ PyTuple_SetItem(args, 0, PyInt_FromLong(e->type)); ++ PyTuple_SetItem(args, 1, PyInt_FromLong(e->options)); ++ PyTuple_SetItem(args, 2, PyUnicode_FromString(e->message)); ++ ++ retval = PyObject_CallObject(exn_handler, NULL); ++ Py_DECREF(args); ++ if (retval != NULL && (PyLong_AsLong(retval) == PED_EXCEPTION_UNHANDLED || (PyLong_AsLong(retval) & e->options) > 0)) ++ return PyLong_AsLong(retval); ++ else ++ /* Call failed, use the default value. */ ++ return PED_EXCEPTION_CANCEL; ++ } ++ else { ++ /* If no exception handling function was registered to tell us ++ * what to do, return "cancel" for any questions to prevent ++ * any potential disk destruction. ++ */ ++ return PED_EXCEPTION_CANCEL; ++ } + + /* Raise exceptions for internal parted bugs immediately. */ + case PED_EXCEPTION_BUG: +@@ -607,6 +693,35 @@ PyMODINIT_FUNC init_ped(void) { + Py_INCREF(UnknownTypeException); + PyModule_AddObject(m, "UnknownTypeException", UnknownTypeException); + ++ /* Exception type constants. */ ++ PyModule_AddIntConstant(m, "EXCEPTION_TYPE_INFORMATION", PED_EXCEPTION_INFORMATION); ++ PyModule_AddIntConstant(m, "EXCEPTION_TYPE_WARNING", PED_EXCEPTION_WARNING); ++ PyModule_AddIntConstant(m, "EXCEPTION_TYPE_ERROR", PED_EXCEPTION_ERROR); ++ PyModule_AddIntConstant(m, "EXCEPTION_TYPE_FATAL", PED_EXCEPTION_FATAL); ++ PyModule_AddIntConstant(m, "EXCEPTION_TYPE_BUG", PED_EXCEPTION_BUG); ++ PyModule_AddIntConstant(m, "EXCEPTION_TYPE_NO_FEATURE", PED_EXCEPTION_NO_FEATURE); ++ ++ /* Exception resolution constants. */ ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_UNHANDLED", PED_EXCEPTION_UNHANDLED); ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_FIX", PED_EXCEPTION_FIX); ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_YES", PED_EXCEPTION_YES); ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_NO", PED_EXCEPTION_NO); ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_OK", PED_EXCEPTION_OK); ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_RETRY", PED_EXCEPTION_RETRY); ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_IGNORE", PED_EXCEPTION_IGNORE); ++ PyModule_AddIntConstant(m, "EXCEPTION_RESOLVE_CANCEL", PED_EXCEPTION_CANCEL); ++ ++ /* Exception option constants. */ ++ PyModule_AddIntConstant(m, "EXCEPTION_OPT_OK_CANCEL", PED_EXCEPTION_OK_CANCEL); ++ PyModule_AddIntConstant(m, "EXCEPTION_OPT_YES_NO", PED_EXCEPTION_YES_NO); ++ PyModule_AddIntConstant(m, "EXCEPTION_OPT_YES_NO_CANCEL", PED_EXCEPTION_YES_NO_CANCEL); ++ PyModule_AddIntConstant(m, "EXCEPTION_OPT_IGNORE_CANCEL", PED_EXCEPTION_IGNORE_CANCEL); ++ PyModule_AddIntConstant(m, "EXCEPTION_OPT_RETRY_CANCEL", PED_EXCEPTION_RETRY_CANCEL); ++ PyModule_AddIntConstant(m, "EXCEPTION_OPT_RETRY_IGNORE_CANCEL", PED_EXCEPTION_RETRY_IGNORE_CANCEL); ++ ++ exn_handler = Py_None; ++ Py_INCREF(exn_handler); ++ + /* Set up our libparted exception handler. */ + ped_exception_set_handler(partedExnHandler); + } +-- +2.4.0 + diff --git a/SOURCES/0005-PyInt_FromLong-doesn-t-exist-in-python3-so-always-us.patch b/SOURCES/0005-PyInt_FromLong-doesn-t-exist-in-python3-so-always-us.patch new file mode 100644 index 0000000..f282c47 --- /dev/null +++ b/SOURCES/0005-PyInt_FromLong-doesn-t-exist-in-python3-so-always-us.patch @@ -0,0 +1,39 @@ +From 273377f924599a4d7358770664467a22a81249ef Mon Sep 17 00:00:00 2001 +From: Chris Lumens +Date: Wed, 14 Jan 2015 11:40:42 -0500 +Subject: [PATCH 5/7] PyInt_FromLong doesn't exist in python3, so always use + PyLong_FromLong. + +--- + src/_pedmodule.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/_pedmodule.c b/src/_pedmodule.c +index 7f02193..a048d91 100644 +--- a/src/_pedmodule.c ++++ b/src/_pedmodule.c +@@ -403,8 +403,8 @@ static PedExceptionOption partedExnHandler(PedException *e) { + PyObject *args, *retval; + + args = PyTuple_New(3); +- PyTuple_SetItem(args, 0, PyInt_FromLong(e->type)); +- PyTuple_SetItem(args, 1, PyInt_FromLong(e->options)); ++ PyTuple_SetItem(args, 0, PyLong_FromLong(e->type)); ++ PyTuple_SetItem(args, 1, PyLong_FromLong(e->options)); + PyTuple_SetItem(args, 2, PyUnicode_FromString(e->message)); + + retval = PyObject_CallObject(exn_handler, NULL); +@@ -441,8 +441,8 @@ static PedExceptionOption partedExnHandler(PedException *e) { + PyObject *args, *retval; + + args = PyTuple_New(3); +- PyTuple_SetItem(args, 0, PyInt_FromLong(e->type)); +- PyTuple_SetItem(args, 1, PyInt_FromLong(e->options)); ++ PyTuple_SetItem(args, 0, PyLong_FromLong(e->type)); ++ PyTuple_SetItem(args, 1, PyLong_FromLong(e->options)); + PyTuple_SetItem(args, 2, PyUnicode_FromString(e->message)); + + retval = PyObject_CallObject(exn_handler, NULL); +-- +2.4.0 + diff --git a/SOURCES/0006-Remember-to-pass-the-arguments-to-the-exception-hand.patch b/SOURCES/0006-Remember-to-pass-the-arguments-to-the-exception-hand.patch new file mode 100644 index 0000000..f2242e1 --- /dev/null +++ b/SOURCES/0006-Remember-to-pass-the-arguments-to-the-exception-hand.patch @@ -0,0 +1,34 @@ +From 603534d12ed52405e9f464f9608fea725583a51e Mon Sep 17 00:00:00 2001 +From: Chris Lumens +Date: Wed, 14 Jan 2015 14:56:34 -0500 +Subject: [PATCH 6/7] Remember to pass the arguments to the exception handler. + +--- + src/_pedmodule.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/_pedmodule.c b/src/_pedmodule.c +index a048d91..cfe2dd8 100644 +--- a/src/_pedmodule.c ++++ b/src/_pedmodule.c +@@ -407,7 +407,7 @@ static PedExceptionOption partedExnHandler(PedException *e) { + PyTuple_SetItem(args, 1, PyLong_FromLong(e->options)); + PyTuple_SetItem(args, 2, PyUnicode_FromString(e->message)); + +- retval = PyObject_CallObject(exn_handler, NULL); ++ retval = PyObject_CallObject(exn_handler, args); + Py_DECREF(args); + if (retval != NULL && (PyLong_AsLong(retval) == PED_EXCEPTION_UNHANDLED || (PyLong_AsLong(retval) & e->options) > 0)) + return PyLong_AsLong(retval); +@@ -445,7 +445,7 @@ static PedExceptionOption partedExnHandler(PedException *e) { + PyTuple_SetItem(args, 1, PyLong_FromLong(e->options)); + PyTuple_SetItem(args, 2, PyUnicode_FromString(e->message)); + +- retval = PyObject_CallObject(exn_handler, NULL); ++ retval = PyObject_CallObject(exn_handler, args); + Py_DECREF(args); + if (retval != NULL && (PyLong_AsLong(retval) == PED_EXCEPTION_UNHANDLED || (PyLong_AsLong(retval) & e->options) > 0)) + return PyLong_AsLong(retval); +-- +2.4.0 + diff --git a/SOURCES/0007-Put-new-_ped-constants-and-functions-into-the-parted.patch b/SOURCES/0007-Put-new-_ped-constants-and-functions-into-the-parted.patch new file mode 100644 index 0000000..aa0b6a5 --- /dev/null +++ b/SOURCES/0007-Put-new-_ped-constants-and-functions-into-the-parted.patch @@ -0,0 +1,68 @@ +From 13bad0da9efbd38ca288e7f28f9512649473f6ce Mon Sep 17 00:00:00 2001 +From: Chris Lumens +Date: Wed, 14 Jan 2015 11:55:45 -0500 +Subject: [PATCH 7/7] Put new _ped constants and functions into the parted + module. + +We don't want to require users of pyparted to have to dig down into the +lower level bindings to get at these things. +--- + src/parted/__init__.py | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/src/parted/__init__.py b/src/parted/__init__.py +index c8f6830..2d9ea32 100644 +--- a/src/parted/__init__.py ++++ b/src/parted/__init__.py +@@ -2,7 +2,7 @@ + # __init__.py + # Python bindings for libparted (built on top of the _ped Python module). + # +-# Copyright (C) 2007, 2008, 2009 Red Hat, Inc. ++# Copyright (C) 2007-2015 Red Hat, Inc. + # + # This copyrighted material is made available to anyone wishing to use, + # modify, copy, or redistribute it subject to the terms and conditions of +@@ -48,6 +48,9 @@ from _ped import TimerException + from _ped import UnknownDeviceException + from _ped import UnknownTypeException + ++from _ped import register_exn_handler ++from _ped import clear_exn_handler ++ + from alignment import Alignment + from constraint import Constraint + from device import Device +@@ -122,6 +125,29 @@ from _ped import DISK_GPT_PMBR_BOOT + from _ped import DISK_TYPE_EXTENDED + from _ped import DISK_TYPE_PARTITION_NAME + ++from _ped import EXCEPTION_TYPE_INFORMATION ++from _ped import EXCEPTION_TYPE_WARNING ++from _ped import EXCEPTION_TYPE_ERROR ++from _ped import EXCEPTION_TYPE_FATAL ++from _ped import EXCEPTION_TYPE_BUG ++from _ped import EXCEPTION_TYPE_NO_FEATURE ++ ++from _ped import EXCEPTION_RESOLVE_UNHANDLED ++from _ped import EXCEPTION_RESOLVE_FIX ++from _ped import EXCEPTION_RESOLVE_YES ++from _ped import EXCEPTION_RESOLVE_NO ++from _ped import EXCEPTION_RESOLVE_OK ++from _ped import EXCEPTION_RESOLVE_RETRY ++from _ped import EXCEPTION_RESOLVE_IGNORE ++from _ped import EXCEPTION_RESOLVE_CANCEL ++ ++from _ped import EXCEPTION_OPT_OK_CANCEL ++from _ped import EXCEPTION_OPT_YES_NO ++from _ped import EXCEPTION_OPT_YES_NO_CANCEL ++from _ped import EXCEPTION_OPT_IGNORE_CANCEL ++from _ped import EXCEPTION_OPT_RETRY_CANCEL ++from _ped import EXCEPTION_OPT_RETRY_IGNORE_CANCEL ++ + from decorators import localeC + + partitionTypesDict = { +-- +2.4.0 + diff --git a/SOURCES/Makefile_enable_coverage_for_testsuite.patch b/SOURCES/Makefile_enable_coverage_for_testsuite.patch new file mode 100644 index 0000000..9181f8c --- /dev/null +++ b/SOURCES/Makefile_enable_coverage_for_testsuite.patch @@ -0,0 +1,15 @@ +--- pyparted-3.9/Makefile.orig 2014-02-13 10:00:59.129864074 -0500 ++++ pyparted-3.9/Makefile 2014-02-13 10:13:52.547882402 -0500 +@@ -37,8 +37,11 @@ + @$(PYTHON) setup.py build + + test: all ++ @which coverage || (echo "*** Please install python-coverage ***"; exit 2) ++ @echo "*** Running unittests with coverage ***" + @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname) \ +- $(PYTHON) -m unittest discover -v ++ coverage run --branch -m unittest discover -v ++ coverage report --include='build/*' + + check: all + env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname) \ diff --git a/SOURCES/pyparted-3.9-aarch64.patch b/SOURCES/pyparted-3.9-aarch64.patch new file mode 100644 index 0000000..3d9defd --- /dev/null +++ b/SOURCES/pyparted-3.9-aarch64.patch @@ -0,0 +1,36 @@ +diff -up pyparted-3.9/src/parted/__init__.py.aarch64 pyparted-3.9/src/parted/__init__.py +--- pyparted-3.9/src/parted/__init__.py.aarch64 2014-01-23 17:28:28.370005898 -0500 ++++ pyparted-3.9/src/parted/__init__.py 2014-01-23 17:57:51.257702523 -0500 +@@ -275,7 +275,8 @@ archLabels = {'i386': ['msdos', 'gpt'], + 'sparc': ['sun'], + 'ia64': ['msdos', 'gpt'], + 'ppc': ['msdos', 'mac', 'amiga', 'gpt'], +- 'x86_64': ['msdos', 'gpt']} ++ 'x86_64': ['msdos', 'gpt'], ++ 'aarch64': ['msdos', 'gpt']} + + # Adapted from: + # http://stackoverflow.com/questions/922550/how-to-mark-a-global-as-deprecated-in-python +@@ -309,9 +310,9 @@ def Deprecated(mod, deprecated={}): + __archLabels = (('amiga', 'ppc(64)?$'), + ('bsd', 'alpha$'), + ('dasd', 's390x?$'), +- ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64)?$'), ++ ('gpt', 'i[3-6]86$|x86_64$|ia64$|ppc(64)?$|aarch64$'), + ('mac', 'ppc(64)?$'), +- ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64)?$'), ++ ('msdos', 'i[3-6]86$|x86_64$|s390x?$|alpha$|ia64$|ppc(64)?$|aarch64$'), + ('sun', 'sparc(64)?$')) + + def getLabels(arch=None): +diff -up pyparted-3.9/tests/test_parted_parted.py.aarch64 pyparted-3.9/tests/test_parted_parted.py +--- pyparted-3.9/tests/test_parted_parted.py.aarch64 2011-06-27 11:24:21.000000000 -0400 ++++ pyparted-3.9/tests/test_parted_parted.py 2014-01-23 17:59:09.640810266 -0500 +@@ -59,6 +59,7 @@ class GetLabelsTestCase(unittest.TestCas + self.assertSetEqual(parted.getLabels('ppc64'), {'amiga', 'gpt', 'mac', 'msdos'}) + self.assertSetEqual(parted.getLabels('alpha'), {'bsd', 'msdos'}) + self.assertSetEqual(parted.getLabels('ia64'), {'gpt', 'msdos'}) ++ self.assertSetEqual(parted.getLabels('aarch64'), {'gpt', 'msdos'}) + + class GetDeviceTestCase(RequiresDeviceNode): + def runTest(self): diff --git a/SOURCES/pyparted-3.9-clang-warning.patch b/SOURCES/pyparted-3.9-clang-warning.patch new file mode 100644 index 0000000..63d9652 --- /dev/null +++ b/SOURCES/pyparted-3.9-clang-warning.patch @@ -0,0 +1,30 @@ +diff -up pyparted-3.9/src/pydisk.c.orig pyparted-3.9/src/pydisk.c +--- pyparted-3.9/src/pydisk.c.orig 2018-01-12 13:49:41.071972417 -0500 ++++ pyparted-3.9/src/pydisk.c 2018-01-12 13:52:55.264256591 -0500 +@@ -2003,7 +2003,11 @@ PyObject *py_ped_disk_new_fresh(PyObject + !PyErr_ExceptionMatches(PyExc_NotImplementedError)) + PyErr_SetString(DiskException, partedExnMessage); + } else { +- PyErr_Format(DiskException, "Could not create new disk label on %s", disk->dev->path); ++ if (disk->dev == NULL) { ++ PyErr_Format(DiskException, "Could not create new disk label"); ++ } else { ++ PyErr_Format(DiskException, "Could not create new disk label on %s", disk->dev->path); ++ } + } + + return NULL; +@@ -2035,7 +2039,11 @@ PyObject *py_ped_disk_new(PyObject *s, P + !PyErr_ExceptionMatches(PyExc_NotImplementedError)) + PyErr_SetString(DiskException, partedExnMessage); + } else { +- PyErr_Format(DiskException, "Could not create new disk label on %s", disk->dev->path); ++ if (disk->dev == NULL) { ++ PyErr_Format(DiskException, "Could not create new disk label"); ++ } else { ++ PyErr_Format(DiskException, "Could not create new disk label on %s", disk->dev->path); ++ } + } + + return NULL; +diff -up pyparted-3.9/src/pyfilesys.c.orig pyparted-3.9/src/pyfilesys.c diff --git a/SOURCES/pyparted-3.9-null-dereference.patch b/SOURCES/pyparted-3.9-null-dereference.patch new file mode 100644 index 0000000..9fc7efd --- /dev/null +++ b/SOURCES/pyparted-3.9-null-dereference.patch @@ -0,0 +1,16 @@ +diff -up pyparted-3.9/src/pydisk.c.orig pyparted-3.9/src/pydisk.c +--- pyparted-3.9/src/pydisk.c.orig 2018-01-12 13:47:27.488464829 -0500 ++++ pyparted-3.9/src/pydisk.c 2018-01-12 13:47:04.129550934 -0500 +@@ -209,7 +209,11 @@ int _ped_Partition_init(_ped_Partition * + PyErr_SetString(PartitionException, partedExnMessage); + } + } else { +- PyErr_Format(PartitionException, "Could not create new partition on device %s", disk->dev->path); ++ if (disk == NULL) { ++ PyErr_Format(PartitionException, "Could not create new partition"); ++ } else { ++ PyErr_Format(PartitionException, "Could not create new partition on device %s", disk->dev->path); ++ } + } + + self->disk = self->fs_type = NULL; diff --git a/SOURCES/pyparted-3.9-tests-fixes.patch b/SOURCES/pyparted-3.9-tests-fixes.patch new file mode 100644 index 0000000..5628f5d --- /dev/null +++ b/SOURCES/pyparted-3.9-tests-fixes.patch @@ -0,0 +1,24 @@ +diff -up pyparted-3.9/tests/test__ped_ped.py.orig pyparted-3.9/tests/test__ped_ped.py +--- pyparted-3.9/tests/test__ped_ped.py.orig 2011-06-27 11:24:21.000000000 -0400 ++++ pyparted-3.9/tests/test__ped_ped.py 2014-01-22 09:36:35.031314396 -0500 +@@ -200,6 +200,9 @@ class DeviceGetNextTestCase(unittest.Tes + _ped.device_probe_all() + lst = self.getDeviceList(_ped.device_get_next) + ++ if len(lst) == 0: ++ self.skipTest("no devices in lst") ++ + # Now the test cases. + self.assertGreater(len(lst), 0) + self.assertRaises(TypeError, _ped.device_get_next, None) +@@ -272,8 +275,8 @@ class FileSystemProbeSpecificTestCase(Re + + self.assertTrue(isinstance(result, _ped.Geometry)) + self.assertEquals(result.start, self._geometry.start) +- self.assertEquals(result.end, self._geometry.end) +- self.assertEquals(result.length, self._geometry.length) ++ self.assertLessEqual(result.end, self._geometry.end) ++ self.assertLessEqual(result.length, self._geometry.length) + self.assertEquals(result.dev, self._device) + else: + result = _ped.file_system_probe_specific(type, self._geometry) diff --git a/SPECS/pyparted.spec b/SPECS/pyparted.spec new file mode 100644 index 0000000..c04913d --- /dev/null +++ b/SPECS/pyparted.spec @@ -0,0 +1,457 @@ +Summary: Python module for GNU parted +Name: pyparted +Epoch: 1 +Version: 3.9 +Release: 15%{?dist} +License: GPLv2+ +Group: System Environment/Libraries +URL: https://github.com/dcantrell/pyparted + +Source0: https://github.com/dcantrell/pyparted/archive/%{name}-%{version}.tar.gz +Patch1: 0001-Do-not-traceback-when-calling-setlocale-875354.patch +Patch2: 0002-Convert-Constraint-to-__ped.Constraint-in-partition..patch +Patch3: 0003-Subject-PATCH-pyparted-export-ped_disk_new-functiona.patch +Patch4: pyparted-3.9-tests-fixes.patch +Patch5: pyparted-3.9-aarch64.patch +Patch6: Makefile_enable_coverage_for_testsuite.patch +Patch7: 0001-Fix-some-tests-under-python-coverage-1057626.patch +Patch8: 0001-support-ppc64le-in-pyparted.patch +Patch9: 0004-Add-new-functions-to-extend-exception-handling.patch +Patch10: 0005-PyInt_FromLong-doesn-t-exist-in-python3-so-always-us.patch +Patch11: 0006-Remember-to-pass-the-arguments-to-the-exception-hand.patch +Patch12: 0007-Put-new-_ped-constants-and-functions-into-the-parted.patch +Patch13: pyparted-3.9-null-dereference.patch +Patch14: pyparted-3.9-clang-warning.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n) +BuildRequires: python-devel +BuildRequires: parted-devel >= 3.1 +BuildRequires: pkgconfig +BuildRequires: e2fsprogs +%ifnarch s390 s390x +BuildRequires: python-coverage +%endif + +%description +Python module for the parted library. It is used for manipulating +partition tables. + +%prep +%setup -q +%patch1 -p 1 +%patch2 -p 1 +%patch3 -p 1 +%patch4 -p 1 +%patch5 -p 1 +%ifnarch s390 s390x +%patch6 -p 1 +%endif +%patch7 -p 1 +%patch8 -p 1 +%patch9 -p 1 +%patch10 -p 1 +%patch11 -p 1 +%patch12 -p 1 +%patch13 -p 1 +%patch14 -p 1 + +%build +make %{?_smp_mflags} + +%check +make test + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc AUTHORS BUGS COPYING ChangeLog NEWS README TODO +%{python_sitearch}/_pedmodule.so +%{python_sitearch}/parted +%{python_sitearch}/%{name}-%{version}-*.egg-info + +%changelog +* Fri Jan 12 2018 David Cantrell - 1:3.9-15 +- Fix a number Coverity bugs in the _ped module source + Resolves: rhbz#1534014 + +* Fri Oct 20 2017 David Cantrell - 1:3.9-14 +- Update URLs to point to github.com since that's where upstream lives + these days + Resolves: rhbz#1502389 + +* Tue Jun 23 2015 David Cantrell - 1:3.9-13 +- Rebuild + Resolves: rhbz#1188163 + +* Thu Jun 11 2015 Brian C. Lane - 1:3.9-12 +- Backport support for register_exn_handler (#1188163) + Related: rhbz#1188163 + +* Tue Aug 19 2014 David Cantrell - 1:3.9-11 +- Fix invalid rpm changelog entries + Related: rhbz#1125656 + +* Tue Aug 19 2014 David Cantrell - 1:3.9-10 +- Add disklabel support for ppc64le systems + Resolves: rhbz#1125656 + +* Tue Aug 19 2014 David Cantrell - 1:3.9-9 +- Disable python-coverage tests on s390x + Related: rhbz#1057626 +- Fix python-coverage tests (some disabled that are not working) + Resolves: rhbz#1057626 + +* Tue Feb 18 2014 David Cantrell - 1:3.9-8 +- Enable running test suite through python-coverage + Resolves: rhbz#1057626 + +* Thu Feb 06 2014 David Cantrell - 1:3.9-7 +- Add disklabel support for aarch64 systems + Resolves: rhbz#1060376 + +* Tue Jan 28 2014 Daniel Mach - 1:3.9-6 +- Mass rebuild 2014-01-24 + +* Tue Jan 21 2014 David Cantrell - 1:3.9-5 +- Run test suite from the %%check spec file section + Resolves: rhbz#1025238 + +* Fri Dec 27 2013 Daniel Mach - 1:3.9-4 +- Mass rebuild 2013-12-27 + +* Mon Jun 24 2013 Chris Lumens 3.9-3 +- Fix a bunch of unicode-related tracebacks during installation. + +* Thu Feb 14 2013 Fedora Release Engineering - 3.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Dec 05 2012 David Cantrell - 3.9-1 +- Upgrade to pyparted-3.9 + +* Sat Jul 21 2012 Fedora Release Engineering - 3.8-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Mar 13 2012 Brian C. Lane - 3.8-4 +- Rebuild against parted 3.1 + +* Thu Feb 02 2012 Brian C. Lane - 3.8-3 +- Add patch for new parted PED_DISK_GPT_PMBR_BOOT flag + +* Sat Jan 14 2012 Fedora Release Engineering - 3.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Jun 29 2011 David Cantrell - 3.8-1 +- Upgraded to pyparted-3.8 + +* Wed Jun 29 2011 David Cantrell - 3.7-2 +- BR parted-devel >= 3.0 +- Adjust for distutils build method + +* Wed Jun 29 2011 David Cantrell - 3.7-1 +- Upgraded to pyparted-3.7 (compatibility with parted-3.0) + +* Wed Mar 23 2011 David Cantrell - 3.6-1 +- Upgraded to pyparted-3.6 + +* Thu Mar 17 2011 David Cantrell - 3.5-3 +- Add support for PED_PARTITION_LEGACY_BOOT partition flag now in libparted + +* Tue Feb 08 2011 Fedora Release Engineering - 3.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jan 17 2011 David Cantrell - 3.5-1 +- Drop dependency on python-decorator module. (dcantrell) +- Differentiate the "Could not commit" messages. (jgranado) +- Import _ped.DiskLabelException into parted namespace (cjwatson) +- Return PED_EXCEPTION_NO for yes/no interactive exceptions. (dcantrell) + +* Wed Jul 21 2010 David Malcolm - 3.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Fri May 21 2010 David Cantrell - 3.4-2 +- Spec file cleanups to comply with current packaging policies + +* Thu Apr 29 2010 David Cantrell - 3.4-1 +- Handle PED_EXCEPTION_WARNING with PED_EXCEPTION_YES_NO (#575749) + (dcantrell) + +* Wed Apr 21 2010 Chris Lumens - 3.3-1 +- Upgrade to pyparted-3.3 (#583628). + +* Wed Mar 31 2010 David Cantrell - 3.2-2 +- Rebuild for libparted soname change + +* Thu Mar 25 2010 Chris Lumens - 3.2-1 +- Upgrade to pyparted-3.2 (#571940). + +* Mon Mar 01 2010 David Cantrell - 3.1-1 +- Upgrade to pyparted-3.1 (#567576). + +* Tue Jan 12 2010 David Cantrell - 3.0-1 +- Upgrade to pyparted-3.0. + +* Mon Jan 11 2010 Hans de Goede - 2.5-4 +- Rebuild for new parted-2.1 +- Remove py_disk_clobber_exclude function binding, as this function was + removed from parted-2.1 + +* Thu Jan 7 2010 Hans de Goede - 2.5-3 +- Change python_sitearch macro to use %%global as the new rpm will break + using %%define here, see: + https://www.redhat.com/archives/fedora-devel-list/2010-January/msg00093.html + +* Sat Dec 19 2009 David Cantrell - 2.5-2 +- Exclude pyparted-2.4.tar.gz from source RPM (oops) + +* Sat Dec 19 2009 David Cantrell - 2.5-1 +- Update release instructions. (dcantrell) +- Remove old cylinder alignment test cases for _ped. (dcantrell) +- Add tests for max partition length / start sector (hdegoede) +- Add _pedmodule and parted functions for max partition length / start + sector (hdegoede) +- Remove align_to_cylinders function bindings (hdegoede) +- Add tests for disk flag methods (hdegoede) +- Add _pedmodule and parted functions for per disk flags (hdegoede) +- Every tuple member requires a comma after it. (dcantrell) +- Fill out a lot of simple _ped.Disk test cases. (dcantrell) +- Disable DeviceDestroyTestCase for now. (dcantrell) +- Add RequiresLabeledDevice to tests/_ped/baseclass.py. (dcantrell) +- Attempt at fixing _ped.Device.destroy(), no dice. (dcantrell) +- Fix UnitFormatCustomTestCase and UnitFormatTestCase. (dcantrell) +- Fix UnitFormatCustomByteTestCase and UnitFormatByteTestCase. (dcantrell) +- Add DeviceStrTestCase, disable DeviceDestroyTestCase. (dcantrell) +- Add DeviceDestroyTestCase and DeviceCacheRemoveTestCase. (dcantrell) +- Implemented ConstraintIsSolutionTestCase(). (dcantrell) +- Implement ConstraintSolveMaxTestCase(). (dcantrell) +- Implement ConstraintSolveNearestTestCase(). (dcantrell) +- Correct py_ped_file_system_probe_specific() for NULL returns. (dcantrell) +- Implement FileSystemProbeSpecificTestCase(). (dcantrell) +- Implement FileSystemProbeTestCase(). (dcantrell) +- Add RequiresFileSystem to tests/_ped/baseclass.py. (dcantrell) +- Add disk alignment test cases in test_ped.py. (dcantrell) +- Fix CHSGeometryStrTestCase(). (dcantrell) +- Fix ConstraintDuplicateTestCase...finally. (dcantrell) +- Put a deprecation warning in py_ped_constraint_duplicate(). (dcantrell) +- Note that we need parted from Fedora for pyparted. (dcantrell) +- Fix UnitGetSizeTestCase in _ped test cases for _ped.UNIT_PERCENT. + (dcantrell) +- Add testcase for new _ped disk get_partition_alignment method (hdegoede) + +* Fri Nov 06 2009 David Cantrell - 2.4-1 +- Upgrade to pyparted-2.4: + Use PedDevice length instead of DIY (#532023) (hdegoede) + Use sectorSize not physicalSectorSize for size calculations (hdegoede) + +* Tue Nov 03 2009 David Cantrell - 2.3-1 +- Upgrade to pyparted-2.3: + Remove root user requirement in _ped + Add testcases for new _ped device methods + Add python wrapper for new PedDisk partition alignment info function + Add support for new PedDisk parition alignment info function + Add python wrappers for new PedDevice alignment info functions + Add support for new PedDevice alignment info functions + Fix a whole pile of test cases. + Remove ped_disk_commit_to_dev() call from py_ped_disk_new_fresh() + Fix error in Constraint __str__ method + Make _ped_Device2PedDevice properly set / throw exceptions + Fixup various errorhandling issues in pydisk.c + Add missing _ped_Device2PedDevice() retval checks + Use libparted commit() for parted.disk.Disk.commit() (hdegoede). +- BR parted-devel >= 1.9.0-20 + +* Fri Oct 02 2009 David Cantrell - 2.2-1 +- Upgrade to pyparted-2.2: + Fixes PedDisk2_ped_Disk() and avoids losing disk label data + in the conversion process (#526999) + +* Mon Aug 17 2009 Chris Lumens - 2.1.2-1 +- Upgrade to pyparted-2.1.2: + PED_DEVICE_DM is always defined in libparted these days. + Handle parted exceptions arising from ped_device_get (#495433). + +* Tue Aug 04 2009 David Cantrell - 2.1.1-1 +- Upgrade to pyparted-2.1.1 + +* Sun Jul 26 2009 Fedora Release Engineering - 2.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jul 16 2009 David Cantrell - 2.1.0-1 +- Upgrade to pyparted-2.1.0, requires parted-1.9.0-1 or higher + +* Fri Jul 10 2009 David Cantrell - 2.0.12-2 +- Rebuild for new parted + +* Tue Apr 14 2009 David Cantrell - 2.0.12-1 +- Upgrade to pyparted-2.0.12 + +* Mon Apr 13 2009 David Cantrell - 2.0.11-1 +- Upgrade to pyparted-2.0.11 + +* Fri Apr 03 2009 David Cantrell - 2.0.10-1 +- Upgrade to pyparted-2.0.10 + Fix LVM problems around parted.Disk.commit() (#491746) + +* Mon Mar 23 2009 David Cantrell - 2.0.9-1 +- Upgrade to pyparted-2.0.9 + +* Fri Mar 20 2009 David Cantrell - 2.0.8-1 +- Upgrade to pyparted-2.0.8 + +* Thu Mar 19 2009 David Cantrell - 2.0.7-1 +- Upgrade to pyparted-2.0.7 + +* Thu Mar 12 2009 David Cantrell - 2.0.6-1 +- Upgrade to pyparted-2.0.6 + +* Thu Mar 05 2009 David Cantrell - 2.0.5-1 +- Upgrade to pyparted-2.0.5 + +* Sat Feb 28 2009 David Cantrell - 2.0.4-1 +- Upgrade to pyparted-2.0.4 + +* Fri Feb 27 2009 David Cantrell - 2.0.3-1 +- Upgrade to pyparted-2.0.3 + +* Wed Feb 25 2009 David Cantrell - 2.0.2-1 +- Upgrade to pyparted-2.0.2 + +* Mon Feb 16 2009 David Cantrell - 2.0.1-1 +- Upgrade to pyparted-2.0.1 (#485632) + +* Thu Feb 12 2009 David Cantrell - 2.0.0-1 +- Upgrade to pyparted-2.0.0 + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 1.8.9-6 +- Rebuild for Python 2.6 + +* Fri Feb 08 2008 David Cantrell - 1.8.9-5 +- Rebuild for gcc-4.3 + +* Wed Jan 02 2008 David Cantrell - 1.8.9-4 +- Rebuild + +* Mon Nov 19 2007 Jeremy Katz - 1.8.9-3 +- Add support for exact constraints + +* Tue Aug 21 2007 David Cantrell - 1.8.9-2 +- Rebuild + +* Fri Aug 10 2007 David Cantrell - 1.8.9-1 +- Update license tag to indicate GPL v2 or later +- Update URLs to point to new upstream location + +* Fri Jun 15 2007 David Cantrell - 1.8.8-1 +- Clean up wording in package description (#226337) +- BR pkgconfig (#226337) + +* Fri Jun 15 2007 David Cantrell - 1.8.7-1 +- Merge review (#226337) + +* Mon Apr 23 2007 David Cantrell - 1.8.6-2 +- Ensure build env CFLAGS are included (#226337) + +* Thu Apr 19 2007 David Cantrell - 1.8.6-1 +- Merge review (#226337) + +* Tue Mar 20 2007 David Cantrell - 1.8.5-4 +- Rebuild for GNU parted-1.8.6 + +* Tue Mar 20 2007 David Cantrell - 1.8.5-3 +- Rebuild for GNU parted-1.8.5 + +* Mon Mar 19 2007 David Cantrell - 1.8.5-2 +- Rebuild for GNU parted-1.8.4 + +* Thu Feb 08 2007 David Cantrell - 1.8.5-1 +- Define and use python_sitearch rather than python_sitelib + +* Thu Feb 08 2007 David Cantrell - 1.8.4-1 +- Use preferred BuildRoot (package review) +- Define and use python_sitelib macro (package review) + +* Fri Jan 12 2007 David Cantrell - 1.8.3-1 +- Required parted-1.8.2 or higher + +* Wed Jan 10 2007 Jeremy Katz - 1.8.2-1 +- use PyObject_DEL instead of PyMem_DEL + +* Thu Dec 7 2006 Jeremy Katz - 1.8.1-3 +- rebuild for python 2.5 + +* Tue Dec 05 2006 David Cantrell - 1.8.1-2 +- Rebuild for GNU parted-1.8.1 + +* Thu Nov 30 2006 David Cantrell - 1.8.1-1 +- Determine Python version to use in %%build so the source RPM is more + easily moved between distribution releases. + +* Fri Nov 17 2006 David Cantrell - 1.8.0-1 +- Bump version to 1.8.0 and require parted >= 1.8.0 +- Remove python-abi Requires line since rpm handles that automatically + +* Wed Aug 30 2006 David Cantrell - 1.7.3-1 +- Include parted/constraint.h in required header files + +* Wed Aug 30 2006 David Cantrell - 1.7.2-2 +- Require parted-1.7.1 or higher + +* Tue Jul 25 2006 David Cantrell - 1.7.2-1 +- Add HPSERVICE, PALO, PREP, and MSFT_RESERVED to partition types list + +* Wed Jul 12 2006 Jesse Keating - 1.7.1-1.1 +- rebuild + +* Sun May 28 2006 David Cantrell - 1.7.1-1 +- Bump version to 1.7.1 and require parted >= 1.7.1 + +* Fri May 19 2006 David Cantrell - 1.7.0-1 +- Bump version to 1.7.0 and require parted >= 1.7.0 + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Fri Nov 11 2005 Peter Jones - 1.6.10-1 +- rebuild for new parted. +- add debugging options for make so debuginfo isn't useless + +* Wed Nov 9 2005 Jeremy Katz - 1.6.9-5 +- rebuild for new parted + +* Wed Aug 31 2005 Chris Lumens 1.6.9-4 +- Rebuilt for new parted library. + +* Wed Mar 16 2005 Chris Lumens 1.6.9-3 +- Updated for gcc4 and python2.4. Fixed build warnings. + +* Tue Dec 14 2004 Jeremy Katz - 1.6.9-2 +- add support for sx8 devices + +* Mon Nov 8 2004 Jeremy Katz - 1.6.8-3 +- rebuild for python 2.4 + +* Mon Oct 11 2004 Warren Togami - 1.6.8-2 +- #135100 req python-abi (Robert Scheck) + +* Tue Aug 17 2004 Jeremy Katz - 1.6.8-1 +- update for new parted ABI + - device -> heads, sectors, cylinders now refer to the bios geometry +- require parted >= 1.6.12 + +* Thu Jul 22 2004 Jeremy Katz - 1.6.7-3 +- build on ppc64 again + +* Thu May 13 2004 Jeremy Katz - 1.6.7-1 +- fix build for newer versions of gcc (fix from Jeff Law) + +* Tue Mar 16 2004 Jeremy Katz 1.6.6-2 +- fix PARTITION_PROTECTED definition (#118451) + +* Fri Mar 12 2004 Jeremy Katz +- Initial build split out into separate source from the parted package. +- Don't build on ppc64 right now due to parted build problems (#118183)