From efb79d262e9f624aa8aaac1d6ddf4e836da9c883 Mon Sep 17 00:00:00 2001 From: lxnay Date: Wed, 8 Aug 2007 08:47:10 +0000 Subject: [PATCH] safer handling of rootdir git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@415 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- client/equoTools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/equoTools.py b/client/equoTools.py index b6dc9cabe..7be13a293 100644 --- a/client/equoTools.py +++ b/client/equoTools.py @@ -1343,8 +1343,9 @@ def installFile(package, infoDict = None): rootdir = imagepathDir[len(imageDir):] # get info if (rootdir): - if os.path.islink(rootdir) or os.path.isfile(rootdir): - os.remove(rootdir) + if os.path.islink(rootdir): + if not os.access(os.readlink(rootdir),os.R_OK): # broken symlink + os.remove(rootdir) if not os.path.isdir(rootdir): #print "creating dir "+rootdir os.makedirs(rootdir)