move package cache file for doc cronjob to /var (#664850)

Also cache long listing to notice library rebuilds.
This commit is contained in:
Jens Petersen 2010-12-30 11:06:23 +09:00
parent 9556d647dd
commit 04dec3dc5e
2 changed files with 19 additions and 12 deletions

View File

@ -12,28 +12,30 @@ fi
LOCKFILE=/var/lock/ghc-doc-index.lock LOCKFILE=/var/lock/ghc-doc-index.lock
# the lockfile is not meant to be perfect, it's just in case the # 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 # two cron scripts get run close to each other to keep
# them from stepping on each other's toes. The worst that will # them from stepping on each other's toes.
# happen is that they will temporarily corrupt the database
[ -f $LOCKFILE ] && exit 0 [ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
touch $LOCKFILE touch $LOCKFILE
PKGDIRCACHE=/var/lib/ghc/pkg-dir.cache
LISTING="env LANG=C ls -dl"
# only re-index ghc docs when there are changes # only re-index ghc docs when there are changes
cd /usr/share/doc/ghc/html/libraries cd /usr/share/doc/ghc/html/libraries
if [ -r .pkg-dir.cache ]; then if [ -r "$PKGDIRCACHE" ]; then
ls -d */ > .pkg-dir.cache.new $LISTING */ > $PKGDIRCACHE.new
DIR_DIFF=$(diff .pkg-dir.cache .pkg-dir.cache.new) DIR_DIFF=$(diff $PKGDIRCACHE $PKGDIRCACHE.new)
else else
ls -d */ > .pkg-dir.cache $LISTING */ > $PKGDIRCACHE
fi 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 ./gen_contents_index --batch
fi fi
if [ -f .pkg-dir.cache.new ]; then if [ -f $PKGDIRCACHE.new ]; then
mv -f .pkg-dir.cache{.new,} mv -f $PKGDIRCACHE{.new,}
fi fi
exit 0 exit 0

View File

@ -26,9 +26,9 @@
%global debug_package %{nil} %global debug_package %{nil}
Name: ghc Name: ghc
# breaks haskell-platform-2010.2.0.0 # haskell-platform-2011.1.0.0
Version: 7.0.1 Version: 7.0.1
Release: 2%{?dist} Release: 3%{?dist}
Summary: Glasgow Haskell Compilation system Summary: Glasgow Haskell Compilation system
# fedora ghc has only been bootstrapped on the following archs: # fedora ghc has only been bootstrapped on the following archs:
ExclusiveArch: %{ix86} x86_64 ppc alpha ExclusiveArch: %{ix86} x86_64 ppc alpha
@ -211,6 +211,7 @@ done
%if %{with doc} %if %{with doc}
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.hourly mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.hourly
install -p --mode=755 %SOURCE3 ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.hourly/ghc-doc-index install -p --mode=755 %SOURCE3 ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.hourly/ghc-doc-index
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/lib/ghc
%endif %endif
%check %check
@ -291,6 +292,7 @@ fi
%ghost %{ghcdocbasedir}/libraries/minus.gif %ghost %{ghcdocbasedir}/libraries/minus.gif
%ghost %{ghcdocbasedir}/libraries/plus.gif %ghost %{ghcdocbasedir}/libraries/plus.gif
%{_sysconfdir}/cron.hourly/ghc-doc-index %{_sysconfdir}/cron.hourly/ghc-doc-index
%{_localstatedir}/lib/ghc
%endif %endif
%if %{with shared} %if %{with shared}
@ -304,6 +306,9 @@ fi
%endif %endif
%changelog %changelog
* Thu Dec 30 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-3
- store doc cronjob package cache file under /var (#664850)
* Wed Nov 24 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-2 * Wed Nov 24 2010 Jens Petersen <petersen@redhat.com> - 7.0.1-2
- require libffi-devel - require libffi-devel