Added get-env-var to asdf
Gary King <[email protected]> Thu, 5 Apr 2007 09:31:25 -0400
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
I think it would be a good-thing if asdf included get-env-var. I've
found the need for it on several occasions when I wanted environment
variables to exert some control on the loading or testing process.
The definition below comes directly from the portable ASDF-Install.
If there is no dissension, I'll check this in sometime next week.
--- asdf.lisp 2007-03-21 18:08:33.000000000 -0400
+++ /repository/other/agraph/lisp/asdf/asdf.lisp 2007-04-03
14:52:42.000000000 -0400
@@ -1,4 +1,4 @@
@@ -105,6 +105,8 @@
#:preference-file-for-system/operation
#:load-preferences
+
+ #:get-env-var
)
(:use :cl))
@@ -1264,5 +1276,15 @@
(pushnew 'module-provide-asdf sb-ext:*module-provider-functions*)
(pushnew 'contrib-sysdef-search *system-definition-search-
functions*))
+(defun get-env-var (name)
+ #+:sbcl (sb-ext:posix-getenv name)
+ #+:cmu (cdr (assoc (intern (substitute #\_ #\- name)
+ :keyword)
+ ext:*environment-list*))
+ #+:allegro (sys:getenv name)
+ #+:lispworks (lw:environment-variable name)
+ #+:clisp (ext:getenv name)
+ #+(or :mcl :openmcl) (ccl::getenv name))
+
(provide 'asdf)
--
Gary Warren King, metabang.com
Cell: (413) 885 9127
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV