From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IiZ5c-0006V1-Mp for garchives@archives.gentoo.org; Thu, 18 Oct 2007 17:23:21 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9IHCp6f028180; Thu, 18 Oct 2007 17:12:51 GMT Received: from castor.sshunet.nl (castor.sshunet.nl [145.97.192.41]) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l9IHCplc028175 for ; Thu, 18 Oct 2007 17:12:51 GMT Received: from localhost (localhost.localdomain [127.0.0.1]) by castor.sshunet.nl (Postfix) with ESMTP id 5415E57C019 for ; Thu, 18 Oct 2007 19:12:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at castor.sshunet.nl Received: from castor.sshunet.nl ([127.0.0.1]) by localhost (castor.sshunet.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GZQtM8dGGfPv for ; Thu, 18 Oct 2007 19:12:51 +0200 (CEST) Received: from [145.97.222.45] (45pc222.sshunet.nl [145.97.222.45]) by castor.sshunet.nl (Postfix) with ESMTP for ; Thu, 18 Oct 2007 19:12:51 +0200 (CEST) Message-ID: <471794CC.1000104@gentoo.org> Date: Thu, 18 Oct 2007 19:15:56 +0200 From: "Marijn Schouten (hkBst)" User-Agent: Thunderbird 2.0.0.6 (X11/20070802) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Lisp mail X-BeenThere: gentoo-lisp@gentoo.org MIME-Version: 1.0 To: gentoo-lisp@lists.gentoo.org Subject: Re: [gentoo-lisp] common-lisp.eclass cleanup References: <20071012213031.GA710952@universe.org> <20071015104532.2d8464ac@gentoo.org> <20071015222846.GA124069@universe.org> <47149ABC.1000408@gentoo.org> <20071018144607.GB1097429@universe.org> In-Reply-To: <20071018144607.GB1097429@universe.org> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: dbd407dc-921c-45cc-92fa-42bf7bc7b660 X-Archives-Hash: 89bbadc9a02cf129b3eb297092f9aa1f -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stelian Ionescu wrote: >> common-lisp-system-symlink() { >> dodir "${CLSYSTEMROOT}" >> # if no arguments received, default to >> # the contents of ${CLSYSTEMS} >> if [ $# -eq 0 ]; then >> for package in ${CLSYSTEMS} ; do >> common-lisp-install-single-system "${package}" >> done >> else >> local _oldclpackage="${CLPACKAGE}" >> [ "${1}" == "-p" ] && { CLPACKAGE="${2}" ; shift ; shift ; } >> <-- what's the point of setting CLPACKAGE here? I'm not sure I like >> influencing common-lisp-install-single-system in that way. --> >> [ $# -eq 0 ] && die "common-lisp-system-symlink needs more arguments" >> for package in "$@" ; do >> common-lisp-install-single-system "${package}" >> done >> CLPACKAGE="${_oldclpackage}" >> fi >> } > > setting CLPACKAGE that way is the equivalent of this: > > (defun common-lisp-system-symlink (system &key (package *clpackage*)) > (let ((*clpackage* package)) ...)) > > I'm faking default arguments: when $1 is "-p" CLPACKAGE gets set > temporarily to $2, then restored to its initial value. I've seen this > idiom elsewhere in sh code > anyway, I've removed this since it's unnecessary I'm glad to see it go. I've added the following proposed replacement to the eclass. The underscore will prevent it from being used right away: # if no arguments received, default to the contents of ${CLSYSTEMS} _common-lisp-system-symlink() { dodir "${CLSYSTEMROOT}" for package in $([[ $# = 0 ]] && echo ${CLSYSTEMS} || echo "$@") ; do common-lisp-install-single-system "${package}" done } Please test it. Marijn - -- Marijn Schouten (hkBst), Gentoo Lisp project , #gentoo-lisp on FreeNode -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHF5TMp/VmCx0OL2wRAj4QAJ9S01YNwip2pDs8FF8rDrmkHqb5LwCeMPj1 tsXPUTOAvmz1dURd8LcY0Y4= =Tebj -----END PGP SIGNATURE----- -- gentoo-lisp@gentoo.org mailing list