DEBORPHAN/10-whitelist: provide workaround for Debian bug #929273
authorMichael Prokop <mika@grml.org>
Wed, 20 May 2020 13:25:25 +0000 (15:25 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 20 May 2020 13:30:31 +0000 (15:30 +0200)
If deborphan's keep file doesn't exist yet, it fails with:

| fseek on /var/lib/deborphan/keep: Invalid argument

While at it, no longer ignore failing deborphan execution
but error out on failure.

etc/grml/fai/config/scripts/DEBORPHAN/10-whitelist

index 3fe7320..0c145f7 100755 (executable)
@@ -13,7 +13,9 @@ set -e
 # bind9-dnsutils package is available in all our supported Debian releases
 if [[ -r "${target}/usr/share/doc/dnsutils" ]] && [ -x "${target}/usr/bin/deborphan" ] ; then
   echo "Adding dnsutils to deborphan whitelist"
-  $ROOTCMD deborphan --add-keep dnsutils || /bin/true
+  # workaround for https://bugs.debian.org/929273 ("fseek on /var/lib/deborphan/keep: Invalid argument")
+  $ROOTCMD touch /var/lib/deborphan/keep
+  $ROOTCMD deborphan --add-keep dnsutils
 fi
 
 ## END OF FILE #################################################################