Fix "command not found: -e" from unset tool path variables - #549
Open
danish-a1 wants to merge 1 commit into
Open
Fix "command not found: -e" from unset tool path variables#549danish-a1 wants to merge 1 commit into
danish-a1 wants to merge 1 commit into
Conversation
scripts/function/tools defines LS_PATH, TR_PATH, SED_PATH, GREP_PATH,
EGREP_PATH, SORT_PATH, HEAD_PATH and HEXDUMP_PATH, and is loaded only by
scripts/functions. scripts/env/use and scripts/env/pkgset-use never sourced
that file, so on those code paths every variable expanded empty and each
command lost its argv[0] -- "gvm use" printed a flood of
"gvm_pseudohash_encode:25: command not found: -e" (zsh attributes the error
to the enclosing case statement, hence the misleading line number).
Source scripts/functions from both env scripts, which also fixes the bare
$LS_PATH / $SORT_PATH / $GREP_PATH / $HEAD_PATH pipelines in their fuzzy
version matching.
scripts/templates/binary sourced "$GVM_ROOT/scripts/functions/tools", a path
that does not exist -- the directory is scripts/function, singular. Generated
binary wrappers always ran with an empty $GREP_PATH. Corrected.
Add ${VAR:-tool} fallbacks in _bash_pseudo_hash, gvm_export_path and
gvm_environment_sanitize so the files documented as standalone-sourceable keep
working when tools has not been loaded.
Bump VERSION to 1.0.23 and document installing from source (SRC_REPO, branch
argument, local clone) in the README.
Fixes moovweb#548
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/function/tools defines LS_PATH, TR_PATH, SED_PATH, GREP_PATH, EGREP_PATH, SORT_PATH, HEAD_PATH and HEXDUMP_PATH, and is loaded only by scripts/functions. scripts/env/use and scripts/env/pkgset-use never sourced that file, so on those code paths every variable expanded empty and each command lost its argv[0] -- "gvm use" printed a flood of "gvm_pseudohash_encode:25: command not found: -e" (zsh attributes the error to the enclosing case statement, hence the misleading line number).
Source scripts/functions from both env scripts, which also fixes the bare $LS_PATH / $SORT_PATH / $GREP_PATH / $HEAD_PATH pipelines in their fuzzy version matching.
scripts/templates/binary sourced "$GVM_ROOT/scripts/functions/tools", a path that does not exist -- the directory is scripts/function, singular. Generated binary wrappers always ran with an empty $GREP_PATH. Corrected.
Add ${VAR:-tool} fallbacks in _bash_pseudo_hash, gvm_export_path and gvm_environment_sanitize so the files documented as standalone-sourceable keep working when tools has not been loaded.
Bump VERSION to 1.0.23 and document installing from source (SRC_REPO, branch argument, local clone) in the README.
Fixes #548