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

Re: [PATCH][all branches] Remove partitions before unpartitoned non-partition devices. (#588597)



Ack (with a fixed up commit msg)

On 05/07/2010 08:44 AM, David Lehman wrote:
---
  storage/devicetree.py |    8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 03827df..e14551e 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -535,6 +535,14 @@ class DeviceTree(object):
                  elif isinstance(a2.device, PartitionDevice) and \
                       a1.device.partitioned:
                      ret = -1
+                # remove partitions before unpartitioned non-partition
+                # devices
+                elif isinstance(a1.device, PartitionDevice) and \
+                     not isinstance(a2.device, PartitionDevice):
+                    ret = 1
+                elif isinstance(a2.device, PartitionDevice) and \
+                     not isinstance(a1.device, PartitionDevice):
+                    ret = -1
                  else:
                      ret = 0
              elif a1.isDestroy():


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