drop doc re-indexing cronjob and add a rpm-state dir for posttrans scripts (#870694)
parent
7eeada8624
commit
b2f2d6c05a
@ -1,41 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
if [ -e /etc/sysconfig/ghc-doc-index ]; then
|
||||
. /etc/sysconfig/ghc-doc-index
|
||||
fi
|
||||
|
||||
if [ "$CRON" = "no" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
LOCKFILE=/var/lock/ghc-doc-index.lock
|
||||
|
||||
# the lockfile is not meant to be perfect, it's just in case the
|
||||
# two cron scripts get run close to each other to keep
|
||||
# them from stepping on each other's toes.
|
||||
[ -f $LOCKFILE ] && exit 0
|
||||
|
||||
trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
|
||||
touch $LOCKFILE
|
||||
|
||||
PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache
|
||||
LISTING="env LANG=C ls -dl"
|
||||
|
||||
# only re-index ghc docs when there are changes
|
||||
cd /usr/share/doc/ghc/html/libraries
|
||||
if [ -r "$PKGDIRCACHE" ]; then
|
||||
$LISTING */ > $PKGDIRCACHE.new
|
||||
DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new)
|
||||
else
|
||||
$LISTING */ > $PKGDIRCACHE
|
||||
fi
|
||||
if [ -x "gen_contents_index" -a ! -r "$PKGDIRCACHE.new" -o -n "$DIR_DIFF" ]; then
|
||||
./gen_contents_index --batch
|
||||
fi
|
||||
|
||||
if [ -f $PKGDIRCACHE.new ]; then
|
||||
mv -f $PKGDIRCACHE{.new,}
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,20 +0,0 @@
|
||||
diff -u ghc-6.12.3/libraries/gen_contents_index gen_contents_index
|
||||
--- ghc-6.12.3/libraries/gen_contents_index 2010-11-05 10:28:02.000000000 +1000
|
||||
+++ gen_contents_index 2010-11-05 10:20:37.000000000 +1000
|
||||
@@ -22,5 +22,5 @@
|
||||
done
|
||||
;;
|
||||
-*)
|
||||
+--batch)
|
||||
HADDOCK=/usr/bin/haddock
|
||||
# We don't want the GHC API to swamp the index
|
||||
@@ -32,6 +32,9 @@
|
||||
HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG"
|
||||
done
|
||||
;;
|
||||
+*)
|
||||
+ HADDOCK=/bin/true
|
||||
+ tty -s && echo Run with '--batch' to index package haddock docs.
|
||||
esac
|
||||
|
||||
# Now create the combined contents and index pages
|
Loading…
Reference in new issue