Re: [PATCH] Re: Could there be a way to disable LOAD-PREFERENCES?

Gary King <[email protected]> Sat, 3 May 2008 19:56:54 -0400
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
Here is my proposed patch; if I don't hear back from anyone, I'll  
commit this Monday (May 5th).

Index: asdf.lisp
===================================================================
RCS file: /cvsroot/cclan/asdf/asdf.lisp,v
retrieving revision 1.116
diff -u -w -r1.116 asdf.lisp
--- asdf.lisp	3 May 2008 21:51:28 -0000	1.116
+++ asdf.lisp	3 May 2008 22:29:17 -0000
@@ -102,10 +102,11 @@

             #:retry
             #:accept                     ; restarts
-
-           #:preference-file-for-system/operation
-           #:load-preferences
             )
+  ;; preference loading - to be expunged
+  (:export
+   #:preference-file-for-system/operation
+   #:load-preferences)
    (:use :cl))


@@ -125,6 +126,11 @@
                                       (parse-integer v :start (1+ dot)
                                                        :junk-allowed  
t)))))

+(defvar *load-preference-files* nil
+  "If true, then preference files will be loaded.
+
+This variable will be removed August 2008.")
+
  (defvar *compile-file-warnings-behaviour* :warn)

  (defvar *compile-file-failure-behaviour* #+sbcl :error #-sbcl :warn)
@@ -766,7 +772,8 @@
  (defmethod perform :after ((operation operation) (c component))
    (setf (gethash (type-of operation) (component-operation-times c))
          (get-universal-time))
-  (load-preferences c operation))
+  (when *load-preference-files*
+    (load-preferences c operation)))

@@ -928,15 +915,19 @@

  (defgeneric load-preferences (system operation)
    (:documentation
-   "Called to load system preferences after <perform operation
+   "Deprecated - will be removed August 2008
+
+Called to load system preferences after <perform operation
  system>. Typical uses are to set parameters that don't exist until
  after the system has been loaded."))

  (defgeneric preference-file-for-system/operation (system operation)
    (:documentation
-   "Returns the pathname of the preference file for this system.
-Called by 'load-preferences to determine what file to load."))
+   "Deprecated - will be removed August 2008

+Returns the pathname of the preference file for this system.
+Called by 'load-preferences to determine what file to load."))
  (defmethod load-preferences ((s t) (operation t))
    ;; do nothing
    (values))



On May 1, 2008, at 9:52 AM, Richard M Kreuter wrote:
> The following message is a courtesy copy of an article
> that has been posted to gmane.lisp.cclan.general as well.
>
> Gary King <[email protected]> writes:
>
>> I think I was the original preferences perpetrator and I use the
>> mechanism in some places. After more thought (aided by the discussion
>> here), I think that preference loading should not be part of the
>> current ASDF (though maybe they could/should be part of the
>> hypothetical incf-asdf). I'd be happy to do something like the
>> following:
>>
>>  * add a special that turns on preference loading if it bound to
>> true; it's initial binding will be nil
>>  * mark all the preference code as deprecated, to be removed in X
>> months (X = 3?)
>
> I'm okay with this proposal.
>
> --
> Richard

--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM





-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone