- Upgrade to pyparted-2.0.0
This commit is contained in:
parent
f1095073e4
commit
52ecb3e45f
@ -1 +1 @@
|
||||
pyparted-1.8.9.tar.bz2
|
||||
pyparted-2.0.0.tar.gz
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
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 }
|
||||
};
|
||||
|
||||
@ -2,18 +2,18 @@
|
||||
|
||||
Summary: Python module for GNU parted
|
||||
Name: pyparted
|
||||
Version: 1.8.9
|
||||
Release: 6%{?dist}
|
||||
Version: 2.0.0
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
Group: System Environment/Libraries
|
||||
URL: http://dcantrel.fedorapeople.org/%{name}
|
||||
URL: http://fedorahosted.org/pyparted
|
||||
|
||||
Source0: http://dcantrel.fedorapeople.org/%{name}/%{name}-%{version}.tar.bz2
|
||||
Patch0: pyparted-exact-constraint.patch
|
||||
Source0: http://fedorahosted.org/releases/p/y/%{name}/%{name}-%{version}.tar.gz
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: python-devel, parted-devel >= 1.8.8, pkgconfig
|
||||
Requires: parted >= 1.8.8
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: parted-devel >= 1.8.8
|
||||
BuildRequires: pkgconfig
|
||||
|
||||
%description
|
||||
Python module for the parted library. It is used for manipulating
|
||||
@ -21,24 +21,29 @@ partition tables.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
CFLAGS="%{optflags}" CC="%{__cc}" %{__make} %{?_smp_mflags}
|
||||
%configure
|
||||
%{__make} %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%{__rm} -rf %{buildroot}
|
||||
%{__make} install DESTDIR=%{buildroot}
|
||||
%{__rm} -rf %{buildroot}%{python_sitearch}/_pedmodule.la
|
||||
|
||||
%clean
|
||||
%{__rm} -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc README COPYING AUTHORS ChangeLog
|
||||
%{python_sitearch}/partedmodule.so
|
||||
%doc AUTHORS BUGS COPYING ChangeLog NEWS README TODO WHY
|
||||
%{python_sitearch}/_pedmodule.so
|
||||
%{python_sitearch}/parted
|
||||
|
||||
%changelog
|
||||
* Thu Feb 12 2009 David Cantrell <dcantrell@redhat.com> - 2.0.0-1
|
||||
- Upgrade to pyparted-2.0.0
|
||||
|
||||
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.8.9-6
|
||||
- Rebuild for Python 2.6
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user