Optimization, safe_to_format() now checks partition.allow_formatting as a condition.
This commit is contained in:
parent
fb55e318e5
commit
8bf3296749
|
|
@ -184,7 +184,9 @@ class Partition():
|
||||||
return True if files > 0 else False
|
return True if files > 0 else False
|
||||||
|
|
||||||
def safe_to_format(self):
|
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 False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ with archinstall.Filesystem(archinstall.arguments['harddrive'], archinstall.GPT)
|
||||||
fs.use_entire_disk(archinstall.arguments.get('filesystem', 'ext4'))
|
fs.use_entire_disk(archinstall.arguments.get('filesystem', 'ext4'))
|
||||||
else:
|
else:
|
||||||
for partition in archinstall.arguments['harddrive']:
|
for partition in archinstall.arguments['harddrive']:
|
||||||
if partition.allow_formatting and partition.safe_to_format():
|
if partition.safe_to_format():
|
||||||
partition.format()
|
partition.format()
|
||||||
else:
|
else:
|
||||||
archinstall.log(f"Did not format {partition} because .safe_to_format() returned False or .allow_formatting was False", level=archinstall.LOG_LEVELS.Debug)
|
archinstall.log(f"Did not format {partition} because .safe_to_format() returned False or .allow_formatting was False", level=archinstall.LOG_LEVELS.Debug)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue