From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 28801139694 for ; Fri, 14 Apr 2017 17:26:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EF939E0D24; Fri, 14 Apr 2017 17:25:50 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A8560E0CB9 for ; Fri, 14 Apr 2017 17:25:50 +0000 (UTC) Received: from localhost.localdomain (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 9D0BF33D3CE; Fri, 14 Apr 2017 17:25:48 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] eutils.eclass: make_desktop_entry, replace unnecessary extglob Date: Fri, 14 Apr 2017 19:25:42 +0200 Message-Id: <20170414172542.11203-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.12.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 69102c0f-222b-4056-955a-2336e80a0169 X-Archives-Hash: ec7795e3744255de0c001e1633b68c58 Replace the unnecessary use of extglob to strip file suffix in make_desktop_entry with a plain ${x%.*}. This is pretty much equivalent since match to one of the pre-defined suffixes is already confirmed via the preceding conditional, and avoiding repeating the suffix list twice makes the code simpler. --- eclass/eutils.eclass | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index ea2a76200f09..e66b40424234 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -275,13 +275,11 @@ make_desktop_entry() { # Don't append another ";" when a valid category value is provided. type=${type%;}${type:+;} - eshopts_push -s extglob if [[ -n ${icon} && ${icon} != /* ]] && [[ ${icon} == *.xpm || ${icon} == *.png || ${icon} == *.svg ]]; then ewarn "As described in the Icon Theme Specification, icon file extensions are not" ewarn "allowed in .desktop files if the value is not an absolute path." - icon=${icon%.@(xpm|png|svg)} + icon=${icon%.*} fi - eshopts_pop cat <<-EOF > "${desktop}" [Desktop Entry] -- 2.12.2