diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-09-06 06:52:33 +0000 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2015-09-06 06:52:33 +0000 |
commit | ef02c579ea1057028bd8a8fe394dd413f09a8e3d (patch) | |
tree | adf03cd8197203a9fcad2c136ee5fd0193d898fc | |
parent | c732621264061b77a7bcce1cc7d79f64d2865534 (diff) | |
download | pbuilder-ef02c579ea1057028bd8a8fe394dd413f09a8e3d.tar pbuilder-ef02c579ea1057028bd8a8fe394dd413f09a8e3d.tar.gz |
pbuilder-modules: remove the /tmp/buildd symlink if it points to the current BUILDDIR before repacking and just after unpacking
Closes: #797351
-rw-r--r-- | pbuilder-modules | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pbuilder-modules b/pbuilder-modules index 9caee07..8efa273 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -503,6 +503,9 @@ function extractbuildplace () { # BUILDDIR, please file a bug if you need that variable to also be available # elsewhere other than hook script; given that, I won't do too fancy checks) if [ "$BUILDDIR" != '/tmp/buildd' ]; then + if [ -h "$BUILDPLACE/tmp/buildd" ] && [ "$(readlink -f "$BUILDPLACE/tmp/buildd")" = "${BUILDPLACE}$BUILDDIR" ]; then + rm "$BUILDPLACE/tmp/buildd" + fi if [ -d "$BUILDPLACE/tmp/buildd" ] && [ ! -h "$BUILDPLACE/tmp/buildd" ]; then if [ ! "$(ls -A "$BUILDPLACE/tmp/buildd" 2>&1)" ]; then # empty /tmp/buildd, let's change it to a symlink to BUILDDIR @@ -575,6 +578,9 @@ function create_basetgz() { sleep 10s done log "I: creating base tarball [${BASETGZ}]" + if [ -h "$BUILDPLACE/tmp/buildd" ] && [ "$(readlink -f "$BUILDPLACE/tmp/buildd")" = "${BUILDPLACE}$BUILDDIR" ]; then + rm "$BUILDPLACE/tmp/buildd" + fi if ! tar -c --use-compress-program "$COMPRESSPROG" -f "${BASETGZ}.tmp" * ; then log "E: failed building base tarball" rm -f "${BASETGZ}.tmp" |