From 0a617a8d24e7264c1058f6252717a1a670f014de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Mon, 20 Mar 2017 16:26:09 +0100
Subject: [PATCH 5/5] Adapt t-switch-dir-to-symlink-rel/Makefile to honor
 DPKG_ROOT

---
 t-switch-dir-to-symlink-rel/Makefile | 118 +++++++++++++++++------------------
 1 file changed, 59 insertions(+), 59 deletions(-)

diff --git a/t-switch-dir-to-symlink-rel/Makefile b/t-switch-dir-to-symlink-rel/Makefile
index a347944..c2f81f1 100644
--- a/t-switch-dir-to-symlink-rel/Makefile
+++ b/t-switch-dir-to-symlink-rel/Makefile
@@ -8,31 +8,31 @@ include ../Test.mk
 test-case:
 	# Cannot switch a directory containing conffiles
 	$(DPKG_INSTALL) pkg-dir-conffile-0.deb
-	test -d /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	! $(DPKG_INSTALL) pkg-dir-conffile-1.deb
-	test -d /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)//test-path/test-subpath'
 	$(DPKG_PURGE) pkg-dir-conffile
 
 	# Cannot switch a directory containing files owned by another package
 	$(DPKG_INSTALL) pkg-dir-file-other.deb
 	$(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
-	test -d /test-path/test-subpath
-	! test -h /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
 	! $(DPKG_INSTALL) pkg-dir-symlink-int-1.deb
-	test -d /test-path/test-subpath
-	! test -h /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_PURGE) pkg-dir-symlink-int
 	$(DPKG_PURGE) pkg-dir-file-other
 
 	# Cannot switch a directory containing local files
 	$(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
-	test -d /test-path/test-subpath
-	! test -h /test-path/test-subpath
-	touch '/test-path/test-subpath/local file'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	touch '$(DPKG_INSTDIR)/test-path/test-subpath/local file'
 	! $(DPKG_INSTALL) pkg-dir-symlink-int-1.deb
-	test -d /test-path/test-subpath
-	! test -h /test-path/test-subpath
-	rm '/test-path/test-subpath/local file'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	rm '$(DPKG_INSTDIR)/test-path/test-subpath/local file'
 	$(DPKG_PURGE) pkg-dir-symlink-int
 
 	#
@@ -42,93 +42,93 @@ test-case:
 	# Switch a directory to a symlink, contents moved within the package,
 	# with intermediate full installs.
 	$(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
-	test -d /test-path/test-subpath
-	! test -h /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)//test-path/test-subpath'
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_INSTALL) pkg-dir-symlink-int-1.deb
-	test -h /test-path/test-subpath
+	test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_PURGE) pkg-dir-symlink-int
-	! test -e /test-path/test-subpath
+	! test -e '$(DPKG_INSTDIR)/test-path/test-subpath'
 
 	# Switch a directory to a symlink, contents moved within the package,
 	# with full install, upgrade with upack and configure.
 	$(DPKG_INSTALL) pkg-dir-symlink-int-0.deb
-	! test -h /test-path/test-subpath
-	test -d /test-path/test-subpath
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_UNPACK) pkg-dir-symlink-int-1.deb
-	! test -h /test-path/test-subpath
-	test -d /test-path/test-subpath
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_CONFIGURE) pkg-dir-symlink-int
-	test -h /test-path/test-subpath
+	test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_PURGE) pkg-dir-symlink-int
-	! test -e /test-path/test-subpath
+	! test -e '$(DPKG_INSTDIR)/test-path/test-subpath'
 
 	# Switch a directory to a symlink, contents moved within the package,
 	# with two unpacks and configure.
 	$(DPKG_UNPACK) pkg-dir-symlink-int-0.deb
-	! test -h /test-path/test-subpath
-	test -d /test-path/test-subpath
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_UNPACK) pkg-dir-symlink-int-1.deb
-	! test -h /test-path/test-subpath
-	test -d /test-path/test-subpath
+	! test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_CONFIGURE) pkg-dir-symlink-int
-	test -h /test-path/test-subpath
+	test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_PURGE) pkg-dir-symlink-int
-	! test -e /test-path/test-subpath
+	! test -e '$(DPKG_INSTDIR)/test-path/test-subpath'
 
 	# Switch a directory to a symlink, contents moved to another package,
 	# with intermediate full installs.
 	$(DPKG_INSTALL) pkg-dir-symlink-ext-0.deb
