From e6ef6218da0ac5dc3bc0a9a00c577a4aad31623d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Wed, 1 Jul 2015 17:14:06 +0900 Subject: [PATCH] Add validation script for broken symlinks Change-Id: Iae6d9f26e1a8dd7d565e9dbd815816c26cb92b74 Partially-implements: blueprint add-broken-symlink-check --- tools/validate-links.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 tools/validate-links.sh diff --git a/tools/validate-links.sh b/tools/validate-links.sh new file mode 100755 index 0000000000..d9415f8a74 --- /dev/null +++ b/tools/validate-links.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')") +cd "$(dirname "$REAL_PATH")/.." + +echo "Checking for broken links" +if find . -type l -exec test ! -e {} \; -print | egrep '.*'; then + exit 1 +fi