summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-04-14 19:20:57 +0200
committerMichał Górny <mgorny@gentoo.org>2017-04-25 19:57:53 +0200
commit9433c94ae5befe90b431248ffcaf80d90195ccde (patch)
tree75541af8a567736e891f0cb8e9bda31846fcd45c /eclass
parentgnome2-utils.eclass: Remove GNOME2_ICONS conditional (moved to gnome2) (diff)
downloadgentoo-9433c94ae5befe90b431248ffcaf80d90195ccde.tar.gz
gentoo-9433c94ae5befe90b431248ffcaf80d90195ccde.tar.bz2
gentoo-9433c94ae5befe90b431248ffcaf80d90195ccde.zip
eutils.eclass: make_desktop_entry, replace unnecessary extglob
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.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/eutils.eclass4
1 files changed, 1 insertions, 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]