/[gli]/trunk/src/GLIStorageDevice.py
Gentoo

Diff of /trunk/src/GLIStorageDevice.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 494 Revision 495
98 if tmppart.get_type() == "extended": 98 if tmppart.get_type() == "extended":
99 for part_log in parts: 99 for part_log in parts:
100 if part_log < Decimal("4.9"): continue 100 if part_log < Decimal("4.9"): continue
101 tmppart_log = self._partitions[part_log] 101 tmppart_log = self._partitions[part_log]
102 if tmppart_log.get_type() == "free": 102 if tmppart_log.get_type() == "free":
103 if not last_log_free: 103 if last_log_minor < last_log_free:
104 tmppart_log.set_minor(Decimal(str(last_log_minor + 0.9))) 104 self._partitions[last_log_free].set_mb(self._partitions[last_log_free].get_mb()+tmppart_log.get_mb())
105 del self._partitions[part_log]
105 else: 106 else:
106 if last_log_minor < last_log_free: 107 if not last_log_free:
107 self._partitions[last_log_free].set_mb(self._partitions[last_log_free].get_mb()+tmppart_log.get_mb()) 108 last_log_free = Decimal(str(last_log_minor + 0.9))
108 del self._partitions[part_log] 109 tmppart_log.set_minor(last_log_free)
110 self._partitions[last_log_free] = tmppart_log
111 if part_log != last_log_free: del self._partitions[part_log]
112 continue
109 last_log_free = part_log 113 last_log_free = part_log
110 else: 114 else:
111 if part_log > (last_log_minor + 1): 115 if part_log > (last_log_minor + 1):
112 tmppart_log.set_minor(last_log_minor + 1) 116 tmppart_log.set_minor(last_log_minor + 1)
117 last_log_minor = last_log_minor + 1
118 self._partitions[last_log_minor] = tmppart_log
119 del self._partitions[part_log]
120 continue
113 last_log_minor = part_log 121 last_log_minor = part_log
114 if tmppart.get_type() == "free": 122 if tmppart.get_type() == "free":
115 if not last_free: 123 if last_minor < last_free:
116 tmppart.set_minor(Decimal(str(last_minor + 0.1))) 124 self._partitions[last_free].set_mb(self._partitions[last_free].get_mb()+tmppart.get_mb())
125 del self._partitions[part]
117 else: 126 else:
118 if last_minor < last_free: 127 if not last_free:
119 self._partitions[last_free].set_mb(self._partitions[last_free].get_mb()+tmppart.get_mb()) 128 last_free = Decimal(str(last_minor + 0.1))
120 del self_partitions[part] 129 tmppart.set_minor(last_free)
130 self._partitions[last_free] = tmppart
131 if part != last_free: del self._partitions[part]
132 continue
121 last_free = part 133 last_free = part
122 else: 134 else:
123 if part > (last_minor + 1): 135 if part > (last_minor + 1):
124 tmppart.set_minor(last_minor + 1) 136 tmppart.set_minor(last_minor + 1)
137 last_minor = last_minor + 1
138 self._partitions[last_minor] = tmppart
139 del self._partitions[part]
140 continue
125 last_minor = part 141 last_minor = part
126 142
127 def add_partition(self, free_minor, mb, start, end, type, mountpoint='', mountopts=''): 143 def add_partition(self, free_minor, mb, start, end, type, mountpoint='', mountopts=''):
128 free_minor = Decimal(str(free_minor)) 144 free_minor = Decimal(str(free_minor))
129 new_minor = int(free_minor) + 1 145 new_minor = int(free_minor) + 1

Legend:
Removed from v.494  
changed lines
  Added in v.495

  ViewVC Help
Powered by ViewVC 1.1.20