]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate: list directories in child first order in the manifest file
authorJoshua Lock <josh@linux.intel.com>
Wed, 29 Sep 2010 11:10:57 +0000 (12:10 +0100)
committerJoshua Lock <josh@linux.intel.com>
Wed, 29 Sep 2010 16:10:41 +0000 (17:10 +0100)
The directory list in the manifest file needs to be sorted such that child
directories are deleted first. Fortunately as the list is generated by walking
the directory tree achieving this is as simple as reversing the directory list.

Fixes [BUGID #269]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
meta/classes/sstate.bbclass

index c4d548fe2e1beb80a21a7826a10db476af180edc..bcac3638e1a7fae89ac8498dbcee0937132e9a31 100644 (file)
@@ -106,8 +106,10 @@ def sstate_install(ss, d):
     # We want to ensure that directories appear at the end of the manifest
     # so that when we test to see if they should be deleted any contents
     # added by the task will have been removed first.
-    for dir in shareddirs:
-        f.write(dir + "\n")
+    dirs = sorted(shareddirs, key=len)
+    # Must remove children first, which will have a longer path than the parent
+    for di in reversed(dirs):
+        f.write(di + "\n")
     f.close()
 
     for lock in locks: