From 40e7957c2fade1dc67007a99d0647c1f2e4a9e12 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 30 Apr 2012 12:22:27 +0100 Subject: stagingarea: fix dir detection --- morphlib/stagingarea.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'morphlib') diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py index 4b74a4d0..8c84ac36 100644 --- a/morphlib/stagingarea.py +++ b/morphlib/stagingarea.py @@ -131,15 +131,15 @@ class StagingArea(object): return True # target does not exist if tarinfo.isdir(): - if existing.isdir(): + if stat.S_ISDIR(existing.st_mode): return True - elif existing.islnk(): + elif stat.S_ISLNK(existing.st_mode): st = follow_symlink(targetpath) return st and stat.S_ISDIR(st.st_mode) else: - if existing.isdir(): + if stat.S_ISDIR(existing.st_mode): return False - elif existing.islnk(): + elif stat.S_ISLNK(existing.st_mode): st = follow_symlink(targetpath) if st and not stat.S_ISDIR(st.st_mode): os.remove(targetpath) -- cgit v1.2.1