commit:     69bb5c568747742622d813d1a6403f7c01dcde20
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  6 17:22:39 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Mar  6 17:22:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=69bb5c56

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.

 ChangeLog                              |  8 ++++++++
 modules/gnome-shell-extensions.eselect | 27 +++++++++------------------
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d8a4855..6de155b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-03-06  Ulrich Müller  <u...@gentoo.org>
+
+       * 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.
+
 2014-11-22 Ben de Groot <yng...@gentoo.org>
 
        * modules/vi.eselect: apply patch from 1.1.7-r1

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="tetrom...@gentoo.org"
 MAINTAINER="gn...@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"

Reply via email to