diff options
author | Steve M. Robbins <steve@sumost.ca> | 2010-12-31 17:24:36 -0600 |
---|---|---|
committer | Junichi Uekawa <dancer@netfort.gr.jp> | 2011-06-24 19:29:54 +0900 |
commit | b8ba16bbb5354d65c6857df64b8488578ca648f7 (patch) | |
tree | 85fed23ddde2226f92d44e388c38a7bcdc6177d9 | |
parent | c3ecceb7767e49733bcc7f8c85a1ec43a00e581b (diff) | |
download | pbuilder-b8ba16bbb5354d65c6857df64b8488578ca648f7.tar pbuilder-b8ba16bbb5354d65c6857df64b8488578ca648f7.tar.gz |
Bug#542915: NMU patch
Hi,
The patch for this NMU is as follows.
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | pbuilder-modules | 20 |
2 files changed, 27 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 158eace..ff042d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +pbuilder (0.199+nmu1) unstable; urgency=low + + * Non-Maintainer Upload. + + * pbuilder-modules: don't clean $BUILDPLACE if another directory has + been bind-mounted under it; patch by Matthew Palmer. (closes: + #542915) + + -- Steve M. Robbins <smr@debian.org> Tue, 28 Dec 2010 10:19:37 -0600 + pbuilder (0.199) unstable; urgency=low * add a more useful message for pbuilder-runhooks when hookdir cannot diff --git a/pbuilder-modules b/pbuilder-modules index db6988b..aa3fc2a 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -319,9 +319,23 @@ function cleanbuildplace () { log "W: Aborting with an error"; fi if [ "${INTERNAL_BUILD_UML}" != "yes" ]; then - if [ -d "$BUILDPLACE" ]; then - log "I: cleaning the build env " - clean_subdirectories "$BUILDPLACE" + if [ -d "$BUILDPLACE" ]; then + # A directory on the same partition as $BUILDPLACE, bind-mounted + # into $BUILDPLACE, will be cleaned out by clean_subdirectories + # (because -xdev doesn't know about bind mounts). To avoid that + # potential disaster (and also to avoid ugly error messages from + # rmdir otherwise), we want to make sure that there is *nothing* + # mounted under the chroot before we do our bulldozer routine. + # + # The readlink -f is a simple way to canonicalize the path for + # $BUILDPLACE (no dirty double slashes for *us*), so it matches + # what will be in the output of mount. + if mount |grep -q -F " $(readlink -f $BUILDPLACE)/"; then + log "E: Something is still mounted under ${BUILDPLACE}; unmount and remove ${BUILDPLACE} manually" + else + log "I: cleaning the build env " + clean_subdirectories "$BUILDPLACE" + fi fi; fi } |