summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2008-10-08 01:48:01 +0000
committerHolger Hans Peter Freyther <zecke@selfish.org>2008-10-08 01:48:01 +0000
commit24b23417acc0d34a7dbcd6fe1d05aad87d46abe3 (patch)
treec7497aca555e401e700783c2288ac1d8f7e28cad
parent7a6dd971812c57b06c8d6dc40cd89df3839de5d3 (diff)
downloadbitbake-contrib-24b23417acc0d34a7dbcd6fe1d05aad87d46abe3.tar.gz
[bb.utils] Make prunedir cope with symlinks to directories
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:
-rw-r--r--ChangeLog1
-rw-r--r--lib/bb/utils.py5
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 609c5b9e0..39032918c 100644
--- 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
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 2520c252e..904884550 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -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)