Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-03-08 17:14:21 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-03-08 17:14:21 +0100
commit8bf3296749ebfddc5dfdcbb116547395438d371f (patch)
tree805dd878f47ad4aaf8a34f45d29ee2f9d1f747db
parentfb55e318e5dc87d05da4c636722d24ab9e9cb5b1 (diff)
Optimization, safe_to_format() now checks partition.allow_formatting as a condition.
-rw-r--r--archinstall/lib/disk.py4
-rw-r--r--examples/guided.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 16d6f704..56c75767 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -184,7 +184,9 @@ class Partition():
return True if files > 0 else False
def safe_to_format(self):
- if self.target_mountpoint == '/boot' and self.has_content():
+ if self.allow_formatting is False:
+ return False
+ elif self.target_mountpoint == '/boot' and self.has_content():
return False
return True
diff --git a/examples/guided.py b/examples/guided.py
index fc1fe88d..fbdba776 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -281,7 +281,7 @@ with archinstall.Filesystem(archinstall.arguments['harddrive'], archinstall.GPT)
fs.use_entire_disk(archinstall.arguments.get('filesystem', 'ext4'))
else:
for partition in archinstall.arguments['harddrive']:
- if partition.allow_formatting and partition.safe_to_format():
+ if partition.safe_to_format():
partition.format()
else:
archinstall.log(f"Did not format {partition} because .safe_to_format() returned False or .allow_formatting was False", level=archinstall.LOG_LEVELS.Debug)