From 91192d46532bec24324b6ba6639bec773ffeb2bd Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Wed, 26 Aug 2015 10:00:14 +0000 Subject: 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 --- pbuilder-modules | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'pbuilder-modules') 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 () { -- cgit v1.2.3