diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rwxr-xr-x | pbuilder | 4 | ||||
-rw-r--r-- | pbuilder-modules | 20 |
4 files changed, 32 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2003-08-09 Junichi Uekawa <dancer@debian.org> + + * pbuilder-modules (pbuilder-options): rm -r replacement, + clean_subdirectories, use this instead of rm -rf, to check for + -xdev. + 2003-08-05 Junichi Uekawa <dancer@debian.org> * pbuilder-user-mode-linux: add 'rw' option to linux invocation to mount diff --git a/debian/changelog b/debian/changelog index 0c89f10..07b769a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +pbuilder (0.80) unstable; urgency=low + + * replace rm -rf with clean_subdirectories, which uses find with -xdev. + (closes: #204585) + + -- Junichi Uekawa <dancer@debian.org> Sat, 9 Aug 2003 06:40:27 +0900 + pbuilder (0.79) unstable; urgency=low * Remove reference to lv from source code, it was only for debugging @@ -27,11 +27,11 @@ case "$1" in . /usr/lib/pbuilder/pbuilder-checkparams if [ -n "$BASEBUILDPLACE" ]; then echo "Cleaning [$BASEBUILDPLACE]" - rm -rf "$BASEBUILDPLACE"/* || true + clean_subdirectories "$BASEBUILDPLACE" || true fi if [ -n "$APTCACHE" ]; then echo "Cleaning [$APTCACHE]" - rm -rf "$APTCACHE"/* || true + clean_subdirectories "$APTCACHE" || true fi ;; login) diff --git a/pbuilder-modules b/pbuilder-modules index 71fbfea..1619f0e 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -136,6 +136,22 @@ function mountproc () { done } +## function to clean subdirs, use instead of rm -r +function clean_subdirectories () { + if [ -z "$1" ]; then + echo "Fatal internal error in clean_subdirectories" + exit 1; + fi + if [ ! -d "$1" ]; then + echo "Warning: directory $1 does not exist in clean_subdirectories" + return; + fi + echo " -> removing directory $1 and its subdirectories" + find "$1" \( \! -type d \) -a -xdev -print0 |xargs -0 rm -f + find "$1" -type d -xdev -depth -print0 | \ + (xargs -0 rmdir || true) +} + function cleanbuildplace () { if [ "$?" -ne 0 ]; then echo " -> Aborting with an error"; @@ -143,9 +159,7 @@ function cleanbuildplace () { if [ "${INTERNAL_BUILD_UML}" != "yes" ]; then if [ -d "$BUILDPLACE" ]; then echo " -> cleaning the build env " - find "$BUILDPLACE" \( \! -type d \) -a -xdev -print0 |xargs -0 rm -f - find "$BUILDPLACE" -type d -xdev -depth -print0 |(xargs -0 \ - rmdir || true) + clean_subdirectories "$BUILDPLACE" fi; fi } |