devel/pyparted pyparted-exact-constraint.patch, NONE, 1.1 pyparted.spec, 1.44, 1.45
Jeremy Katz (katzj)
fedora-extras-commits at redhat.com
Mon Nov 19 16:34:37 UTC 2007
Author: katzj
Update of /cvs/pkgs/devel/pyparted
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2709
Modified Files:
pyparted.spec
Added Files:
pyparted-exact-constraint.patch
Log Message:
* Mon Nov 19 2007 Jeremy Katz <katzj at redhat.com> - 1.8.9-3
- Add support for exact constraints
pyparted-exact-constraint.patch:
--- NEW FILE pyparted-exact-constraint.patch ---
diff --git a/pydisk.c b/pydisk.c
index 51c2e27..20bb714 100644
--- a/pydisk.c
+++ b/pydisk.c
@@ -589,6 +589,28 @@ py_ped_partition_set_system (PyPedPartition *p, PyObject * args)
}
static PyObject *
+py_ped_partition_set_geometry (PyPedPartition *p, PyObject * args)
+{
+ PyPedConstraint *cs = NULL;
+ PedSector start, end;
+
+ if (!PyArg_ParseTuple(args, "O!LL", &PyPedConstraintType, &cs,
+ &start, &end))
+ return NULL;
+
+ py_ped_exception_string_clear ();
+
+ if (!ped_disk_set_partition_geom (p->disk->disk, p->part, cs->constraint,
+ start, end)) {
+ py_ped_set_error_from_ped_exception ();
+ return NULL;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
py_ped_partition_set_name (PyPedPartition *p, PyObject * args)
{
char *name;
@@ -685,6 +707,8 @@ static struct PyMethodDef PyPedPartitionMethods[] = {
METH_VARARGS, NULL },
{ "set_name", (PyCFunction) py_ped_partition_set_name,
METH_VARARGS, NULL },
+ { "set_geometry", (PyCFunction) py_ped_partition_set_geometry,
+ METH_VARARGS, NULL },
{ "get_name", (PyCFunction) py_ped_partition_get_name,
METH_VARARGS, NULL },
{ "is_busy", (PyCFunction) py_ped_partition_is_busy,
diff --git a/pygeometry.c b/pygeometry.c
index fdd7614..8522161 100644
--- a/pygeometry.c
+++ b/pygeometry.c
@@ -24,6 +24,7 @@
#include "partedmodule.h"
#include "pygeometry.h"
#include "pyfilesystem.h"
+#include "pyconstraint.h"
/* geometry implementation */
@@ -157,6 +158,24 @@ py_ped_geometry_duplicate (PyPedGeometry * self, PyObject * args)
return (PyObject *) py_ped_geometry_obj_new (geom, self->dev, 0);
}
+static PyObject *
+py_ped_constraint_exact (PyPedGeometry * self, PyObject * args)
+{
+ PedConstraint *constraint;
+ PyPedConstraint *pyconstraint;
+
+ py_ped_exception_string_clear ();
+ constraint = ped_constraint_exact (self->geom);
+ if (constraint == NULL) {
+ py_ped_set_error_from_ped_exception ();
+ return NULL;
+ }
+
+ pyconstraint = py_ped_constraint_obj_new (constraint, self->dev, 0);
+
+ return (PyObject *) pyconstraint;
+}
+
static struct PyMethodDef PyPedGeometryMethods[] = {
{ "file_system_open",
(PyCFunction) py_ped_file_system_open, METH_VARARGS, NULL },
@@ -172,7 +191,8 @@ static struct PyMethodDef PyPedGeometryMethods[] = {
(PyCFunction) py_ped_geometry_set_end, METH_VARARGS, NULL },
{ "duplicate",
(PyCFunction) py_ped_geometry_duplicate, METH_VARARGS, NULL },
-
+ { "constraint_exact",
+ (PyCFunction) py_ped_constraint_exact, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL }
};
Index: pyparted.spec
===================================================================
RCS file: /cvs/pkgs/devel/pyparted/pyparted.spec,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- pyparted.spec 21 Aug 2007 19:48:21 -0000 1.44
+++ pyparted.spec 19 Nov 2007 16:34:01 -0000 1.45
@@ -3,12 +3,13 @@
Summary: Python module for GNU parted
Name: pyparted
Version: 1.8.9
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: http://dcantrel.fedorapeople.org/%{name}
Source0: http://dcantrel.fedorapeople.org/%{name}/%{name}-%{version}.tar.bz2
+Patch0: pyparted-exact-constraint.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel, parted-devel >= 1.8.6, pkgconfig
@@ -20,6 +21,7 @@
%prep
%setup -q
+%patch0 -p1
%build
CFLAGS="%{optflags}" CC="%{__cc}" %{__make} %{?_smp_mflags}
@@ -37,6 +39,9 @@
%{python_sitearch}/partedmodule.so
%changelog
+* Mon Nov 19 2007 Jeremy Katz <katzj at redhat.com> - 1.8.9-3
+- Add support for exact constraints
+
* Tue Aug 21 2007 David Cantrell <dcantrell at redhat.com> - 1.8.9-2
- Rebuild
More information about the scm-commits
mailing list