[patch] this is a pyparted patch for 429185

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux