diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-08-09 16:38:38 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-08-15 09:30:58 +0200 |
commit | e39f6eadc4689518133b7afd5ca995260ac9a414 (patch) | |
tree | 1515b587c1a71cd5a2ff63fb5308126542e23226 /www-apps/postfixadmin | |
parent | sys-apps/openrc: Replace path_exists with inline bash test (diff) | |
download | gentoo-e39f6eadc4689518133b7afd5ca995260ac9a414.tar.gz gentoo-e39f6eadc4689518133b7afd5ca995260ac9a414.tar.bz2 gentoo-e39f6eadc4689518133b7afd5ca995260ac9a414.zip |
www-apps/postfixadmin: Replace path_exists with inline logic
Replace the call to path_exists with local filename expansion. While
at it, also kill the ugly ls-abuse in favor of using the results
of earlier expansion.
Diffstat (limited to 'www-apps/postfixadmin')
-rw-r--r-- | www-apps/postfixadmin/postfixadmin-3.1.ebuild | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/www-apps/postfixadmin/postfixadmin-3.1.ebuild b/www-apps/postfixadmin/postfixadmin-3.1.ebuild index 3e69bc6b6573..5cb58aab877a 100644 --- a/www-apps/postfixadmin/postfixadmin-3.1.ebuild +++ b/www-apps/postfixadmin/postfixadmin-3.1.ebuild @@ -3,7 +3,7 @@ EAPI="6" -inherit eutils user webapp +inherit user webapp DESCRIPTION="Web Based Management tool for Postfix style virtual domains and users" HOMEPAGE="http://postfixadmin.sourceforge.net" @@ -89,10 +89,12 @@ pkg_postinst() { pkg_postrm() { # Make sure we don't leave broken vacation.pl symlink find -L "${ROOT}"/var/spool/vacation/ -type l -delete - if [[ ! -e "${ROOT}"/var/spool/vacation/vacation.pl ]] && - path_exists "${ROOT}"/var/spool/vacation/vacation.pl-*; then - ln -s $(LC_ALL=C ls -1 /var/spool/vacation/vacation.pl-* | tail -n1) \ - "${ROOT}"/var/spool/vacation/vacation.pl || die + local shopt_save=$(shopt -p nullglob) + shopt -s nullglob + local vacation=( "${ROOT}"/var/spool/vacation/vacation.pl-* ) + ${shopt_save} + if [[ ! -e "${ROOT}"/var/spool/vacation/vacation.pl && -n ${vacation[@]} ]]; then + ln -s "${vacation[-1]}" "${ROOT}"/var/spool/vacation/vacation.pl || die ewarn "/var/spool/vacation/vacation.pl was updated to point on most" ewarn "recent verion, but please, do your own checks" fi |