Merged from trunk 6370:6371
authorFabian Groffen <grobian@gentoo.org>
Thu, 12 Apr 2007 10:42:57 +0000 (10:42 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 12 Apr 2007 10:42:57 +0000 (10:42 -0000)
   +------------------------------------------------------------------------+
   | 6371    | For bug #173808, add back the old heuristics to make sure    |
   | zmedico | that we don't just blindly compress the contents of any      |
   |         | directory named "man".                                       |
   +------------------------------------------------------------------------+

svn path=/main/branches/prefix/; revision=6378

bin/prepman

index 2f694ec26fce327bdb42a87a1a8f6b6295ebff7f..b7fbca937fd06808ec995f1bbe9df3d66769eb07 100755 (executable)
@@ -14,4 +14,15 @@ if [[ ! -d ${mandir} ]] ; then
        exit 0
 fi
 
-exec ecompressdir "${mandir#${ED}}"
+shopt -s nullglob
+
+really_is_mandir=0
+
+# use some heuristics to test if this is a real mandir
+for subdir in "${mandir}"/man* "${mandir}"/*/man* ; do
+       [[ -d ${subdir} ]] && really_is_mandir=1 && break
+done
+
+[[ ${really_is_mandir} == 1 ]] && exec ecompressdir "${mandir#${ED}}"
+
+exit 0