From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Si7gK-000364-3k for garchives@archives.gentoo.org; Fri, 22 Jun 2012 17:30:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0F36BE0942; Fri, 22 Jun 2012 17:29:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C559FE0942 for ; Fri, 22 Jun 2012 17:29:26 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 661321B400B for ; Fri, 22 Jun 2012 17:29:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D275BE543C for ; Fri, 22 Jun 2012 17:29:23 +0000 (UTC) From: "Ulrich Mueller" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Mueller" Message-ID: <1182520436.6ad92f033249d0563fe44657d04a5a6b82439c55.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:eselect-emacs-1.1 commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog emacs.eselect X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Mueller X-VCS-Revision: 6ad92f033249d0563fe44657d04a5a6b82439c55 X-VCS-Branch: eselect-emacs-1.1 Date: Fri, 22 Jun 2012 17:29:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 7fb21a18-ec89-434a-9091-bc17cd2131d2 X-Archives-Hash: 28a98e7f2553f9aa488383dcef9066e6 commit: 6ad92f033249d0563fe44657d04a5a6b82439c55 Author: Ulrich M=C3=BCller gentoo org> AuthorDate: Fri Jun 22 13:53:56 2007 +0000 Commit: Ulrich Mueller gentoo org> CommitDate: Fri Jun 22 13:53:56 2007 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/emacs-tools.g= it;a=3Dcommit;h=3D6ad92f03 Test for number of parameters. Quote variables correctly. svn path=3D/emacs-extra/eselect-emacs/; revision=3D448 --- ChangeLog | 5 +++++ emacs.eselect | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b64ef9a..6ef0d99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-22 Ulrich Mueller + + * emacs.eselect (do_show, do_list, do_set, do_update): Test for + number of parameters. Quote variables correctly. + 2007-06-17 Ulrich Mueller =20 * version 1.0 diff --git a/emacs.eselect b/emacs.eselect index ab413d0..895368c 100644 --- a/emacs.eselect +++ b/emacs.eselect @@ -145,13 +145,13 @@ describe_show() { } =20 do_show() { - [[ -z "${@}" ]] || die -q "Too many parameters" + [[ ${#@} -gt 0 ]] && die -q "Too many parameters" =20 write_list_start "Current target of GNU Emacs symlink:" if [[ -L "${ROOT}/usr/bin/emacs" && \ -e $(canonicalise "${ROOT}/usr/bin/emacs") ]]; then write_kv_list_entry \ - "$(basename $(canonicalise ${ROOT}/usr/bin/emacs) )" "" + $(basename $(canonicalise "${ROOT}/usr/bin/emacs") ) "" elif [[ -e "${ROOT}/usr/bin/emacs" ]]; then write_kv_list_entry \ "(not a symlink or target of symlink does not exist)" "" @@ -168,7 +168,7 @@ describe_list() { } =20 do_list() { - [[ -z "${@}" ]] || die -q "Too many parameters" + [[ ${#@} -gt 0 ]] && die -q "Too many parameters" =20 local i targets targets=3D( $(find_targets) ) @@ -204,7 +204,7 @@ describe_set_parameters() { =20 do_set() { [[ -z "${1}" ]] && die -q "You didn't tell me what to set the symlink t= o" - [[ -n "${2}" ]] && die -q "Too many parameters" + [[ ${#@} -gt 1 ]] && die -q "Too many parameters" test_for_root =20 if [[ -e "${ROOT}/usr/bin/emacs" ]] \ @@ -226,13 +226,13 @@ describe_update_options() { } =20 do_update() { - [[ -z "${1}" || ( -z "${2}" && "${1}" =3D=3D "--if-unset" ) ]] \ - || die -q "Usage error" + [[ -z "${1}" || "${1}" =3D=3D "--if-unset" ]] || die -q "Usage error" + [[ ${#@} -gt 1 ]] && die -q "Too many parameters" test_for_root =20 if [[ -L "${ROOT}/usr/bin/emacs" ]]; then [[ ${1} =3D=3D "--if-unset" \ - && -e "$(canonicalise ${ROOT}/usr/bin/emacs)" ]] && return + && -e $(canonicalise "${ROOT}/usr/bin/emacs") ]] && return # this is not redundant: "update" is called in pkg_postrm() of emacs # and should clean up any dead symlinks if no valid target exists remove_symlinks || die -q "Couldn't remove existing symlink"