# $FreeBSD: Keywords/info.yaml 334652 2013-11-23 09:48:42Z bapt $
#
# MAINTAINER: portmgr@FreeBSD.org

actions: [file]
post-install: |
  file=%D/%@
  install-info --quiet %D/%@ %D/info/dir
post-deinstall: |
  file=%D/%@
  install-info --quiet --delete %D/%@ %D/info/dir
  if [ $(info -d ${file%/*}  --output - 2>/dev/null | grep -c '^*') -eq 1 ]; then
    rm -f ${file%/*}/dir
  fi
  if [ ${file%/*} != "%D/info" ]; then
     rmdir ${file%/*} 2> /dev/null || true
  fi
