Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add passing bash version to read_vars_file #729

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

SOCKET_BUF_SIZE = 8192

BASH_VERSION = tuple(int(i) for i in os.getenv("PASH_BASH_VERSION").split(" "))


##
## Global configuration used by all pash components
Expand Down
2 changes: 1 addition & 1 deletion compiler/pash_compilation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def compile_and_add(self, compiled_script_file, var_file, input_ir_file):

variable_reading_start_time = datetime.now()
# Read any shell variables files if present
vars_dict = env_vars_util.read_vars_file(var_file)
vars_dict = env_vars_util.read_vars_file(var_file, config.BASH_VERSION)
config.set_vars_file(var_file, vars_dict)

variable_reading_end_time = datetime.now()
Expand Down
2 changes: 1 addition & 1 deletion compiler/pash_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main_body():
runtime_config = config.config["distr_planner"]

## Read any shell variables files if present
vars_dict = env_vars_util.read_vars_file(args.var_file)
vars_dict = env_vars_util.read_vars_file(args.var_file, config.BASH_VERSION)
config.set_vars_file(args.var_file, vars_dict)

log("Input:", args.input_ir, "Compiled file:", args.compiled_script_file)
Expand Down
3 changes: 3 additions & 0 deletions pa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ then
exit
fi

## get bash version for pash
export PASH_BASH_VERSION="${BASH_VERSINFO[@]:0:3}"

## Create a temporary directory where PaSh can use for temporary files and logs
export PASH_TMP_PREFIX="$(mktemp -d /tmp/pash_XXXXXXX)/"

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ graphviz
libdash
pash-annotations==0.2.2
shasta==0.1.0
sh-expand>=0.1.3
sh-expand>=0.1.6
Loading