From 04dec3dc5e181da59f0541027741dbf10b02a4c2 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Dec 30 2010 02:06:23 +0000 Subject: move package cache file for doc cronjob to /var (#664850) Also cache long listing to notice library rebuilds. --- diff --git a/ghc-doc-index.cron b/ghc-doc-index.cron index b9c5b3c..9cf2888 100755 --- a/ghc-doc-index.cron +++ b/ghc-doc-index.cron @@ -12,28 +12,30 @@ fi LOCKFILE=/var/lock/ghc-doc-index.lock # the lockfile is not meant to be perfect, it's just in case the -# two man-db cron scripts get run close to each other to keep -# them from stepping on each other's toes. The worst that will -# happen is that they will temporarily corrupt the database +# 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 .pkg-dir.cache ]; then - ls -d */ > .pkg-dir.cache.new - DIR_DIFF=$(diff .pkg-dir.cache .pkg-dir.cache.new) +if [ -r "$PKGDIRCACHE" ]; then + $LISTING */ > $PKGDIRCACHE.new + DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new) else - ls -d */ > .pkg-dir.cache + $LISTING */ > $PKGDIRCACHE fi -if [ -x "gen_contents_index" -a ! -r ".pkg-dir.cache.new" -o -n "$DIR_DIFF" ]; then +if [ -x "gen_contents_index" -a ! -r "$PKGDIRCACHE.new" -o -n "$DIR_DIFF" ]; then ./gen_contents_index --batch fi -if [ -f .pkg-dir.cache.new ]; then - mv -f .pkg-dir.cache{.new,} +if [ -f $PKGDIRCACHE.new ]; then + mv -f $PKGDIRCACHE{.new,} fi exit 0 diff --git a/ghc.spec b/ghc.spec index f9c4497..7134c8c 100644 --- a/ghc.spec +++ b/ghc.spec @@ -26,9 +26,9 @@ %global debug_package %{nil} Name: ghc -# breaks haskell-platform-2010.2.0.0 +# haskell-platform-2011.1.0.0 Version: 7.0.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Glasgow Haskell Compilation system # fedora ghc has only been bootstrapped on the following archs: ExclusiveArch: %{ix86} x86_64 ppc alpha @@ -211,6 +211,7 @@ done %if %{with doc} mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.hourly install -p --mode=755 %SOURCE3 ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.hourly/ghc-doc-index +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/lib/ghc %endif %check @@ -291,6 +292,7 @@ fi %ghost %{ghcdocbasedir}/libraries/minus.gif %ghost %{ghcdocbasedir}/libraries/plus.gif %{_sysconfdir}/cron.hourly/ghc-doc-index +%{_localstatedir}/lib/ghc %endif %if %{with shared} @@ -304,6 +306,9 @@ fi %endif %changelog +* Thu Dec 30 2010 Jens Petersen - 7.0.1-3 +- store doc cronjob package cache file under /var (#664850) + * Wed Nov 24 2010 Jens Petersen - 7.0.1-2 - require libffi-devel