xsfbs.sh: kill {,de}register_x_lib_dir_with_ld_so

libx11's postinst was the only post-sarge user, and it's gone now.
This commit is contained in:
Julien Cristau 2009-02-17 17:20:42 +01:00
parent 84b7d5bf7a
commit 2ed171f9f3
1 changed files with 0 additions and 66 deletions

66
debian/xsfbs/xsfbs.sh vendored
View File

@ -719,72 +719,6 @@ run () {
fi
}
register_x_lib_dir_with_ld_so () {
# syntax: register_x_lib_dir_with_ld_so
#
# Configure the dynamic loader ld.so to search /usr/X11R6/lib for shared
# libraries.
#
# Call this function from the postinst script of a package that places a
# shared library in /usr/X11R6/lib, before invoking ldconfig.
local dir ldsoconf
dir="/usr/X11R6/lib"
ldsoconf="/etc/ld.so.conf"
# is the line not already present?
if ! fgrep -qsx "$dir" "$ldsoconf"; then
observe "adding $dir directory to $ldsoconf"
echo "$dir" >> "$ldsoconf"
fi
}
deregister_x_lib_dir_with_ld_so () {
# syntax: deregister_x_lib_dir_with_ld_so
#
# Configure dynamic loader ld.so to not search /usr/X11R6/lib for shared
# libraries, if and only if no shared libaries remain there.
#
# Call this function from the postrm script of a package that places a shared
# library in /usr/X11R6/lib, in the event "$1" is "remove", and before
# invoking ldconfig.
local dir ldsoconf fgrep_status cmp_status
dir="/usr/X11R6/lib"
ldsoconf="/etc/ld.so.conf"
# is the line present?
if fgrep -qsx "$dir" "$ldsoconf"; then
# are there any shared objects in the directory?
if [ "$(echo "$dir"/lib*.so.*.*)" = "$dir/lib*.so.*.*" ]; then
# glob expansion produced nothing, so no shared libraries are present
observe "removing $dir directory from $ldsoconf"
# rewrite the file (very carefully)
set +e
fgrep -svx "$dir" "$ldsoconf" > "$ldsoconf.dpkg-tmp"
fgrep_status=$?
set -e
case $fgrep_status in
0|1) ;; # we don't actually care if any lines matched or not
*) die "error reading \"$ldsoconf\"; fgrep exited with status" \
"$fgrep_status" ;;
esac
set +e
cmp -s "$ldsoconf.dpkg-tmp" "$ldsoconf"
cmp_status=$?
set -e
case $cmp_status in
0) rm "$ldsoconf.dpkg-tmp" ;; # files are identical
1) mv "$ldsoconf.dpkg-tmp" "$ldsoconf" ;; # files differ
*) die "error comparing \"$ldsoconf.dpkg-tmp\" to \"$ldsoconf\";" \
"cmp exited with status $cmp_status" ;;
esac
fi
fi
}
make_symlink_sane () {
# syntax: make_symlink_sane symlink target
#