-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
package: use: set FPATH & MANPATH; install: also install functions
This commit adds FPATH and MANPATH handling to allow autoloading functions and viewing manual pages that come with the distribution after 'bin/package use'. Also, 'bin/package install' now installs these autoloadable functions in $PREFIX/share/fun. There are also code tweaks for safety and one fix in name.c for a crash exposed by these changes. bin/package, src/cmd/INIT/package.sh: - Disable global pathname expansion (glob) because this code heavily uses field splitting of unquoted variable expansions which are also subject to (unwanted) pathname expansion. - Locally re-enable glob in subshells where necessary. - Add FPATH and MANPATH to $env; add the fun and man directories within arch to them. This allows autoloading functions and viewing manual pages that come with the distribution after 'bin/package use'. - Code clarity: eliminate showenv() as a separate function as it was only called from one place. - install: when installing ksh, also install the autoloadable functions from fun into share/fun under the install prefix. src/cmd/ksh93/sh/name.c: - The above changes exposed a crash in path_unsetfpath when a script without a hashbang path is run via sh_reinit (see 0af8199 for background info). This crash occurred when FPATH is exported. To avoid this, amend sh_envnolocal to exclude FPATH.
- Loading branch information
Showing
3 changed files
with
108 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.