sstate: Handle symlink directory entries correctly

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Richard Purdie 2010-09-03 15:28:11 +01:00
parent 7e36135a7e
commit a6ce10e83e
1 changed files with 4 additions and 2 deletions

View File

@ -170,8 +170,10 @@ def sstate_clean_manifest(manifest, d):
entry = entry.strip()
bb.debug(2, "Removing manifest: %s" % entry)
if entry.endswith("/"):
if os.path.exists(entry) and len(os.listdir(entry)) == 0:
os.rmdir(entry)
if os.path.islink(entry[:-1]):
os.remove(entry[:-1])
elif os.path.exists(entry) and len(os.listdir(entry)) == 0:
os.rmdir(entry[:-1])
else:
oe.path.remove(entry)