Hello,
In the system definition we can specify a version; for example:
(asdf:defsystem :foo :description "foo utility" :license "LGPL"
:version (:read-file-form "VERSION")
:serial t :components ((:file "foo")))
For example I can query the system license like this: (asdf:system-licence (asdf:find-system "foo"))
How can I query the version of system foo at run time?
Thanks, Frank
Hi Frank, You are looking for asdf:component-version. See for example how Shuffletron https://github.com/ahefner/shuffletron/blob/39c7d8af6577e9cbd39da656598f98c6eb6c3f14/src/global.lisp#L6 does it
On Fri, Jun 17, 2016 at 10:59 AM, Frank fau@riseup.net wrote:
Hello,
In the system definition we can specify a version; for example:
(asdf:defsystem :foo :description "foo utility" :license "LGPL"
:version (:read-file-form "VERSION")
:serial t :components ((:file "foo")))
For example I can query the system license like this: (asdf:system-licence (asdf:find-system "foo"))
How can I query the version of system foo at run time?
Thanks, Frank
Thanks, yes that works.
I tried that before but it didn't seem to work with (:read-file-form "VERSION") but it turned out I had the VERSION file in the wrong format.
On Fri, 2016-06-17 at 11:04 -0500, Javier Olaechea wrote:
Hi Frank, You are looking for asdf:component-version. See for example how Shuffletron https://github.com/ahefner/shuffletron/blob/39c7d8af6577e9cbd39da656 598f98c6eb6c3f14/src/global.lisp#L6 does it
On Fri, Jun 17, 2016 at 10:59 AM, Frank fau@riseup.net wrote:
Hello,
In the system definition we can specify a version; for example:
(asdf:defsystem :foo :description "foo utility" :license "LGPL"
:version (:read-file-form "VERSION")
:serial t :components ((:file "foo")))
For example I can query the system license like this: (asdf:system-licence (asdf:find-system "foo"))
How can I query the version of system foo at run time?
Thanks, Frank
On 6/17/16 Jun 17 -11:04 AM, Javier Olaechea wrote:
Hi Frank, You are looking for asdf:component-version. See for example how Shuffletron https://github.com/ahefner/shuffletron/blob/39c7d8af6577e9cbd39da656598f98c6eb6c3f14/src/global.lisp#L6 does it
Yes, that is because all components can have versions, not just systems.
Actually, Faré and I have in the past talked about moving the versioning from arbitrary components (including files and modules) up to systems, which is the only place I have seen it used in the wild.
As a half-measure, perhaps we should add SYSTEM-VERSION as an exported function. Having only COMPONENT-VERSION requires users of ASDF to know stuff about the inheritance structure of the COMPONENT subclasses that seems inappropriate.
Best, r
On Fri, Jun 17, 2016 at 10:59 AM, Frank <fau@riseup.net mailto:fau@riseup.net> wrote:
Hello, In the system definition we can specify a version; for example: (asdf:defsystem :foo :description "foo utility" :license "LGPL" :version (:read-file-form "VERSION") :serial t :components ((:file "foo"))) For example I can query the system license like this: (asdf:system-licence (asdf:find-system "foo")) How can I query the version of system foo at run time? Thanks, Frank
-- "I object to doing things that computers can do." — Olin Shivers