Hey guys,
I noticed a couple bits of dead code in the anaconda-9.1.5.8 code.
In partIntfHelpers.py - sanityCheckMountPoint():
...
if mntpt:
passed = 1
if not mntpt:
passed = 0
else:
if mntpt[0] != '/' or (len(mntpt) > 1 and mntpt[-1:] == '/'):
passed = 0
elif mntpt.find(' ') > -1:
passed = 0
the "if not mntpt" check will never be hit. This would be better written
as:
if mntpt:
passed = 1
if mntpt[0] != '/' or (len(mntpt) > 1 and mntpt[-1:] == '/'):
passed = 0
elif mntpt.find(' ') > -1:
passed = 0
Also, there's a bug in this function where if you're "editing" an existing
partition in the graphical installer and you decide to reformat something
like a swap partition as ext2/ext3, there is no requirement to specify a
mount point for it. Not really a huge bug, but it's handled differently
than when you normally format something as ext2/ext3.
Another bit I saw was:
In language.py - __init__():
...
allSupportedLangs = []
langInfoByName = {}
langFilter = {}
allInstalledFlag = 0
langsInstalled = []
if os.access("/usr/share/anaconda/locale-list", os.R_OK):
f = open("/usr/share/anaconda/locale-list")
lines = f.readlines()
f.close()
for line in lines:
line = string.strip(line)
(lang, map, font, name) = string.split(line, ' ', 3)
langInfoByName[name] = (lang, map, font)
allSupportedLangs.append(name)
if allInstalledFlag or (langFilter and langFilter.has_key(lang)):
langsInstalled.append(name)
...
The langsInstalled list won't ever have anything added to it since
allInstalledFlag is never changed and nothing is ever added to the
langFilter hash.
-p.