[Git][cmucl/cmucl][issue-363-add-version-number] 3 commits: Fix misleading debugging print message

Raymond Toy pushed to branch issue-363-add-version-number at cmucl / cmucl Commits: c20cd13e by Raymond Toy at 2025-02-09T07:14:22-08:00 Fix misleading debugging print message The message said "Found it, but we can't read it". This is misleading. The message should really say either the file doesn't exist or that we can't read it if it does (because `access(buf, R_OK)` failed). - - - - - ac65dfa3 by Raymond Toy at 2025-02-09T07:22:14-08:00 Update release notes to mention changes caused by #363 and !261. Also just add a link so the user can find the layout. - - - - - 59bbf30e by Raymond Toy at 2025-02-10T06:51:23-08:00 Remove -print-version switch in favor of -version Change the commandline switch `-version` (and `--version`) to print the version and exit. Before, this was handled in lisp, but it's not necessary now since the version is the same as `*lisp-implementation-version*`. This means we don't need `-print-version` anymore. We need to exit too, because the build scripts need to know the version of lisp being used. Update make-dist.sh to use `-version` instead of `-print-version` which no longer exists. Update cmucl.pot file for the changed docstrings. - - - - - 5 changed files: - bin/make-dist.sh - src/code/commandline.lisp - src/general-info/release-21f.md - src/i18n/locale/cmucl.pot - src/lisp/lisp.c Changes: ===================================== bin/make-dist.sh ===================================== @@ -167,7 +167,7 @@ TARGET="`echo $1 | sed 's:/*$::'`" # Choose a version based on the git hash as the default version. We # only compute a default if the git hash looks like a snapshot # ("snapshot-yyyy-mm") or a release number.. -DEFAULT_VERSION="`$TARGET/lisp/lisp -print-version`" +DEFAULT_VERSION="`$TARGET/lisp/lisp --version`" if [ -z "$VERSION" ]; then # If a default version exists, use it. Otherwise this is an ===================================== src/code/commandline.lisp ===================================== @@ -400,18 +400,14 @@ (format t "~A~%" (lisp-implementation-version)) (ext:quit)) +;; the switches "-version" and "--version" are never actually called +;; from lisp because main() handles it and returns before the lisp +;; initial function is ever run. It's here so that -help will print +;; it out so the user knows about it. (defswitch "version" #'version-switch-demon - "Prints the cmucl version and exits") + "Prints the cmucl version and exits, without loading the lisp core.") ;; Make --version work for the benefit of those who are accustomed to ;; GNU software. (defswitch "-version" #'version-switch-demon "Prints the cmucl version and exits; same as -version") - -;; This is never actually called from lisp because main() handles it -;; and returns before the lisp initial function is ever run. It's -;; here so that -help will print it out so the user knows about it. -(defswitch "print-version" #'version-switch-demon - "Like -version, but a core file doesn't have to loaded first. The - version is printed and lisp exits immediately before doing any of the - core startup code.") ===================================== src/general-info/release-21f.md ===================================== @@ -27,6 +27,8 @@ public domain. * The RNG has changed from an old version of xoroshiro128+ to xoroshiro128**. This means sequences of random numbers will be different from before. See ~~#276~~. + * The layout of the distribution has changed. Version numbers are + added to files and directories. For the exact layout, see !261. * ANSI compliance fixes: * Bug fixes: * Gitlab tickets: @@ -112,6 +114,8 @@ public domain. * ~~#360~~ Adding site-init file * ~~#361~~ Add herald item to mention where to report issues * ~~#362~~ Simplify "library:" search-list + * ~~#363~~ Version numbers added to files and directories. The + distribution layout has changed. * ~~#364~~ Add interface to `mkdtemp` and `mkstemp` * ~~#367~~ Add stream:string-count-octets to count octets in a string * ~~#369~~ Improve docstring for `unix::unix-setlocale` ===================================== src/i18n/locale/cmucl.pot ===================================== @@ -6216,13 +6216,6 @@ msgstr "" msgid "Prints the cmucl version and exits; same as -version" msgstr "" -#: src/code/commandline.lisp -msgid "" -"Like -version, but a core file doesn't have to loaded first. The\n" -" version is printed and lisp exits immediately before doing any of the\n" -" core startup code." -msgstr "" - #: src/code/env-access.lisp msgid "" "Returns information about the symbol VAR in the lexical environment ENV.\n" ===================================== src/lisp/lisp.c ===================================== @@ -342,7 +342,7 @@ search_core(const char *lib, const char *default_core) return buf; } else { if (debug_lisp_search) { - fprintf(stderr, "Found it, but we can't read it!\n"); + fprintf(stderr, "Does not exist, or can't read it if it does!\n"); } } } while (*lib++ == ':'); @@ -679,7 +679,8 @@ main(int argc, const char *argv[], const char *envp[]) debug_lisp_search = TRUE; } else if (strcmp(arg, "-unidata") == 0) { unidata = *++argptr; - } else if (strcmp(arg, "-print-version") == 0) { + } else if ((strcmp(arg, "-version") == 0) || + (strcmp(arg, "--version") == 0)) { /* * Print the version and exit; we don't want to do * anything else! View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/d8c1eb8ce9c0fef6020d3ec... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/d8c1eb8ce9c0fef6020d3ec... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)