[grubcfg] If we only see #GRUB_DISTRIBUTION, it's not been set
- If we update the line, then GRUB_DISTRIBUTION has been set - If we don't update the line (e.g. because of *keepDistribution*) then a comment doesn't count as "have seen that line". This means that if we get to the end of the file, with only commented- out GRUB_DISTRIBUTION lines, and *keepDistribution* is set, then we'll still write a distribution line -- because otherwise it's not set at all.
This commit is contained in:
parent
c6c861654d
commit
4a0a8083f3
@ -181,6 +181,10 @@ def modify_grub_default(partitions, root_mount_point, distributor):
|
|||||||
if libcalamares.job.configuration.get("keepDistributor", false):
|
if libcalamares.job.configuration.get("keepDistributor", false):
|
||||||
lines[i] = distributor_line
|
lines[i] = distributor_line
|
||||||
have_distributor_line = True
|
have_distributor_line = True
|
||||||
|
else:
|
||||||
|
# We're not updating because of *keepDistributor*, but if
|
||||||
|
# this was a comment line, then it's still not been set.
|
||||||
|
have_distributor_line = not lines[i].startsdwith("#")
|
||||||
else:
|
else:
|
||||||
lines = []
|
lines = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user