Remove also broken symlinks

This commit is contained in:
Martin Gracik 2010-10-29 14:41:42 +02:00
parent 2fc71cc74e
commit 5f6c661d28

View File

@ -87,7 +87,9 @@ class LoraxYumHelper(object):
for pattern in pattern_list:
if fnmatch.fnmatch(fname, pattern):
fullpath = joinpaths(self.installroot, fname)
if os.path.isfile(fullpath):
if (os.path.islink(fullpath) or
os.path.isfile(fullpath)):
os.unlink(fullpath)
logger.debug("removed {0}".format(fullpath))
count += 1