aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-modules
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-08-26 10:00:14 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-08-26 10:00:14 +0000
commit91192d46532bec24324b6ba6639bec773ffeb2bd (patch)
tree2a9520ae49d908c2f5f72932385b69643ed3990b /pbuilder-modules
parentb84610eea8082cd4437d7515d0a043c3f54e7460 (diff)
downloadpbuilder-91192d46532bec24324b6ba6639bec773ffeb2bd.tar
pbuilder-91192d46532bec24324b6ba6639bec773ffeb2bd.tar.gz
Add a symlink from /tmp/buildd to the current BUILDD to avoid too many breakages
This change will go away someday, so please update your scripts to use BUILDDIR Thanks: Helmut for the idea
Diffstat (limited to 'pbuilder-modules')
-rw-r--r--pbuilder-modules20
1 files changed, 20 insertions, 0 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index 7808a96..6e90e9a 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -497,6 +497,26 @@ function extractbuildplace () {
# FIXME maybe add more checks here? - actually it's not even really needed,
# since it's created at chroot creation time too.
mkdir -p "${BUILDPLACE}${BUILDDIR}"
+ # XXX added in 0.216, to be deprecated in the future
+ # Add a compatibily symlink from the old BUILDDIR (/tmp/buildd) to the new
+ # one, if different. (Yes, people should just fix their scripts to use
+ # 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 [ -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
+ rmdir "$BUILDPLACE/tmp/buildd"
+ ln -rs "${BUILDPLACE}$BUILDDIR" "$BUILDPLACE/tmp/buildd"
+ else
+ log "W: Could not create compatibily symlink because /tmp/buildd is not empty"
+ fi
+ elif [ ! -e "$BUILDPLACE/tmp/buildd" ]; then
+ ln -rs "${BUILDPLACE}$BUILDDIR" "$BUILDPLACE/tmp/buildd"
+ else
+ log "W: Could not create compatibily symlink because /tmp/buildd exists and it is not a directory"
+ fi
+ fi
}
function echobacktime () {