[Git][cmucl/cmucl][issue-390-autogen-errno-package] Update create-errno.sh to create src/code/exports-errno.lisp

Raymond Toy pushed to branch issue-390-autogen-errno-package at cmucl / cmucl Commits: 71205882 by Raymond Toy at 2025-03-03T16:07:17-08:00 Update create-errno.sh to create src/code/exports-errno.lisp Forgot to checkin the bit of code that actually generates exports-errno.lisp. Also, move the bit of code about renaming ERRNO from exports.lisp to exports-errno.lisp since the latter is loaded before the former. - - - - - 2 changed files: - bin/create-errno.sh - src/code/exports.lisp Changes: ===================================== bin/create-errno.sh ===================================== @@ -32,7 +32,7 @@ do done # Where the output should go. -OUTPUT="src/code/errno.lisp" +ERRNO_FILE="src/code/errno.lisp" # Template file containing the default def-unix-error forms and other # support code. @@ -53,7 +53,7 @@ fi if [ -z "$ERRNO_FILES" ]; then # Copy the main errno template to the output. The template is a lisp # file so we can read and modify it more easily. - cat "$TEMPLATE" > $OUTPUT + cat "$TEMPLATE" > $ERRNO_FILE else # We can autogenerate the def-unix-error forms. Copy just the # initial part of the template, up to the first def-unix-error @@ -73,10 +73,43 @@ EOF # The tail was also copied from code/unix.lisp. It's needed to tell # Lisp about the errno values. sed '1,/^;;; End of default/d' "$TEMPLATE" - } > $OUTPUT + } > $ERRNO_FILE fi # If -S option given, cat the output file to stdout if [ -n "$SHOW" ]; then - cat $OUTPUT + cat $ERRNO_FILE fi + +# Now generate the defpackage form for the ERRNO package. +cat > src/code/exports-errno.lisp <<EOF +;;; -*- Log: C.Log -*- +;;; +;;; ********************************************************************** +;;; This code was written as part of the CMU Common Lisp project at +;;; Carnegie Mellon University, and has been placed in the public domain. +;;; +(ext:file-comment + ": src/code/exports-errno.lisp $") +;;; +;;; ********************************************************************** +;;; +;;; All the stuff necessary to export various symbols from various packages. +;;; + +(in-package "LISP") + +(intl:textdomain "cmucl") + +(if (find-package "ERRNO") + (rename-package "ERRNO" "ERRNO" 'nil) + (make-package "ERRNO" :nicknames 'nil :use nil)) + +(defpackage "ERRNO" + (:export +$(grep '(def-unix-error ' $ERRNO_FILE | + cut -d ' ' -f2 | + sed 's/\(.*\)/ "\1"/' | + sort) + )) +EOF ===================================== src/code/exports.lisp ===================================== @@ -31,9 +31,6 @@ (if (find-package "BIGNUM") (rename-package "BIGNUM" "BIGNUM" 'nil) (make-package "BIGNUM" :nicknames 'nil :use nil)) -(if (find-package "ERRNO") - (rename-package "ERRNO" "ERRNO" 'nil) - (make-package "ERRNO" :nicknames 'nil :use nil)) (if (find-package "UNIX") (rename-package "UNIX" "UNIX" 'nil) (make-package "UNIX" :nicknames 'nil :use nil)) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/7120588272b74c392c0d3e56... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/7120588272b74c392c0d3e56... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)