File: nofakeroot

package info (click to toggle)
monotone 1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 20,648 kB
  • sloc: cpp: 86,443; sh: 6,906; perl: 924; makefile: 838; python: 517; lisp: 379; sql: 118; exp: 91; ansic: 52
file content (33 lines) | stat: -rwxr-xr-x 696 bytes parent folder | download | duplicates (4)
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 "$@"