]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
package/pseudo: provide better legacy handling for fakeroot
authorYann E. MORIN <yann.morin.1998@free.fr>
Tue, 8 Nov 2016 22:18:35 +0000 (23:18 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 9 Nov 2016 22:30:15 +0000 (23:30 +0100)
We now have a wrapper that makes pseudo behaves like the fakeroot of the
good ol' days. So the symlink will just magically keep old scripts
working as they did before the switch to pseudo.

However, using fakeroot is deprecated, and we want people to stop using
it altogether and switch to pseudo.

So, make the wrapper recognise how it's called, and if called as
fakeroot, print a warning message.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gaƫl PORTAY <gael.portay@savoirfairelinux.com>
Cc: Patrick Keroulas <patrick.keroulas@savoirfairelinux.com>
Cc: Erico Nunes <nunes.erico@gmail.com>
Cc: Julien BOIBESSOT <julien.boibessot@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pseudo/pseudo-wrapper
package/pseudo/pseudo.mk

index feaa7fcecbcceaa99a3590d0ad2654f15156eec6..9c8dbdbfab7b4bdda6bff11a6a1daa1d44abad9f 100644 (file)
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+if [ "${0##*/}" = "fakeroot" ]; then
+    cat >&2 <<-_EOF_
+       WARNING: fakeroot has been replaced with pseudo.
+       WARNING: Update your script(s) to use pseudo or pseudo-wrapper instead.
+       _EOF_
+fi
+
 export PSEUDO_PREFIX="$(dirname "${0%/*}")"
 export PSEUDO_OPTS="-t0"
 if [ -n "${TARGET_DIR}" ]; then
@@ -9,4 +16,4 @@ if [ -n "${BASE_DIR}" ]; then
     export PSEUDO_LOCALSTATEDIR="${BASE_DIR}/build/.pseudodb"
 fi
 
-exec "${0%-wrapper}" "${@}"
+exec "${0%/*}/pseudo" "${@}"
index 7701825343cdbab18fd9222b5b71a8fe25315208..aa2a9c78a07916a675c75869c647ff3e7651a3ec 100644 (file)
@@ -33,7 +33,7 @@ endef
 HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_INSTALL_WRAPPER
 
 define HOST_PSEUDO_FAKEROOT_SYMLINK
-       ln -sf pseudo $(HOST_DIR)/usr/bin/fakeroot
+       ln -sf pseudo-wrapper $(HOST_DIR)/usr/bin/fakeroot
 endef
 HOST_PSEUDO_POST_INSTALL_HOOKS += HOST_PSEUDO_FAKEROOT_SYMLINK