From e8d7f3d7bbfe82032d189459af8087f12ea8da4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= Date: Tue, 6 Mar 2018 18:22:39 +0100 Subject: [PATCH] gnome-shell-extensions.eselect: Do not call eval. * modules/gnome-shell-extensions.eselect: Inherit tests library. (has): Remove, it is inherited from tests now. (gse_read_available, gse_write_config_file): Do not call eval, fixes bug #643498. (VERSION): Update. Remove SVN keywords. --- modules/gnome-shell-extensions.eselect | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/modules/gnome-shell-extensions.eselect b/modules/gnome-shell-extensions.eselect index 788b459..fe9af12 100644 --- a/modules/gnome-shell-extensions.eselect +++ b/modules/gnome-shell-extensions.eselect @@ -1,13 +1,13 @@ # -*-eselect-*- vim: ft=eselect -# Copyright 2009-2011 Gentoo Foundation +# Copyright 2009-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 or later -# $Id: $ + +inherit tests DESCRIPTION="Manage default settings for systemwide GNOME Shell extensions" AUTHOR="tetromino@gentoo.org" MAINTAINER="gnome@gentoo.org" -SVN_DATE='$Date: 2012/09/11 15:00:00 -0400 $' -VERSION=$(svn_date_to_version "${SVN_DATE}") +VERSION="20180306" # # Basic idea: eselect manages a gschema override file located in @@ -53,18 +53,6 @@ gse_prepare() { fi } -has() { - # Copied from portage's isolated-functions.sh - local needle=$1 - shift - - local x - for x in "$@"; do - [[ "${x}" = "${needle}" ]] && return 0 - done - return 1 -} - gse_print_warnings() { local n @@ -113,7 +101,8 @@ gse_read_available() { done # Sort $available if [[ -n "${available[@]}" ]]; then - eval available=( $(printf '%q\n' "${available[@]}" | sort ) ) + local IFS=$'\n' + available=( $(echo "${available[*]}" | sort ) ) fi } @@ -121,7 +110,9 @@ gse_write_config_file() { local f="${ETCDIR}/${CONFIG_FILE}" # Sort and uniquefy $enabled - eval enabled_saved=( $(printf '%q\n' "${enabled[@]}" | sort -u ) ) + local ifs_save=${IFS} IFS=$'\n' + enabled_saved=( $(echo "${enabled[*]}" | sort -u ) ) + IFS=${ifs_save} if [[ -e "${f}" ]]; then [[ -f "${f}" && -w "${f}" ]] || gse_die "${f} is not writable" -- 2.16.2