From 5a2221f4359ed5456f1e2381e0efc13e9315dbdc Mon Sep 17 00:00:00 2001 From: Peng Zhihui Date: Fri, 17 Jan 2014 13:38:36 +0800 Subject: [PATCH] Add a feature:. if swap partition then can not be mounted. modified: dialog/di_newt.py --- dialog/di_newt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dialog/di_newt.py b/dialog/di_newt.py index e4f28e2..531e134 100644 --- a/dialog/di_newt.py +++ b/dialog/di_newt.py @@ -474,8 +474,11 @@ class MountPoint(Screen): nonmount_dir = ['/dev','/etc','/lib64','/lib','/bin','/sbin','/proc','/sys'] if flag == 'one': mountpoint = Screen.entry.value() + fs = Screen.listbox.current() if not mountpoint: return True + if fs == 'linux-swap' and mountpoint: + return False for m in nonmount_dir: if re.match(m+'/',mountpoint) or m == mountpoint: return False @@ -541,7 +544,7 @@ class MountPoint(Screen): s = Screen.yesno(self.title, 1, 8, 'TextboxReflowed', 'eLabel', 'Grid_Complex', 'eLabel', 'Checkbox','eLabel','ButtonBar') if s == 0: if not self.check_mountpoint(flag='one'): - Screen.pop_window('Invalid mount point','The mount point you entered is invalid.\nMount point must start with "/".They cannot contain spaces.\nMount point cannot be "/dev","/etc","/lib","lib64","/bin","/sbin","/proc","/sys".\n', 50) + Screen.pop_window('Invalid mount point','The mount point you entered is invalid.\nMount point must start with "/".They cannot contain spaces.\nMount point cannot be "/dev","/etc","/lib","lib64","/bin","/sbin","/proc","/sys".\nAnd when formatted linux-swap filesystem, the partition can not be mounted.', 50) continue if MD: if Screen.entry.value() != '' or Screen.checkbox.value() == 1: