From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1041867-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B0F8E138335 for <garchives@archives.gentoo.org>; Wed, 15 Aug 2018 07:31:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A4318E0934; Wed, 15 Aug 2018 07:31:12 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 76CEBE0934 for <gentoo-commits@lists.gentoo.org>; Wed, 15 Aug 2018 07:31:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BA632335CD1 for <gentoo-commits@lists.gentoo.org>; Wed, 15 Aug 2018 07:31:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1F96A3AA for <gentoo-commits@lists.gentoo.org>; Wed, 15 Aug 2018 07:31:07 +0000 (UTC) From: "Michał Górny" <mgorny@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org> Message-ID: <1534318258.e39f6eadc4689518133b7afd5ca995260ac9a414.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/postfixadmin/ X-VCS-Repository: repo/gentoo X-VCS-Files: www-apps/postfixadmin/postfixadmin-3.1.ebuild X-VCS-Directories: www-apps/postfixadmin/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: e39f6eadc4689518133b7afd5ca995260ac9a414 X-VCS-Branch: master Date: Wed, 15 Aug 2018 07:31:07 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 61dbfa8d-01b1-4ff5-ade1-88b7b9ae80a2 X-Archives-Hash: 47805b12ed33b2d8962abfe11eb77630 commit: e39f6eadc4689518133b7afd5ca995260ac9a414 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Thu Aug 9 14:38:38 2018 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Wed Aug 15 07:30:58 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e39f6ead 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. www-apps/postfixadmin/postfixadmin-3.1.ebuild | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/www-apps/postfixadmin/postfixadmin-3.1.ebuild b/www-apps/postfixadmin/postfixadmin-3.1.ebuild index 3e69bc6b657..5cb58aab877 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