Gentoo Archives: gentoo-lisp

From: "Marijn Schouten (hkBst)" <hkBst@g.o>
To: gentoo-lisp@l.g.o
Subject: Re: [gentoo-lisp] common-lisp.eclass cleanup
Date: Thu, 18 Oct 2007 17:23:21
Message-Id: 471794CC.1000104@gentoo.org
In Reply to: Re: [gentoo-lisp] common-lisp.eclass cleanup by Stelian Ionescu
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Stelian Ionescu wrote:
5 >> common-lisp-system-symlink() {
6 >> dodir "${CLSYSTEMROOT}"
7 >> # if no arguments received, default to
8 >> # the contents of ${CLSYSTEMS}
9 >> if [ $# -eq 0 ]; then
10 >> for package in ${CLSYSTEMS} ; do
11 >> common-lisp-install-single-system "${package}"
12 >> done
13 >> else
14 >> local _oldclpackage="${CLPACKAGE}"
15 >> [ "${1}" == "-p" ] && { CLPACKAGE="${2}" ; shift ; shift ; }
16 >> <-- what's the point of setting CLPACKAGE here? I'm not sure I like
17 >> influencing common-lisp-install-single-system in that way. -->
18 >> [ $# -eq 0 ] && die "common-lisp-system-symlink needs more arguments"
19 >> for package in "$@" ; do
20 >> common-lisp-install-single-system "${package}"
21 >> done
22 >> CLPACKAGE="${_oldclpackage}"
23 >> fi
24 >> }
25 >
26 > setting CLPACKAGE that way is the equivalent of this:
27 >
28 > (defun common-lisp-system-symlink (system &key (package *clpackage*))
29 > (let ((*clpackage* package)) ...))
30 >
31 > I'm faking default arguments: when $1 is "-p" CLPACKAGE gets set
32 > temporarily to $2, then restored to its initial value. I've seen this
33 > idiom elsewhere in sh code
34 > anyway, I've removed this since it's unnecessary
35
36 I'm glad to see it go.
37
38 I've added the following proposed replacement to the eclass. The underscore
39 will prevent it from being used right away:
40
41 # if no arguments received, default to the contents of ${CLSYSTEMS}
42 _common-lisp-system-symlink() {
43 dodir "${CLSYSTEMROOT}"
44
45 for package in $([[ $# = 0 ]] && echo ${CLSYSTEMS} || echo "$@") ; do
46 common-lisp-install-single-system "${package}"
47 done
48 }
49
50 Please test it.
51
52 Marijn
53
54 - --
55 Marijn Schouten (hkBst), Gentoo Lisp project
56 <http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode
57 -----BEGIN PGP SIGNATURE-----
58 Version: GnuPG v2.0.7 (GNU/Linux)
59 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
60
61 iD8DBQFHF5TMp/VmCx0OL2wRAj4QAJ9S01YNwip2pDs8FF8rDrmkHqb5LwCeMPj1
62 tsXPUTOAvmz1dURd8LcY0Y4=
63 =Tebj
64 -----END PGP SIGNATURE-----
65 --
66 gentoo-lisp@g.o mailing list