-	test -d /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_INSTALL) pkg-dir-file-moved.deb
-	test -d /test-path/test-subpath
-	test -d /test-dir
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-dir'
 	$(DPKG_INSTALL) pkg-dir-symlink-ext-1.deb
-	test -h /test-path/test-subpath
-	test -d /test-path/test-subpath
-	test "`readlink /test-path/test-subpath`" = "../test-dir"
-	! test -h /test-dir
-	test -d /test-dir
-	test -f /test-dir/file-normal
+	test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test "`readlink '$(DPKG_INSTDIR)/test-path/test-subpath'`" = "../test-dir"
+	! test -h '$(DPKG_INSTDIR)/test-dir'
+	test -d '$(DPKG_INSTDIR)/test-dir'
+	test -f '$(DPKG_INSTDIR)/test-dir/file-normal'
 	$(DPKG_PURGE) pkg-dir-symlink-ext
 	$(DPKG_PURGE) pkg-dir-file-moved
 
 	# Switch a directory to a symlink, contents moved to another package,
 	# with full installs, upgrade with upack and configure.
 	$(DPKG_INSTALL) pkg-dir-symlink-ext-0.deb
-	test -d /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_INSTALL) pkg-dir-file-moved.deb
-	test -d /test-path/test-subpath
-	test -d /test-dir
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-dir'
 	$(DPKG_UNPACK) pkg-dir-symlink-ext-1.deb
-	test -d /test-path/test-subpath
-	test -d /test-dir
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-dir'
 	$(DPKG_CONFIGURE) -a
-	test -h /test-path/test-subpath
-	test -d /test-path/test-subpath
-	test "`readlink /test-path/test-subpath`" = "../test-dir"
-	! test -h /test-dir
-	test -d /test-dir
-	test -f /test-dir/file-normal
+	test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test "`readlink '$(DPKG_INSTDIR)/test-path/test-subpath'`" = "../test-dir"
+	! test -h '$(DPKG_INSTDIR)/test-dir'
+	test -d '$(DPKG_INSTDIR)/test-dir'
+	test -f '$(DPKG_INSTDIR)/test-dir/file-normal'
 	$(DPKG_PURGE) pkg-dir-symlink-ext
 	$(DPKG_PURGE) pkg-dir-file-moved
 
 	# Switch a directory to a symlink, contents moved to another package,
 	# with three unpacks and configure.
 	$(DPKG_UNPACK) pkg-dir-symlink-ext-0.deb
-	test -d /test-path/test-subpath
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
 	$(DPKG_UNPACK) pkg-dir-file-moved.deb
-	test -d /test-path/test-subpath
-	test -d /test-dir
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-dir'
 	$(DPKG_UNPACK) pkg-dir-symlink-ext-1.deb
-	test -d /test-path/test-subpath
-	test -d /test-dir
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-dir'
 	$(DPKG_CONFIGURE) -a
-	test -h /test-path/test-subpath
-	test -d /test-path/test-subpath
-	test "`readlink /test-path/test-subpath`" = "../test-dir"
-	! test -h /test-dir
-	test -d /test-dir
-	test -f /test-dir/file-normal
+	test -h '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test -d '$(DPKG_INSTDIR)/test-path/test-subpath'
+	test "`readlink '$(DPKG_INSTDIR)/test-path/test-subpath'`" = "../test-dir"
+	! test -h '$(DPKG_INSTDIR)/test-dir'
+	test -d '$(DPKG_INSTDIR)/test-dir'
+	test -f '$(DPKG_INSTDIR)/test-dir/file-normal'
 	$(DPKG_PURGE) pkg-dir-symlink-ext
 	$(DPKG_PURGE) pkg-dir-file-moved
 
-- 
2.11.0

