mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-04 01:48:54 +00:00
29 lines
742 B
Plaintext
29 lines
742 B
Plaintext
# $FreeBSD$
|
|
#
|
|
# MAINTAINER: portmgr@FreeBSD.org
|
|
#
|
|
# @shell bin/shell
|
|
#
|
|
# Handle adding and remove a path to a shell binary into /etc/shells
|
|
#
|
|
|
|
actions: [file]
|
|
post-install: <<EOD
|
|
case "%@" in
|
|
/*) file="%@" ;;
|
|
*) file="%D/%@" ;;
|
|
esac
|
|
cp ${PKG_ROOTDIR}/etc/shells ${PKG_ROOTDIR}/etc/shells.bak
|
|
(grep -v "^${file}$" ${PKG_ROOTDIR}/etc/shells.bak; echo ${file}) > ${PKG_ROOTDIR}/etc/shells
|
|
rm -f ${PKG_ROOTDIR}/etc/shells.bak
|
|
EOD
|
|
pre-deinstall: <<EOD
|
|
case "%@" in
|
|
/*) file="%@" ;;
|
|
*) file="%D/%@" ;;
|
|
esac
|
|
cp ${PKG_ROOTDIR}/etc/shells ${PKG_ROOTDIR}/etc/shells.bak
|
|
grep -v "^${file}$" ${PKG_ROOTDIR}/etc/shells.bak > ${PKG_ROOTDIR}/etc/shells
|
|
rm -f ${PKG_ROOTDIR}/etc/shells.bak
|
|
EOD
|