Re: [asdf-devel] New manual patch --- one more time
Robert Goldman wrote: > I was reading over the info again before my talk, and I realized that > there was no discussion of the test-op as one of the predefined > operations, although it is predefined. Patch attached. > > > In previous draft I forgot to mention that OPERATION-DONE-P always returns NIL by default for TEST-OP. Fixed here. Best, r diff --git a/asdf.texinfo b/asdf.texinfo index cfef5c6..c831ddc 100644 --- a/asdf.texinfo +++ b/asdf.texinfo @@ -558,42 +558,63 @@ If you are creating a component type, you need to implement this operation - at least, where meaningful. @end deffn -...@deffn Operation test-system-version &key minimum +...@deffn Operation test-op -Asks the system whether it satisfies a version requirement. +This operation should carry out a test on the specified component. ASDF +does not (currently) provide a method for returning a value from the +test-op (or any other operation), so the implementor must ensure that +executing the @code{test-op} has the side effect of printing useful +information about the tests to the CL stream @code{*standard-output*}. -The default method accepts a string, which is expected to contain of a -number of integers separated by #\. characters. The method is not -recursive. The component satisfies the version dependency if it has -the same major number as required and each of its sub-versions is -greater than or equal to the sub-version number required. +The default method for @code{test-op} does nothing, and will have to be +overridden, but invoking @code{test-op} on a component for which nothing +is defined will be a simple no-op. -...@lisp -(defun version-satisfies (x y) - (labels ((bigger (x y) -(cond ((not y) t) - ((not x) nil) - ((> (car x) (car y)) t) - ((= (car x) (car y)) - (bigger (cdr x) (cdr y)) -(and (= (car x) (car y)) -(or (not (cdr y)) (bigger (cdr x) (cdr y)) -...@end lisp +The default dependency for @code{test-op} on a system is to require +...@code{load-op} on that system. -If that doesn't work for your system, you can override it. I hope -you have as much fun writing the new method as @verb{|#lisp|} did -reimplementing this one. +The default method for @code{operation-done-p} for @code{test-op} and +any component is to return @code{NIL}. We expect that users will want +to rerun tests. @end deffn -...@deffn Operation feature-dependent-op -An instance of @code{feature-dependent-op} will ignore any components -which have a @code{features} attribute, unless the feature combination -it designates is satisfied by @code{*features*}. This operation is -not intended to be instantiated directly, but other operations may -inherit from it. +...@c @deffn Operation test-system-version &key minimum -...@end deffn +...@c Asks the system whether it satisfies a version requirement. + +...@c The default method accepts a string, which is expected to contain of a +...@c number of integers separated by #\. characters. The method is not +...@c recursive. The component satisfies the version dependency if it has +...@c the same major number as required and each of its sub-versions is +...@c greater than or equal to the sub-version number required. + +...@c @lisp +...@c (defun version-satisfies (x y) +...@c (labels ((bigger (x y) +...@c (cond ((not y) t) +...@c ((not x) nil) +...@c ((> (car x) (car y)) t) +...@c ((= (car x) (car y)) +...@c (bigger (cdr x) (cdr y)) +...@c (and (= (car x) (car y)) +...@c (or (not (cdr y)) (bigger (cdr x) (cdr y)) +...@c @end lisp + +...@c If that doesn't work for your system, you can override it. I hope +...@c you have as much fun writing the new method as @verb{|#lisp|} did +...@c reimplementing this one. +...@c @end deffn + +...@c @deffn Operation feature-dependent-op + +...@c An instance of @code{feature-dependent-op} will ignore any components +...@c which have a @code{features} attribute, unless the feature combination +...@c it designates is satisfied by @code{*features*}. This operation is +...@c not intended to be instantiated directly, but other operations may +...@c inherit from it. + +...@c @end deffn @node Creating new operations, , Predefined operations of asdf, Operations @comment node-name, next, previous, up ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
[asdf-devel] New manual patch
I was reading over the info again before my talk, and I realized that there was no discussion of the test-op as one of the predefined operations, although it is predefined. Patch attached. diff --git a/asdf.texinfo b/asdf.texinfo index cfef5c6..761d606 100644 --- a/asdf.texinfo +++ b/asdf.texinfo @@ -558,42 +558,59 @@ If you are creating a component type, you need to implement this operation - at least, where meaningful. @end deffn -...@deffn Operation test-system-version &key minimum +...@deffn Operation test-op -Asks the system whether it satisfies a version requirement. +This operation should carry out a test on the specified component. ASDF +does not (currently) provide a method for returning a value from the +test-op (or any other operation), so the implementor must ensure that +executing the @code{test-op} has the side effect of printing useful +information about the tests to the CL stream @code{*standard-output*}. -The default method accepts a string, which is expected to contain of a -number of integers separated by #\. characters. The method is not -recursive. The component satisfies the version dependency if it has -the same major number as required and each of its sub-versions is -greater than or equal to the sub-version number required. +The default method for @code{test-op} does nothing, and will have to be +overridden, but invoking @code{test-op} on a component for which nothing +is defined will be a simple no-op. -...@lisp -(defun version-satisfies (x y) - (labels ((bigger (x y) -(cond ((not y) t) - ((not x) nil) - ((> (car x) (car y)) t) - ((= (car x) (car y)) - (bigger (cdr x) (cdr y)) -(and (= (car x) (car y)) -(or (not (cdr y)) (bigger (cdr x) (cdr y)) -...@end lisp - -If that doesn't work for your system, you can override it. I hope -you have as much fun writing the new method as @verb{|#lisp|} did -reimplementing this one. +The default dependency for @code{test-op} on a system is to require +...@code{load-op} on that system. @end deffn -...@deffn Operation feature-dependent-op -An instance of @code{feature-dependent-op} will ignore any components -which have a @code{features} attribute, unless the feature combination -it designates is satisfied by @code{*features*}. This operation is -not intended to be instantiated directly, but other operations may -inherit from it. +...@c @deffn Operation test-system-version &key minimum -...@end deffn +...@c Asks the system whether it satisfies a version requirement. + +...@c The default method accepts a string, which is expected to contain of a +...@c number of integers separated by #\. characters. The method is not +...@c recursive. The component satisfies the version dependency if it has +...@c the same major number as required and each of its sub-versions is +...@c greater than or equal to the sub-version number required. + +...@c @lisp +...@c (defun version-satisfies (x y) +...@c (labels ((bigger (x y) +...@c (cond ((not y) t) +...@c ((not x) nil) +...@c ((> (car x) (car y)) t) +...@c ((= (car x) (car y)) +...@c (bigger (cdr x) (cdr y)) +...@c (and (= (car x) (car y)) +...@c (or (not (cdr y)) (bigger (cdr x) (cdr y)) +...@c @end lisp + +...@c If that doesn't work for your system, you can override it. I hope +...@c you have as much fun writing the new method as @verb{|#lisp|} did +...@c reimplementing this one. +...@c @end deffn + +...@c @deffn Operation feature-dependent-op + +...@c An instance of @code{feature-dependent-op} will ignore any components +...@c which have a @code{features} attribute, unless the feature combination +...@c it designates is satisfied by @code{*features*}. This operation is +...@c not intended to be instantiated directly, but other operations may +...@c inherit from it. + +...@c @end deffn @node Creating new operations, , Predefined operations of asdf, Operations @comment node-name, next, previous, up ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
Re: [asdf-devel] ASDF manual
Gary King wrote: > Good idea > > > On Aug 17, 2009, at 1:16 PM, Robert Goldman wrote: > >> The asdf manual seems to document two non-existent operations: >> feature-dependent-op and test-system-version. >> >> Any reason not to excise them from the manual? >> OK, here's a patch to squash the non-existent operations: diff --git a/asdf.texinfo b/asdf.texinfo index cfef5c6..907f9ec 100644 --- a/asdf.texinfo +++ b/asdf.texinfo @@ -558,42 +558,42 @@ If you are creating a component type, you need to implement this operation - at least, where meaningful. @end deffn -...@deffn Operation test-system-version &key minimum - -Asks the system whether it satisfies a version requirement. - -The default method accepts a string, which is expected to contain of a -number of integers separated by #\. characters. The method is not -recursive. The component satisfies the version dependency if it has -the same major number as required and each of its sub-versions is -greater than or equal to the sub-version number required. - -...@lisp -(defun version-satisfies (x y) - (labels ((bigger (x y) -(cond ((not y) t) - ((not x) nil) - ((> (car x) (car y)) t) - ((= (car x) (car y)) - (bigger (cdr x) (cdr y)) -(and (= (car x) (car y)) -(or (not (cdr y)) (bigger (cdr x) (cdr y)) -...@end lisp - -If that doesn't work for your system, you can override it. I hope -you have as much fun writing the new method as @verb{|#lisp|} did -reimplementing this one. -...@end deffn - -...@deffn Operation feature-dependent-op - -An instance of @code{feature-dependent-op} will ignore any components -which have a @code{features} attribute, unless the feature combination -it designates is satisfied by @code{*features*}. This operation is -not intended to be instantiated directly, but other operations may -inherit from it. - -...@end deffn +...@c @deffn Operation test-system-version &key minimum + +...@c Asks the system whether it satisfies a version requirement. + +...@c The default method accepts a string, which is expected to contain of a +...@c number of integers separated by #\. characters. The method is not +...@c recursive. The component satisfies the version dependency if it has +...@c the same major number as required and each of its sub-versions is +...@c greater than or equal to the sub-version number required. + +...@c @lisp +...@c (defun version-satisfies (x y) +...@c (labels ((bigger (x y) +...@c (cond ((not y) t) +...@c ((not x) nil) +...@c ((> (car x) (car y)) t) +...@c ((= (car x) (car y)) +...@c (bigger (cdr x) (cdr y)) +...@c (and (= (car x) (car y)) +...@c (or (not (cdr y)) (bigger (cdr x) (cdr y)) +...@c @end lisp + +...@c If that doesn't work for your system, you can override it. I hope +...@c you have as much fun writing the new method as @verb{|#lisp|} did +...@c reimplementing this one. +...@c @end deffn + +...@c @deffn Operation feature-dependent-op + +...@c An instance of @code{feature-dependent-op} will ignore any components +...@c which have a @code{features} attribute, unless the feature combination +...@c it designates is satisfied by @code{*features*}. This operation is +...@c not intended to be instantiated directly, but other operations may +...@c inherit from it. + +...@c @end deffn @node Creating new operations, , Predefined operations of asdf, Operations @comment node-name, next, previous, up ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
Re: [asdf-devel] Windows shortcuts
> Perhaps someone more proficient than me in the Way of Gates would be > able to pass an eyeball over the proposed patch. > This will help motivate me to get my automated stuff another step better in my virtual windows box... -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
Re: [asdf-devel] ASDF manual
Good idea On Aug 17, 2009, at 1:16 PM, Robert Goldman wrote: > The asdf manual seems to document two non-existent operations: > feature-dependent-op and test-system-version. > > Any reason not to excise them from the manual? > > R > > ___ > asdf-devel mailing list > asdf-devel@common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
Re: [asdf-devel] Windows shortcuts
Gary King wrote: >> Does anyone know why this didn't make it into ASDF? Should we apply >> this patch? >> > > I'm guessing it was just inertia. I'll try to get it i before your talk > (which is when, by the way !?) Oh, we needn't rush to that extent! My talk is tomorrow evening, which is too soon to review this, but it would be nice to be able to say help is on the way to Windows users! I especially don't want to rush this because I don't have access to a windows box myself, and would hate to cause problems because of a piece of code I can't even test out. Perhaps someone more proficient than me in the Way of Gates would be able to pass an eyeball over the proposed patch. Best, Robert ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
Re: [asdf-devel] Windows shortcuts
> Does anyone know why this didn't make it into ASDF? Should we apply > this patch? > I'm guessing it was just inertia. I'll try to get it i before your talk (which is when, by the way !?) > I'm just about to give a quick talk on ASDF, and I'm not looking > forward > to telling the Windows folks that it won't work that well for them > > Cheers, > r > > ___ > asdf-devel mailing list > asdf-devel@common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM * gwking on twitter ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
[asdf-devel] and of course I forgot the attachment....
Here's David's patch --- asdf.lisp-orig 2007-04-07 20:49:06.0 +0200 +++ asdf.lisp 2007-04-07 20:51:42.0 +0200 @@ -355,13 +355,22 @@ (let ((name (coerce-name system))) (block nil (dolist (dir *central-registry*) -(let* ((defaults (eval dir)) - (file (and defaults - (make-pathname - :defaults defaults :version :newest - :name name :type "asd" :case :local - (if (and file (probe-file file)) - (return file))) +(let ((defaults (eval dir))) + (when defaults + (let* ((file (make-pathname + :defaults defaults :version :newest + :name name :type "asd" :case :local)) + #+win32 + (lnk (make-pathname +:defaults defaults :version :newest +:name name :type "asd.lnk" :case :local))) + (when (probe-file file) + (return file)) + #+win32 + (when (probe-file lnk) + (let ((target (parse-windows-shortcut lnk))) + (when target + (return (pathname target (defun make-temporary-package () (flet ((try (counter) @@ -1172,6 +1181,84 @@ (hyperdocumentation (symbol-package name) name doc-type)) + Windows shortcut support. Based on: + +;;; Jesse Hager: The Windows Shortcut File Format. +;;; http://www.wotsit.org/list.asp?fc=13 + +(defparameter *link-initial-dword* 76) +(defparameter *link-guid* #(1 20 2 0 0 0 0 0 192 0 0 0 0 0 0 70)) + +(defun read-null-terminated-string (s) + (with-output-to-string (out) +(loop + for code = (read-byte s) + until (zerop code) + do (write-char (code-char code) out + +(defun read-little-endian (s &optional (bytes 4)) + (let ((result 0)) +(loop + for i from 0 below bytes + do + (setf result (logior result (ash (read-byte s) (* 8 i) +result)) + +(defun parse-windows-shortcut (pathname) + (with-open-file (s pathname :element-type '(unsigned-byte 8)) +(handler-case + (when (and (= (read-little-endian s) *link-initial-dword*) + (let ((header (make-array (length *link-guid* +(read-sequence header s) +(equalp header *link-guid*))) + (let ((flags (read-little-endian s))) + (file-position s 76);skip rest of header + (when (logbitp 0 flags) + ;; skip shell item id list + (let ((length (read-little-endian s 2))) + (file-position s (+ length (file-position s) + (cond + ((logbitp 1 flags) + (parse-file-location-info s)) + (t + (when (logbitp 2 flags) + ;; skip description string + (let ((length (read-little-endian s 2))) + (file-position s (+ length (file-position s) + (when (logbitp 3 flags) + ;; finally, our pathname + (let* ((length (read-little-endian s 2)) +(buffer (make-array length))) + (read-sequence buffer s) + (map 'string #'code-char buffer))) + (end-of-file () + nil + +(defun parse-file-location-info (s) + (let ((start (file-position s)) + (total-length (read-little-endian s)) + (end-of-header (read-little-endian s)) + (fli-flags (read-little-endian s)) + (local-volume-offset (read-little-endian s)) + (local-offset (read-little-endian s)) + (network-volume-offset (read-little-endian s)) + (remaining-offset (read-little-endian s))) +(declare (ignore total-length end-of-header local-volume-offset)) +(unless (zerop fli-flags) + (cond + ((logbitp 0 fli-flags) + (file-position s (+ start local-offset))) + ((logbitp 1 fli-flags) + (file-position s (+ start + network-volume-offset + #x14 + (concatenate 'string + (read-null-terminated-string s) + (progn + (file-position s (+ start remaining-offset)) + (read-null-terminated-string s)) + + (pushnew :asdf *features*) #+sbcl ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
[asdf-devel] Windows shortcuts
Apparently, some time ago David Lichteblau proposed an asdf patch (which I am attaching) that would make it possible for ASDF to follow Windows shortcuts as if they were symbolic links. Does anyone know why this didn't make it into ASDF? Should we apply this patch? I'm just about to give a quick talk on ASDF, and I'm not looking forward to telling the Windows folks that it won't work that well for them Cheers, r ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
[asdf-devel] ASDF manual
The asdf manual seems to document two non-existent operations: feature-dependent-op and test-system-version. Any reason not to excise them from the manual? R ___ asdf-devel mailing list asdf-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel