]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
[bb.utils] Make prunedir cope with symlinks to directories
authorHolger Hans Peter Freyther <zecke@selfish.org>
Wed, 8 Oct 2008 01:48:01 +0000 (01:48 +0000)
committerHolger Hans Peter Freyther <zecke@selfish.org>
Wed, 8 Oct 2008 01:48:01 +0000 (01:48 +0000)
2008-10-07  Julian Chu  <Julian_Chu@openmoko.com>

        Reviewed by Holger.

        The packagekit git repository contains a symlink and on fetching the
        pruning failed as "packagekit" is not a directory but a symlink to a
        directory.

        * lib/bb/utils.py:

ChangeLog
lib/bb/utils.py

index 609c5b9e00e01d11451178ce2b2974fb8a2bb1a9..39032918c301f75599e2a26e320f6b89c23fa53f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -155,6 +155,7 @@ Changes in Bitbake 1.9.x:
          used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used
          to extend the internal whitelist.
        - Perforce fetcher fix to use commandline options instead of being overriden by the environment
+       - bb.utils.prunedir can cope with symlinks to directoriees without exceptions
 
 Changes in Bitbake 1.8.0:
        - Release 1.7.x as a stable series
index 2520c252e5e5c6c9245af70da652829cae5e94ac..904884550e5757577b5f1a892acd0f2bc7f8eebc 100644 (file)
@@ -357,5 +357,8 @@ def prunedir(topdir):
         for name in files:
             os.remove(os.path.join(root, name))
         for name in dirs:
-            os.rmdir(os.path.join(root, name))
+            if os.path.islink(os.path.join(root, name)):
+                os.remove(os.path.join(root, name))
+            else:
+                os.rmdir(os.path.join(root, name))
     os.rmdir(topdir)