public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH] eutils.eclass: make_desktop_entry, replace unnecessary extglob
Date: Fri, 14 Apr 2017 19:25:42 +0200	[thread overview]
Message-ID: <20170414172542.11203-1-mgorny@gentoo.org> (raw)

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



             reply	other threads:[~2017-04-14 17:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14 17:25 Michał Górny [this message]
2017-04-25 18:45 ` [gentoo-dev] [PATCH] eutils.eclass: make_desktop_entry, replace unnecessary extglob Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170414172542.11203-1-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox