[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[patch] this is a pyparted patch for 429185
- From: Joel Andres Granados <jgranado redhat com>
- To: Anaconda Devel <anaconda-devel-list redhat com>
- Subject: [patch] this is a pyparted patch for 429185
- Date: Sat, 10 May 2008 18:22:20 +0200
I'm posting the patch here because I don't know where pyparted discussion list lives :)
You can find the patch at https://bugzilla.redhat.com/attachment.cgi?id=305028
pyparted needs to search the valid partitions before it returns anything in the py_ped_disk_next_partition function. With this patch we can now save anaconda tracebacks to usb keys. I build pyparted but didn't test the patch extensively.
Comments are greatly appreciated.
PS: For the lazy ones, I'm attaching the patch also. :)
--
Joel Andres Granados
Red Hat / Brno, Czech Republic
diff --git a/src/pydisk.c b/src/pydisk.c
index 24eecec..23dc41d 100644
--- a/src/pydisk.c
+++ b/src/pydisk.c
@@ -1501,6 +1501,10 @@ PyObject *py_ped_disk_minimize_extended_partition(PyObject *s, PyObject *args) {
return PyBool_FromLong(ret);
}
+/*
+ * This function returns the next "active" partition in the list.
+ * If the end of the list is reached, we return NULL.
+ */
PyObject *py_ped_disk_next_partition(PyObject *s, PyObject *args) {
PyObject *in_disk, *in_part;
PedDisk *out_disk = NULL;
@@ -1523,7 +1527,12 @@ PyObject *py_ped_disk_next_partition(PyObject *s, PyObject *args) {
return NULL;
}
- pass_part = ped_disk_next_partition(out_disk, out_part);
+ for(pass_part = ped_disk_next_partition(out_disk, out_part);
+ pass_part;
+ pass_part = ped_disk_next_partition(out_disk, pass_part)){
+ if(ped_partition_is_active(pass_part))
+ break;
+ }
if (pass_part == NULL) {
PyErr_SetNone(PyExc_IndexError);
return NULL;
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]