1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-10 02:45:11 +00:00
freebsd-ports/Keywords/shell.ucl
Alex Kozlov 6107ede2ac - Accept absolute path for @fc, @fontsdir, @fcfontsdir, @shell keywords
Approved by:	portmgr (antoine, bapt)
Differential Revision:	https://reviews.freebsd.org/D721
2014-10-08 21:39:47 +00:00

33 lines
928 B
Plaintext

# $FreeBSD$
#
# MAINTAINER: portmgr@FreeBSD.org
#
# @shell bin/shell
#
# Handle adding and remove a path to a shell binary into /etc/shells
# it replaces the following code:
#
# bin/shell
# @exec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak
# @unexec echo "Updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak
actions: [file]
post-install: <<EOD
case "%@" in
/*) file="%@" ;;
*) file="%D/%@" ;;
esac
cp /etc/shells /etc/shells.bak
(grep -v ${file} /etc/shells.bak; echo ${file}) > /etc/shells
rm -f /etc/shells.bak
EOD
pre-deinstall: <<EOD
case "%@" in
/*) file="%@" ;;
*) file="%D/%@" ;;
esac
cp /etc/shells /etc/shells.bak
grep -v ${file} /etc/shells.bak > /etc/shells
rm -f /etc/shells.bak
EOD