install

installer
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/install

commit 3199720397b5ce5633ccd934849bf25d5b873db3
parent 451021d5509988549b47d4cb0ca67785df904cc9
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Sun, 20 Nov 2016 00:35:41 +0100

Fix(Manual Partitionning): Better support for extended partitions

Diffstat:
Mscreens/conf_install/conf_install.py | 18++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/screens/conf_install/conf_install.py b/screens/conf_install/conf_install.py @@ -626,16 +626,26 @@ class Conf_Install: i = 0 # Size used, in MB size_used = 0 + in_extended = 0 for p in d["part"]: - size_used += self.size_to_mb(float(p["size"][:-1]), p["size"][-1:]) - choices.append((p["part"], " "+ str(i) +" "+ p["part"].replace("/dev/", "") +"\t\t"+ p["size"] +"\t"+ p["type"])) + # If the partition type is Extended, we don't wanna count it + if p["type"] != "Extended": + size_used += self.size_to_mb(float(p["size"][:-1]), p["size"][-1:]) + + if in_extended == 0: + part_name = p["part"].replace("/dev/", "") + else: + part_name = "└─ " + p["part"].replace("/dev/", "") + choices.append((p["part"], " "+ str(i) +" "+ part_name +"\t\t"+ p["size"] +"\t"+ p["type"])) + if p["type"] == "Extended": + in_extended = 1 i = i + 1 # Get the size of the disk, in MB disk_size = self.size_to_mb(d["size"], d["unit"]) - # If we got more than 10MB of free space (Less is very likely to be padding) we print it. - if size_used - disk_size > 10: + # If we got more than 100MB of free space (Less is very likely to be padding) we print it. + if size_used - disk_size > 100: choices.append(("FS:"+d["name"], " FREE SPACE\t\t"+ str(int(size_used) - int(disk_size)) + "M"))