summaryrefslogtreecommitdiffstats
path: root/upgrade.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-03-16 19:00:59 +0000
committerErik Troan <ewt@redhat.com>2001-03-16 19:00:59 +0000
commit7cb4da1ffe4f75f9914a71b67764148a5dd80f37 (patch)
treeb04d085403c3eb894e62bbfb3003bd97475d093a /upgrade.py
parentb54e2afb9d1faf2045d12e65d4d64858fe722cc0 (diff)
downloadanaconda-7cb4da1ffe4f75f9914a71b67764148a5dd80f37.tar.gz
anaconda-7cb4da1ffe4f75f9914a71b67764148a5dd80f37.tar.xz
anaconda-7cb4da1ffe4f75f9914a71b67764148a5dd80f37.zip
don't duplicate fstab entries
Diffstat (limited to 'upgrade.py')
-rw-r--r--upgrade.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/upgrade.py b/upgrade.py
index 142ddf6c7..7dd5d01e3 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -170,9 +170,16 @@ def createSwapFile(instPath, theFstab, mntPoint, size, progressWindow):
file = mntPoint + "/SWAP"
else:
file = "/SWAP"
+
+ existingSwaps = theFstab.swapList(files = 1)
+ swapFileDict = {}
+ for n in existingSwaps:
+ dev = n[0]
+ swapFileDict[dev] = 1
count = 0
- while (swapfileExists(instPath + file)):
+ while (swapfileExists(instPath + file) or
+ swapFileDict.has_key(file)):
count = count + 1
tmpFile = "/SWAP-%d" % (count)
if mntPoint != "/":