Only seed initial Debian package database if key file is available.
authorJonathan McDowell <noodles@earth.li>
Sun, 29 Sep 2013 20:30:06 +0000 (21:30 +0100)
committerJonathan McDowell <noodles@earth.li>
Sun, 29 Sep 2013 20:30:06 +0000 (21:30 +0100)
If the Debian package detected no keyring database on installation it
would seed the database with my key, from
/usr/share/doc/onak/noodles.key.gz. This is against Debian policy 12.3 -
packages cannot require files from /usr/share/doc/ to function. Only
seed the database if the file exists, avoiding issues installing when
skipping /usr/share/doc/

Fixes Debian bug #710665.

debian/changelog
debian/postinst

index 4b2b4109858b4f505ef85d4d35cf3ba49e8bf74d..c1a34eab2c3b37d56f9a92fcdd7b7a962aa7e440 100644 (file)
@@ -2,6 +2,7 @@ onak (0.4.1-1+bzr) unstable; urgency=low
 
   * Development build
   * Switch to source format 3.0 (quilt).
+  * Only seed initial database if key file is available. (Closes: #710665)
 
  -- Jonathan McDowell <noodles@earth.li>  Tue, 24 Apr 2012 21:54:17 -0700
 
index 5b29801b130a755874bbcaee82ce2765d59ebe40..b8fa63f5ec80dc5bffb5675ad548614db8e05d75 100644 (file)
@@ -13,7 +13,8 @@ if [ "$1" = "configure" ]; then
     #
     if grep -q "^db_dir /var/lib/onak" /etc/onak.conf &&
             grep -q "^db_backend db4" /etc/onak.conf &&
-            [ ! -e /var/lib/onak/num_keydb ]; then
+            [ ! -e /var/lib/onak/num_keydb -a \
+                -e /usr/share/doc/onak/noodles.key ]; then
         zcat /usr/share/doc/onak/noodles.key | onak -b add
     fi