X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FDEBORPHAN%2F10-whitelist;h=4a7d8079d9559e7a22f9caeea8a559fddabc0fcd;hp=3fe7320b0da8fdf38d4e94901868f01250d83518;hb=HEAD;hpb=87be754bbc69222433296d24abd408db0f208f91 diff --git a/etc/grml/fai/config/scripts/DEBORPHAN/10-whitelist b/etc/grml/fai/config/scripts/DEBORPHAN/10-whitelist index 3fe7320..ec97fc4 100755 --- a/etc/grml/fai/config/scripts/DEBORPHAN/10-whitelist +++ b/etc/grml/fai/config/scripts/DEBORPHAN/10-whitelist @@ -13,7 +13,28 @@ 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") + if ! [ -f "${target}"/var/lib/deborphan/keep ] ; then + printf 'dnsutils\n' > "${target}"/var/lib/deborphan/keep + elif grep -q '^dnsutils$' "${target}"/var/lib/deborphan/keep ; then + : # entry already present, avoid duplicates + else + printf 'dnsutils\n' >> "${target}"/var/lib/deborphan/keep + fi +fi + +# workaround for bsdmainutils transitional package, we can drop this as soon as the +# bsdextrautils + ncal packages are available in all our supported Debian releases +if [[ -r "${target}/usr/share/doc/bsdmainutils" ]] && [ -x "${target}/usr/bin/deborphan" ] ; then + echo "Adding bsdmainutils to deborphan whitelist" + # workaround for https://bugs.debian.org/929273 ("fseek on /var/lib/deborphan/keep: Invalid argument") + if ! [ -f "${target}"/var/lib/deborphan/keep ] ; then + printf 'bsdmainutils\n' > "${target}"/var/lib/deborphan/keep + elif grep -q '^bsdmainutils$' "${target}"/var/lib/deborphan/keep ; then + : # entry already present, avoid duplicates + else + printf 'bsdmainutils\n' >> "${target}"/var/lib/deborphan/keep + fi fi ## END OF FILE #################################################################