1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#! /bin/sh
# Usage:
# nofakeroot [command ...]
#
# Runs command after removing any trace of fakeroot from the environment it
# receives.
my_PRELOAD=
for l in $LD_PRELOAD; do
if ! echo $l | grep "libfakeroot[-a-z]*\\.so" > /dev/null; then
if [ -n "$my_PRELOAD" ]; then
my_PRELOAD="$my_PRELOAD $l"
else
my_PRELOAD="$l"
fi
fi
done
was_IFS="$IFS" IFS=:
my_LIBRARY_PATH=
for p in $LD_LIBRARY_PATH; do
if ! echo $p | grep "/libfakeroot\$" > /dev/null; then
if [ -n "$my_LIBRARY_PATH" ]; then
my_LIBRARY_PATH="${my_LIBRARY_PATH}:$p"
else
my_LIBRARY_PATH="$p"
fi
fi
done
IFS="$was_IFS"
LD_PRELOAD="$my_PRELOAD" LD_LIBRARY_PATH="$my_LIBRARY_PATH" eval "$@"
|