|
Packit Service |
82fcde |
#!/bin/sh
|
|
Packit Service |
82fcde |
# Test that ldconfig -X does not remove stale symbolic links.
|
|
Packit Service |
82fcde |
# Copyright (C) 2000-2018 Free Software Foundation, Inc.
|
|
Packit Service |
82fcde |
# This file is part of the GNU C Library.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
82fcde |
# modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
# License as published by the Free Software Foundation; either
|
|
Packit Service |
82fcde |
# version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
82fcde |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
82fcde |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
82fcde |
# Lesser General Public License for more details.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
82fcde |
# License along with the GNU C Library; if not, see
|
|
Packit Service |
82fcde |
# <http://www.gnu.org/licenses/>.
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
set -ex
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
common_objpfx=$1
|
|
Packit Service |
82fcde |
test_wrapper_env=$2
|
|
Packit Service |
82fcde |
run_program_env=$3
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
testroot="${common_objpfx}elf/bug19610-test-directory"
|
|
Packit Service |
82fcde |
cleanup () {
|
|
Packit Service |
82fcde |
rm -rf "$testroot"
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
trap cleanup 0
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
rm -rf "$testroot"
|
|
Packit Service |
82fcde |
mkdir -p $testroot/lib $testroot/etc
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# Relative symbolic link target.
|
|
Packit Service |
82fcde |
ln -s libdoesnotexist.so.1.1 $testroot/lib/libdoesnotexist.so.1
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
# Absolute symbolic link target.
|
|
Packit Service |
82fcde |
ln -s $testroot/opt/sw/lib/libdoesnotexist2.so.1.1 $testroot/lib/
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
errors=0
|
|
Packit Service |
82fcde |
check_files () {
|
|
Packit Service |
82fcde |
for name in libdoesnotexist.so.1 libdoesnotexist2.so.1.1 ; do
|
|
Packit Service |
82fcde |
path="$testroot/lib/$name"
|
|
Packit Service |
82fcde |
if test ! -h $path ; then
|
|
Packit Service |
82fcde |
echo "error: missing file: $path"
|
|
Packit Service |
82fcde |
errors=1
|
|
Packit Service |
82fcde |
fi
|
|
Packit Service |
82fcde |
done
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
check_files
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
${test_wrapper_env} \
|
|
Packit Service |
82fcde |
${run_program_env} \
|
|
Packit Service |
82fcde |
${common_objpfx}elf/ldconfig -X -f /dev/null \
|
|
Packit Service |
82fcde |
-C $testroot/etc/ld.so.cache \
|
|
Packit Service |
82fcde |
$testroot/lib
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
check_files
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
exit $errors
|