blob: 269640f1d14de04bc84bf68c2eaf556bf352d112 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# $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
|