public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] eutils.eclass: make_desktop_entry, replace unnecessary extglob
@ 2017-04-14 17:25 Michał Górny
  2017-04-25 18:45 ` Michał Górny
  0 siblings, 1 reply; 2+ messages in thread
From: Michał Górny @ 2017-04-14 17:25 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] [PATCH] eutils.eclass: make_desktop_entry, replace unnecessary extglob
  2017-04-14 17:25 [gentoo-dev] [PATCH] eutils.eclass: make_desktop_entry, replace unnecessary extglob Michał Górny
@ 2017-04-25 18:45 ` Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2017-04-25 18:45 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 526 bytes --]

On pią, 2017-04-14 at 19:25 +0200, Michał Górny wrote:
> 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(-)
> 

Merged now.

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-25 18:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-14 17:25 [gentoo-dev] [PATCH] eutils.eclass: make_desktop_entry, replace unnecessary extglob Michał Górny
2017-04-25 18:45 ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox