summaryrefslogtreecommitdiff
path: root/morphlib/stagingarea.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-04-30 12:22:27 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2012-04-30 12:23:13 +0100
commit40e7957c2fade1dc67007a99d0647c1f2e4a9e12 (patch)
treef014942b8f8fd13d83b250f6509efe883d8da72c /morphlib/stagingarea.py
parent8de9212fff953e967209dfc7f285ecb794152a9a (diff)
downloadmorph-40e7957c2fade1dc67007a99d0647c1f2e4a9e12.tar.gz
stagingarea: fix dir detection
Diffstat (limited to 'morphlib/stagingarea.py')
-rw-r--r--morphlib/stagingarea.py8
1 files changed, 4 insertions, 4 deletions
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)