pkgsrc/mk/haskell/DEINSTALL.in
pho 6bb80a54ac Infrastructure improvements and bugfixes to mk/haskell.mk
* mk/haskell.mk no longer set USE_TOOLS+=pkg-config for all the packages
  that include it. Instead it does TOOLS_FAIL+=pkg-config unless they
  explicitly do USE_TOOLS.

* Fixed an issue regarding Template Haskell and our wrappers.

* Fixed an issue where packages that had things like PLIST.common but
  lacked PLIST were incorrectly considered to have no PLISTs.

* mk/haskell.mk now supports packages that contain more than a single
  library. The INSTALL and DEINSTALL scripts can now handle such packages
  properly.
2022-02-11 01:11:57 +00:00

26 lines
952 B
Bash

# -*- sh -*-
# $NetBSD: DEINSTALL.in,v 1.3 2022/02/11 01:11:57 pho Exp $
#
HASKELL_PKG_BIN="@HASKELL_PKG_BIN@"
HASKELL_PKG_ID_FILE="@HASKELL_PKG_ID_FILE@"
AWK="@AWK@"
WC="@WC@"
case ${STAGE} in
DEINSTALL)
if [ -f "${HASKELL_PKG_ID_FILE}" ]; then
# The package contains one or more libraries. The order of
# unregistration is important here; libraries with higher
# indices may depend on those with lower ones so we need to
# unregister them in the reverse order.
${AWK} 'BEGIN { i = 0 }
{ lines[i++] = $0 }
END { for (j=i-1; j>=0; )
print lines[j--] }' "${HASKELL_PKG_ID_FILE}" |
while read pkg_id; do
${ECHO} "Unregistering \`$pkg_id'..."
${HASKELL_PKG_BIN} unregister --force --ipid "$pkg_id"
done
fi
;;
esac