[arch-commits] Commit in man-db/trunk (5 files)

Jan Steffens heftig at archlinux.org
Wed Jul 13 07:24:47 UTC 2016


    Date: Wednesday, July 13, 2016 @ 07:24:46
  Author: heftig
Revision: 271824

Return to hook + timer

Looking at the mandb code revealed that the culprit is gdbm_reorganize,
which is supposed to be run infrequently since it causes a sync. It is
run as part of purging.

Implement a compromise where entries are added to the cache by a hook
and the caches are kept clean by a daily purge.

Added:
  man-db/trunk/man-db.service
    (from rev 271821, man-db/trunk/man-db.service)
  man-db/trunk/man-db.timer
    (from rev 271821, man-db/trunk/man-db.timer)
Modified:
  man-db/trunk/PKGBUILD
  man-db/trunk/man-db.hook
Deleted:
  man-db/trunk/man-db-purge.hook

-------------------+
 PKGBUILD          |   19 +++++++++++--------
 man-db-purge.hook |    9 ---------
 man-db.hook       |    1 +
 man-db.service    |   12 ++++++++++++
 man-db.timer      |    7 +++++++
 5 files changed, 31 insertions(+), 17 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-07-13 06:54:23 UTC (rev 271823)
+++ PKGBUILD	2016-07-13 07:24:46 UTC (rev 271824)
@@ -4,7 +4,7 @@
 
 pkgname=man-db
 pkgver=2.7.5
-pkgrel=2
+pkgrel=3
 pkgdesc="A utility for reading man pages"
 arch=('i686' 'x86_64')
 url="http://www.nongnu.org/man-db/"
@@ -19,13 +19,13 @@
 install=${pkgname}.install
 source=(http://download-mirror.savannah.gnu.org/releases/man-db/$pkgname-$pkgver.tar.xz{,.sig}
         convert-mans
-        man-db.hook
-        man-db-purge.hook)
+        man-db.{hook,timer,service})
 md5sums=('37da0bb0400cc7b640f33c26f6052202'
          'SKIP'
          '2b7662a7d5b33fe91f9f3e034361a2f6'
-         '2fe885f9f5d2914b6c7f41b8fd9c4f2b'
-         '0a8b9e0f85692ca9133d707069ab9714')
+         '8124b2e7faa16994f39bd3018a13106a'
+         'b84cbe6de43a9f941bb1935d6858eca8'
+         '96bd8cfb3979aa024886f59012826d47')
 validpgpkeys=('AC0A4FF12611B6FCCF01C111393587D97D86500B') # Colin Watson <cjwatson at debian.org>
 
 prepare() {
@@ -64,7 +64,10 @@
   # http://www.linuxfromscratch.org/lfs/view/6.4/chapter06/man-db.html
   install -D -m755 ${srcdir}/convert-mans  ${pkgdir}/usr/bin/convert-mans
 
-  # install man-db update hooks
-  install -d ${pkgdir}/usr/share/libalpm/hooks
-  install -m644 ${srcdir}/*.hook ${pkgdir}/usr/share/libalpm/hooks/
+  # install man-db update timer
+  install -D -m644 ${srcdir}/man-db.hook ${pkgdir}/usr/share/libalpm/hooks/man-db.hook
+  install -D -m644 ${srcdir}/man-db.timer ${pkgdir}/usr/lib/systemd/system/man-db.timer
+  install -D -m644 ${srcdir}/man-db.service ${pkgdir}/usr/lib/systemd/system/man-db.service
+  install -d -m755 ${pkgdir}/usr/lib/systemd/system/multi-user.target.wants
+  ln -s ../man-db.timer ${pkgdir}//usr/lib/systemd/system/multi-user.target.wants/man-db.timer
 }

Deleted: man-db-purge.hook
===================================================================
--- man-db-purge.hook	2016-07-13 06:54:23 UTC (rev 271823)
+++ man-db-purge.hook	2016-07-13 07:24:46 UTC (rev 271824)
@@ -1,9 +0,0 @@
-[Trigger]
-Type = File
-Operation = Remove
-Target = usr/share/man/*
-
-[Action]
-Description = Purging old manpage index entries...
-When = PostTransaction
-Exec = /bin/sh -c 'mkdir -p /var/cache/man; exec mandb --quiet'

Modified: man-db.hook
===================================================================
--- man-db.hook	2016-07-13 06:54:23 UTC (rev 271823)
+++ man-db.hook	2016-07-13 07:24:46 UTC (rev 271824)
@@ -2,6 +2,7 @@
 Type = File
 Operation = Install
 Operation = Upgrade
+Operation = Remove
 Target = usr/share/man/*
 
 [Action]

Copied: man-db/trunk/man-db.service (from rev 271821, man-db/trunk/man-db.service)
===================================================================
--- man-db.service	                        (rev 0)
+++ man-db.service	2016-07-13 07:24:46 UTC (rev 271824)
@@ -0,0 +1,12 @@
+[Unit]
+Description=Update man-db cache
+RequiresMountsFor=/var/cache/man
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/mkdir -p /var/cache/man
+ExecStart=/usr/bin/mandb
+CPUSchedulingPolicy=batch
+Nice=19
+IOSchedulingClass=best-effort
+IOSchedulingPriority=7

Copied: man-db/trunk/man-db.timer (from rev 271821, man-db/trunk/man-db.timer)
===================================================================
--- man-db.timer	                        (rev 0)
+++ man-db.timer	2016-07-13 07:24:46 UTC (rev 271824)
@@ -0,0 +1,7 @@
+[Unit]
+Description=Daily man-db cache purge
+
+[Timer]
+OnCalendar=daily
+AccuracySec=1d
+Persistent=true



More information about the arch-commits mailing list