From 44d29ea59647c60411688b7dda2c684852cda958 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 1 Feb 2000 20:48:53 +0000 Subject: o upgrade code rebuilds the db to a tmp dir and opens that db to calculate the upgrade set. When the user OKs the upgrade, the old db is deleted and the new rebuilt db is moved into place. o lilo/fstab checks for testing mode. o added a iutil.rmrf() function to recursively remove directories --- iutil.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'iutil.py') diff --git a/iutil.py b/iutil.py index a151eee28..f1f5728d2 100644 --- a/iutil.py +++ b/iutil.py @@ -207,3 +207,15 @@ def findtz(basepath, relpath): tzdata.sort() return tzdata + +def rmrf (path): + # this is only the very simple case. + files = os.listdir (path) + for file in files: + if os.path.isdir(path + '/' + file): + rmrf (path + '/' + file) + else: + os.unlink (path + '/' + file) + os.rmdir (path) + + -- cgit