summaryrefslogtreecommitdiffstats
path: root/lilo.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-06-30 20:55:04 +0000
committerMatt Wilson <msw@redhat.com>2000-06-30 20:55:04 +0000
commit3cedf001d201f6e0ba11c6950804c35618fe0d39 (patch)
treefef5d9cd144eb6c1bdcd19ebac43ac12fd454cd8 /lilo.py
parent7c34135f03bdb1c24e8d05315fdbab053c7a764f (diff)
downloadanaconda-3cedf001d201f6e0ba11c6950804c35618fe0d39.tar.gz
anaconda-3cedf001d201f6e0ba11c6950804c35618fe0d39.tar.xz
anaconda-3cedf001d201f6e0ba11c6950804c35618fe0d39.zip
patch to avoid adding extra whitespace to lilo.conf on upgrades from hj
Diffstat (limited to 'lilo.py')
-rw-r--r--lilo.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lilo.py b/lilo.py
index e41c774af..3d659dca2 100644
--- a/lilo.py
+++ b/lilo.py
@@ -81,20 +81,23 @@ class LiloConfigFile:
orig = l
while (l and (l[0] == ' ' or l[0] == '\t')):
l = l[1:]
- if (not l or l[0] == '#'):
- self.order.append('#' + orig)
+ if not l:
continue
+ if l[0] == '#':
+ self.order.append('#' + orig)
fields = string.split(l, '=', 1)
if (len(fields) == 2):
- if (fields[0] == "image" or fields[0] == "other"):
+ f0 = string.strip (fields [0])
+ f1 = string.strip (fields [1])
+ if (f0 == "image" or f0 == "other"):
if image: self.addImage(image)
- image = LiloConfigFile(imageType = fields[0],
- path = fields[1])
+ image = LiloConfigFile(imageType = f0,
+ path = f1)
args = None
else:
- args = (fields[0], fields[1])
+ args = (f0, f1)
else:
- args = (l,)
+ args = (string.strip (l),)
if (args and image):
apply(image.addEntry, args)