diff options
author | matusita <matusita@FreeBSD.org> | 2004-03-27 13:11:21 +0800 |
---|---|---|
committer | matusita <matusita@FreeBSD.org> | 2004-03-27 13:11:21 +0800 |
commit | a748f2d065600df571bcc786ce09614cda5911d4 (patch) | |
tree | 8a8ca500522d5f18b9684cfa9616f966d25f67e9 /mail | |
parent | a556738d17fbb7d1fad58414ea845c9f54c14384 (diff) | |
download | freebsd-ports-gnome-a748f2d065600df571bcc786ce09614cda5911d4.tar.gz freebsd-ports-gnome-a748f2d065600df571bcc786ce09614cda5911d4.tar.zst freebsd-ports-gnome-a748f2d065600df571bcc786ce09614cda5911d4.zip |
New features to popfile.sh startup script, including:
- The default working directory can be tweaked by user; if
POPFILE_USER variable is defined before, use it simply.
- If POPFILE_USER variable is not defined, the script default
is either ${HOME}/.popfile (old default) or /var/db/popfile
if ${HOME} variable is not defined or defined as null string.
- If ${POPFILE_USER} directory cannot be made, exit with error.
Most casual users shouldn't affect this change, however, the script
itself is changed, so bump PORTREVISION.
Inspired from: http://home.jp.freebsd.org/cgi-bin/showmail/ports-jp/14635
(in Japanese)
Diffstat (limited to 'mail')
-rw-r--r-- | mail/popfile/Makefile | 2 | ||||
-rw-r--r-- | mail/popfile/files/popfile.sh | 19 |
2 files changed, 18 insertions, 3 deletions
diff --git a/mail/popfile/Makefile b/mail/popfile/Makefile index 2ddca2cdbbee..3b9489c1142c 100644 --- a/mail/popfile/Makefile +++ b/mail/popfile/Makefile @@ -7,7 +7,7 @@ PORTNAME= popfile PORTVERSION= 0.21.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/mail/popfile/files/popfile.sh b/mail/popfile/files/popfile.sh index ad7345fd456c..21caf2b8fe51 100644 --- a/mail/popfile/files/popfile.sh +++ b/mail/popfile/files/popfile.sh @@ -2,9 +2,24 @@ # # $FreeBSD$ # +case "${HOME}" in +"") + export POPFILE_USER_DEFAULT=/var/db/popfile + ;; +*) + export POPFILE_USER_DEFAULT=${HOME}/.popfile + ;; +esac + +die() +{ + echo "$1" + exit 1 +} + export POPFILE_ROOT=%%DATADIR%% -export POPFILE_USER=${HOME}/.popfile +export POPFILE_USER=${POPFILE_USER:-${POPFILE_USER_DEFAULT}} -mkdir -p ${POPFILE_USER} +mkdir -p ${POPFILE_USER} || die "mkdir ${POPFILE_USER} failed" cd ${POPFILE_USER} %%DATADIR%%/popfile.pl >/dev/null 2>&1 & |