]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - errors/alias-link.sh
Source Format Enforcement (#1234)
[thirdparty/squid.git] / errors / alias-link.sh
index 10d1c21ca97b079a9041b1060b179139b82a7e40..b96f633da79106311261bb445b88279ec6d577d5 100755 (executable)
@@ -1,4 +1,12 @@
 #!/bin/sh
+#
+## Copyright (C) 1996-2023 The Squid Software Foundation and contributors
+##
+## Squid software is distributed under GPLv2+ license and includes
+## contributions from numerous individuals and organizations.
+## Please see the COPYING and CONTRIBUTORS files for details.
+##
+
 #
 # Generate Symlinks for a set of aliases.
 # Our base content is the bundled .po translation output
@@ -28,10 +36,16 @@ while read base aliases; do
        if test "${base}" = "#" || test "${base}" = ""; then
                continue;
        fi
+       # ignore destination languages that do not exist. (no dead links)
+       if ! test -x ${DIR}/${base} ; then
+               echo "WARNING: ${base} translations do not exist. Nothing to do for: ${aliases}"
+               continue;
+       fi
+
        # split aliases based on whitespace and create a symlink for each
        # Remove and replace any pre-existing content/link
        for alia in ${aliases}; do
                ${RM} -f -r ${DIR}/${alia} || exit 1
-               ${LN} -s ${DIR}/${base} ${DIR}/${alia} || exit 1
+               ${LN} -s ${base} ${DIR}/${alia} || exit 1
        done
 done