diff options
author | Erik Troan <ewt@redhat.com> | 1999-12-11 21:11:09 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-12-11 21:11:09 +0000 |
commit | 6c57d5c852790a1441cfd6f0039bd1cdee36fcd9 (patch) | |
tree | 434bcf3865a9b686f229a43477ad8b5a7decb86c /iutil.py | |
parent | 784a328d02c137bad5a09f4aa22d04ce65726fc1 (diff) | |
download | anaconda-6c57d5c852790a1441cfd6f0039bd1cdee36fcd9.tar.gz anaconda-6c57d5c852790a1441cfd6f0039bd1cdee36fcd9.tar.xz anaconda-6c57d5c852790a1441cfd6f0039bd1cdee36fcd9.zip |
1) more fstab-ish updates
2) split text timezone stuff into textw/timezone.py
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 41 |
1 files changed, 40 insertions, 1 deletions
@@ -1,5 +1,5 @@ -import types, os, sys, isys, select, string +import types, os, sys, isys, select, string, stat def getArch (): arch = os.uname ()[4] @@ -168,3 +168,42 @@ def getDefaultRunlevel (): return fields[1] return None + +def makerelname(relpath, filename): + if relpath != '': + return relpath+'/'+filename + else: + return filename + + +def findtz(basepath, relpath): + tzdata = [] + for n in os.listdir(basepath+'/'+relpath): + timezone = makerelname(relpath, n) + if relpath != '': + timezone = relpath+'/'+n + else: + timezone = n + + filestat = os.lstat(basepath+'/'+timezone) + [filemode] = filestat[:1] + + if (not (stat.S_ISLNK(filemode) or + stat.S_ISREG(filemode) or + stat.S_ISDIR(filemode))): + continue + elif n[:1] >= 'A' and n[:1] <= 'Z': + if stat.S_ISDIR(filemode): + tmptzdata = findtz(basepath, timezone) + else: + tmptzdata = [timezone] + + for m in tmptzdata: + if tzdata == []: + tzdata = [m] + else: + tzdata.append(m) + + tzdata.sort() + + return tzdata |