]>
git.ipfire.org Git - people/stevee/pakfire.git/blob - src/scripts/check-symlinks
51e067e2cefc78d87b239a93e51546d488d2ec0c
2 ###############################################################################
4 # Pakfire - The IPFire package management system #
5 # Copyright (C) 2021 Pakfire development team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
27 local buildroot
="${1}"
30 # Check if BUILDROOT exists
31 if [ ! -d "${buildroot}" ]; then
32 error
"BUILDROOT does not exist"
39 for file in $
(find "${buildroot}" -type l
); do
40 if [ ! -e "${file}" ]; then
41 broken_links
+=( "${file}" )
45 if [ "${#broken_links[@]}" -gt 0 ]; then
46 error
"The following broken symlinks have been found:"
49 for link
in ${broken_links[@]}; do
50 error
" ${link/${buildroot}/} -> $(readlink "${link}")"