From 4e42f4a2e0d13eb2fe01b5c1aa984d2cde87a0c7 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Mon, 29 Jul 2013 10:18:52 +0200 Subject: [PATCH] hooks: do not update manual index cache if directory does not exist anymore otherwise we get this error: ls: cannot access /tmp/example-1.0/share/man/: No such file or directory updating manual index cache for /tmp/example-1.0/share/man .. --- hooks/mandb.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hooks/mandb.sh b/hooks/mandb.sh index ab09af8..5da562c 100644 --- a/hooks/mandb.sh +++ b/hooks/mandb.sh @@ -47,6 +47,10 @@ for man_dir in $(beeuniq ${man_dirs//:/ }) ; do case "${action}" in "post-remove"|"post-install") if grep -q "file=${man_dir}" ${content} ; then + if [ ! -d ${man_dir} ]; then + continue + fi + nfiles=$(ls ${man_dir}/ | head -2 | grep -c -v index.db) if [ "${nfiles}" -gt 0 ] ; then rm -f ${man_dir}/index.db