Skip to content

Commit

Permalink
Merge branch 'main' of github.com:conda/constructor into osx-glibc-ov…
Browse files Browse the repository at this point in the history
…erride
  • Loading branch information
jaimergp committed Nov 8, 2024
2 parents 69e00e5 + 6b551ff commit 21a84ec
Show file tree
Hide file tree
Showing 26 changed files with 197 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
- uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
activate-environment: constructor-docs
environment-file: docs/environment.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
GLOBAL: https://raw.githubusercontent.com/conda/infra/main/.github/global.yml
LOCAL: .github/labels.yml
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- id: has_local
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ jobs:
PYTHONUNBUFFERED: "1"
steps:
- name: Retrieve the source code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4
- uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
with:
activate-environment: constructor-dev
environment-file: dev/environment.yml
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Retrieve the source code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Report failures
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
env:
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
steps:
# Clean checkout of specific git ref needed for package metadata version
# which needs env vars GIT_DESCRIBE_TAG and GIT_BUILD_STR:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
clean: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
echo REPOSITORY=$(curl --silent ${{ github.event.issue.pull_request.url }} | jq --raw-output '.head.repo.full_name') >> $GITHUB_ENV
echo REF=$(curl --silent ${{ github.event.issue.pull_request.url }} | jq --raw-output '.head.ref') >> $GITHUB_ENV
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: ${{ env.REPOSITORY || github.repository }}
ref: ${{ env.REF || '' }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
rev: v3.19.0
hooks:
- id: pyupgrade
args: ["--py38-plus", "--keep-percent-format"]
Expand Down
3 changes: 3 additions & 0 deletions CONSTRUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,16 @@ Path to a post-install script. Some notes:
installation path is available as `${PREFIX}`. Installer metadata is
available in the `${INSTALLER_NAME}`, `${INSTALLER_VER}`, `${INSTALLER_PLAT}`
environment variables. `${INSTALLER_TYPE}` is set to `SH`.
`${INSTALLER_UNATTENDED}` will be `"1"` in batch mode (`-b`), `"0"` otherwise.
- For PKG installers, the shebang line is respected if present;
otherwise, `bash` is used. The same variables mentioned for `sh`
installers are available here. `${INSTALLER_TYPE}` is set to `PKG`.
`${INSTALLER_UNATTENDED}` is not supported and always set to `"?"`.
- For Windows `.exe` installers, the script must be a `.bat` file.
Installation path is available as `%PREFIX%`. Metadata about
the installer can be found in the `%INSTALLER_NAME%`, `%INSTALLER_VER%`,
`%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`/S`), `"0"` otherwise.

If necessary, you can activate the installed `base` environment like this:

Expand Down
3 changes: 3 additions & 0 deletions constructor/construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,16 @@
installation path is available as `${PREFIX}`. Installer metadata is
available in the `${INSTALLER_NAME}`, `${INSTALLER_VER}`, `${INSTALLER_PLAT}`
environment variables. `${INSTALLER_TYPE}` is set to `SH`.
`${INSTALLER_UNATTENDED}` will be `"1"` in batch mode (`-b`), `"0"` otherwise.
- For PKG installers, the shebang line is respected if present;
otherwise, `bash` is used. The same variables mentioned for `sh`
installers are available here. `${INSTALLER_TYPE}` is set to `PKG`.
`${INSTALLER_UNATTENDED}` is not supported and always set to `"?"`.
- For Windows `.exe` installers, the script must be a `.bat` file.
Installation path is available as `%PREFIX%`. Metadata about
the installer can be found in the `%INSTALLER_NAME%`, `%INSTALLER_VER%`,
`%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`/S`), `"0"` otherwise.
If necessary, you can activate the installed `base` environment like this:
Expand Down
9 changes: 6 additions & 3 deletions constructor/header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ while getopts "bifhkp:sut" x; do
esac
done

# For pre- and post-install scripts
export INSTALLER_UNATTENDED="$BATCH"

# For testing, keep the package cache around longer
CLEAR_AFTER_TEST=0
if [ "$TEST" = "1" ] && [ "$KEEP_PKGS" = "0" ]; then
Expand Down Expand Up @@ -483,7 +486,7 @@ if [ "__VIRTUAL_SPECS__" != "" ]; then
CONDA_QUIET="$BATCH" \
CONDA_SOLVER="classic" \
CONDA_PKGS_DIRS="$(mktemp -d)" \
"$CONDA_EXEC" create --dry-run --prefix "$PREFIX/envs/_virtual_specs_checks" --offline __VIRTUAL_SPECS__
"$CONDA_EXEC" create --dry-run --prefix "$PREFIX/envs/_virtual_specs_checks" --offline __VIRTUAL_SPECS__ __NO_RCS_ARG__
fi

# Create $PREFIX/.nonadmin if the installation didn't require superuser permissions
Expand Down Expand Up @@ -561,7 +564,7 @@ CONDA_EXTRA_SAFETY_CHECKS=no \
CONDA_CHANNELS="__CHANNELS__" \
CONDA_PKGS_DIRS="$PREFIX/pkgs" \
CONDA_QUIET="$BATCH" \
"$CONDA_EXEC" install --offline --file "$PREFIX/pkgs/env.txt" -yp "$PREFIX" $shortcuts || exit 1
"$CONDA_EXEC" install --offline --file "$PREFIX/pkgs/env.txt" -yp "$PREFIX" $shortcuts __NO_RCS_ARG__ || exit 1
rm -f "$PREFIX/pkgs/env.txt"

#The templating doesn't support nested if statements
Expand Down Expand Up @@ -606,7 +609,7 @@ for env_pkgs in "${PREFIX}"/pkgs/envs/*/; do
CONDA_CHANNELS="$env_channels" \
CONDA_PKGS_DIRS="$PREFIX/pkgs" \
CONDA_QUIET="$BATCH" \
"$CONDA_EXEC" install --offline --file "${env_pkgs}env.txt" -yp "$PREFIX/envs/$env_name" $env_shortcuts || exit 1
"$CONDA_EXEC" install --offline --file "${env_pkgs}env.txt" -yp "$PREFIX/envs/$env_name" $env_shortcuts __NO_RCS_ARG__ || exit 1
rm -f "${env_pkgs}env.txt"
done
#endif
Expand Down
10 changes: 10 additions & 0 deletions constructor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ def main_build(dir_path, output_dir='.', platform=cc_platform,
)
)

# Add --no-rc option to CONDA_EXE command so that existing
# .condarc files do not pollute the installation process.
if exe_type == StandaloneExe.CONDA and exe_version and exe_version >= Version("24.9.0"):
info["_ignore_condarcs_arg"] = "--no-rc"
elif exe_type == StandaloneExe.MAMBA:
info["_ignore_condarcs_arg"] = "--no-rc"
else:
info["_ignore_condarcs_arg"] = ""

if 'pkg' in itypes:
if (domains := info.get('pkg_domains')) is not None:
domains = {key: str(val).lower() for key, val in domains.items()}
Expand Down Expand Up @@ -241,6 +250,7 @@ def main_build(dir_path, output_dir='.', platform=cc_platform,
# '_dists': List[Dist]
# '_urls': List[Tuple[url, md5]]

os.makedirs(output_dir, exist_ok=True)
info_dicts = []
for itype in itypes:
if itype == 'sh':
Expand Down
14 changes: 12 additions & 2 deletions constructor/nsis/main.nsi.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,11 @@ Section "Install"
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_VER", "${VERSION}").r0'
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_PLAT", "${PLATFORM}").r0'
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_TYPE", "EXE").r0'
${If} ${Silent}
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_UNATTENDED", "1").r0'
${Else}
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_UNATTENDED", "0").r0'
${EndIf}

${If} '@VIRTUAL_SPECS@' != ''
# We need to specify CONDA_SOLVER=classic for conda-standalone
Expand All @@ -1258,7 +1263,7 @@ Section "Install"
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("CONDA_SOLVER", "classic").r0'
SetDetailsPrint TextOnly
${Print} "Checking virtual specs compatibility: @VIRTUAL_SPECS_DEBUG@"
push '"$INSTDIR\_conda.exe" create --dry-run --prefix "$INSTDIR\envs\_virtual_specs_checks" --offline @VIRTUAL_SPECS@'
push '"$INSTDIR\_conda.exe" create --dry-run --prefix "$INSTDIR\envs\_virtual_specs_checks" --offline @VIRTUAL_SPECS@ @NO_RCS_ARG@'
push 'Failed to check virtual specs: @VIRTUAL_SPECS_DEBUG@'
push 'WithLog'
call AbortRetryNSExecWait
Expand Down Expand Up @@ -1320,7 +1325,7 @@ Section "Install"

${If} $Ana_ClearPkgCache_State = ${BST_CHECKED}
${Print} "Clearing package cache..."
push '"$INSTDIR\_conda.exe" clean --all --force-pkgs-dirs --yes'
push '"$INSTDIR\_conda.exe" clean --all --force-pkgs-dirs --yes @NO_RCS_ARG@'
push 'Failed to clear package cache'
push 'WithLog'
call AbortRetryNSExecWait
Expand Down Expand Up @@ -1452,6 +1457,11 @@ Section "Uninstall"
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_VER", "$0").r0'
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_PLAT", "${PLATFORM}").r0'
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_TYPE", "EXE").r0'
${If} ${Silent}
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_UNATTENDED", "1").r0'
${Else}
System::Call 'kernel32::SetEnvironmentVariable(t,t)i("INSTALLER_UNATTENDED", "0").r0'
${EndIf}

!insertmacro AbortRetryNSExecWaitLibNsisCmd "pre_uninstall"
!insertmacro AbortRetryNSExecWaitLibNsisCmd "rmpath"
Expand Down
2 changes: 1 addition & 1 deletion constructor/osx/prepare_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ "__VIRTUAL_SPECS__" != "" ]; then
notify 'Checking virtual specs compatibility: __VIRTUAL_SPECS__'
CONDA_SOLVER="classic" \
CONDA_PKGS_DIRS="$(mktemp -d)" \
"$CONDA_EXEC" create --dry-run --prefix "$PREFIX/envs/_virtual_specs_checks" --offline __VIRTUAL_SPECS__
"$CONDA_EXEC" create --dry-run --prefix "$PREFIX/envs/_virtual_specs_checks" --offline __VIRTUAL_SPECS__ __NO_RCS_ARG__
fi

# Create $PREFIX/.nonadmin if the installation didn't require superuser permissions
Expand Down
4 changes: 2 additions & 2 deletions constructor/osx/run_installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CONDA_SAFETY_CHECKS=disabled \
CONDA_EXTRA_SAFETY_CHECKS=no \
CONDA_CHANNELS=__CHANNELS__ \
CONDA_PKGS_DIRS="$PREFIX/pkgs" \
"$CONDA_EXEC" install --offline --file "$PREFIX/pkgs/env.txt" -yp "$PREFIX" $shortcuts; then
"$CONDA_EXEC" install --offline --file "$PREFIX/pkgs/env.txt" -yp "$PREFIX" $shortcuts __NO_RCS_ARG__; then
echo "ERROR: could not complete the conda install"
exit 1
fi
Expand Down Expand Up @@ -94,7 +94,7 @@ for env_pkgs in "${PREFIX}"/pkgs/envs/*/; do
CONDA_EXTRA_SAFETY_CHECKS=no \
CONDA_CHANNELS="$env_channels" \
CONDA_PKGS_DIRS="$PREFIX/pkgs" \
"$CONDA_EXEC" install --offline --file "${env_pkgs}env.txt" -yp "$PREFIX/envs/$env_name" $env_shortcuts || exit 1
"$CONDA_EXEC" install --offline --file "${env_pkgs}env.txt" -yp "$PREFIX/envs/$env_name" $env_shortcuts __NO_RCS_ARG__ || exit 1
# Move the prepackaged history file into place
mv "${env_pkgs}/conda-meta/history" "$PREFIX/envs/$env_name/conda-meta/history"
rm -f "${env_pkgs}env.txt"
Expand Down
1 change: 1 addition & 0 deletions constructor/osx/run_user_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export INSTALLER_NAME="__NAME__"
export INSTALLER_VER="__VERSION__"
export INSTALLER_PLAT="__PLAT__"
export INSTALLER_TYPE="PKG"
export INSTALLER_UNATTENDED="?"
export PRE_OR_POST="__PRE_OR_POST__"
_SCRIPT_ENV_VARIABLES_='' # Templated extra environment variable(s)

Expand Down
1 change: 1 addition & 0 deletions constructor/osxpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ def move_script(src, dst, info, ensure_shebang=False, user_script_type=None):
'ENABLE_SHORTCUTS': str(info['_enable_shortcuts']).lower(),
'REGISTER_ENVS': str(info.get("register_envs", True)).lower(),
'VIRTUAL_SPECS': shlex.join(info.get("virtual_specs", ())),
'NO_RCS_ARG': info.get('_ignore_condarcs_arg', ''),
}
data = preprocess(data, ppd)
custom_variables = info.get('script_env_variables', {})
Expand Down
3 changes: 2 additions & 1 deletion constructor/shar.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ def get_header(conda_exec, tarball, info):
'SHORTCUTS': shortcuts_flags(info),
'REGISTER_ENVS': str(info.get("register_envs", True)).lower(),
'TOTAL_INSTALLATION_SIZE_KB': str(approx_size_kb(info, "total")),
'VIRTUAL_SPECS': shlex.join(info.get("virtual_specs", ()))
'VIRTUAL_SPECS': shlex.join(info.get("virtual_specs", ())),
'NO_RCS_ARG': info.get('_ignore_condarcs_arg', ''),
}
if has_license:
replace['LICENSE'] = read_ascii_only(info['license_file'])
Expand Down
17 changes: 12 additions & 5 deletions constructor/winexe.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ def setup_envs_commands(info, dir_path):
# Run conda install
${{If}} $Ana_CreateShortcuts_State = ${{BST_CHECKED}}
${{Print}} "Installing packages for {name}, creating shortcuts if necessary..."
push '"$INSTDIR\_conda.exe" install --offline -yp "{prefix}" --file "{env_txt}" {shortcuts}'
push '"$INSTDIR\_conda.exe" install --offline -yp "{prefix}" --file "{env_txt}" {shortcuts} {no_rcs_arg}'
${{Else}}
${{Print}} "Installing packages for {name}..."
push '"$INSTDIR\_conda.exe" install --offline -yp "{prefix}" --file "{env_txt}" --no-shortcuts'
push '"$INSTDIR\_conda.exe" install --offline -yp "{prefix}" --file "{env_txt}" --no-shortcuts {no_rcs_arg}'
${{EndIf}}
push 'Failed to link extracted packages to {prefix}!'
push 'WithLog'
Expand Down Expand Up @@ -167,6 +167,7 @@ def setup_envs_commands(info, dir_path):
channels=','.join(get_final_channels(info)),
shortcuts=shortcuts_flags(info),
register_envs=str(info.get("register_envs", True)).lower(),
no_rcs_arg=info.get("_ignore_condarcs_arg", ""),
).splitlines()
# now we generate one more block per extra env, if present
for env_name in info.get("_extra_envs_info", {}):
Expand All @@ -190,6 +191,7 @@ def setup_envs_commands(info, dir_path):
channels=",".join(get_final_channels(channel_info)),
shortcuts=shortcuts_flags(env_info),
register_envs=str(info.get("register_envs", True)).lower(),
no_rcs_arg=info.get("_ignore_condarcs_arg", ""),
).splitlines()

return [line.strip() for line in lines]
Expand Down Expand Up @@ -404,6 +406,7 @@ def make_nsi(
# This is the same but without quotes so we can print it fine
('@VIRTUAL_SPECS_DEBUG@', " ".join([spec for spec in info.get("virtual_specs", ())])),
('@LICENSEFILENAME@', basename(info.get('license_file', 'placeholder_license.txt'))),
('@NO_RCS_ARG@', info.get('_ignore_condarcs_arg', '')),
]:
data = data.replace(key, value)

Expand Down Expand Up @@ -496,9 +499,13 @@ def create(info, verbose=False):
args = [MAKENSIS_EXE, verbosity, nsi]
logger.info('Calling: %s', args)
process = run(args, capture_output=True, text=True)
logger.debug("makensis stdout:\n'%s'", process.stdout)
logger.debug("makensis stderr:\n'%s'", process.stderr)
process.check_returncode()
if process.returncode:
logger.info("makensis stdout:\n'%s'", process.stdout)
logger.error("makensis stderr:\n'%s'", process.stderr)
sys.exit(f"Failed to run {args}. Exit code: {process.returncode}.")
else:
logger.debug("makensis stdout:\n'%s'", process.stdout)
logger.debug("makensis stderr:\n'%s'", process.stderr)

if signing_tool:
signing_tool.verify_signature(info['_outpath'])
Expand Down
3 changes: 3 additions & 0 deletions docs/source/construct-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,13 +478,16 @@ Path to a post-install script. Some notes:
installation path is available as `${PREFIX}`. Installer metadata is
available in the `${INSTALLER_NAME}`, `${INSTALLER_VER}`, `${INSTALLER_PLAT}`
environment variables. `${INSTALLER_TYPE}` is set to `SH`.
`${INSTALLER_UNATTENDED}` will be `"1"` in batch mode (`-b`), `"0"` otherwise.
- For PKG installers, the shebang line is respected if present;
otherwise, `bash` is used. The same variables mentioned for `sh`
installers are available here. `${INSTALLER_TYPE}` is set to `PKG`.
`${INSTALLER_UNATTENDED}` is not supported and always set to `"?"`.
- For Windows `.exe` installers, the script must be a `.bat` file.
Installation path is available as `%PREFIX%`. Metadata about
the installer can be found in the `%INSTALLER_NAME%`, `%INSTALLER_VER%`,
`%INSTALLER_PLAT%` environment variables. `%INSTALLER_TYPE%` is set to `EXE`.
`%INSTALLER_UNATTENDED%` will be `"1"` in silent mode (`/S`), `"0"` otherwise.

If necessary, you can activate the installed `base` environment like this:

Expand Down
1 change: 1 addition & 0 deletions examples/scripts/post_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ if not "%INSTALLER_NAME%" == "Scripts" exit 1
if not "%INSTALLER_VER%" == "X" exit 1
if not "%INSTALLER_PLAT%" == "win-64" exit 1
if not "%INSTALLER_TYPE%" == "EXE" exit 1
if not "%INSTALLER_UNATTENDED%" == "1" exit 1
if "%PREFIX%" == "" exit 1
if not "%CUSTOM_VARIABLE_1%" == "FIR$T-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
if not "%CUSTOM_VARIABLE_2%" == "$ECOND-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
Expand Down
5 changes: 5 additions & 0 deletions examples/scripts/post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ echo "INSTALLER_NAME=${INSTALLER_NAME}"
echo "INSTALLER_VER=${INSTALLER_VER}"
echo "INSTALLER_PLAT=${INSTALLER_PLAT}"
echo "INSTALLER_TYPE=${INSTALLER_TYPE}"
echo "INSTALLER_UNATTENDED=${INSTALLER_UNATTENDED}"
echo "CUSTOM_VARIABLE_1=${CUSTOM_VARIABLE_1}"
echo "CUSTOM_VARIABLE_2=${CUSTOM_VARIABLE_2}"
echo "PREFIX=${PREFIX}"
Expand All @@ -20,6 +21,10 @@ test "${CUSTOM_VARIABLE_1}" = 'FIR$T-CUSTOM_'\''STRING'\'' WITH SPACES AND @*! "
# shellcheck disable=SC2016 # String interpolation disabling is deliberate
test "${CUSTOM_VARIABLE_2}" = '$ECOND-CUSTOM_'\''STRING'\'' WITH SPACES AND @*! "CHARACTERS"'

if [[ "${INSTALLER_TYPE}" == "SH" ]]; then
test "${INSTALLER_UNATTENDED}" = "1"
fi

if [[ $(uname -s) == Linux ]]; then
if [[ ${INSTALLER_PLAT} != linux-* ]]; then
exit 1
Expand Down
1 change: 1 addition & 0 deletions examples/scripts/pre_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if not "%INSTALLER_NAME%" == "Scripts" exit 1
if not "%INSTALLER_VER%" == "X" exit 1
if not "%INSTALLER_PLAT%" == "win-64" exit 1
if not "%INSTALLER_TYPE%" == "EXE" exit 1
if not "%INSTALLER_UNATTENDED%" == "1" exit 1
if "%PREFIX%" == "" exit 1
if not "%CUSTOM_VARIABLE_1%" == "FIR$T-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
if not "%CUSTOM_VARIABLE_2%" == "$ECOND-CUSTOM_STRING WITH SPACES AND @*! CHARACTERS" exit 1
Expand Down
5 changes: 5 additions & 0 deletions examples/scripts/pre_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ echo "INSTALLER_NAME=${INSTALLER_NAME}"
echo "INSTALLER_VER=${INSTALLER_VER}"
echo "INSTALLER_PLAT=${INSTALLER_PLAT}"
echo "INSTALLER_TYPE=${INSTALLER_TYPE}"
echo "INSTALLER_UNATTENDED=${INSTALLER_UNATTENDED}"
echo "CUSTOM_VARIABLE_1=${CUSTOM_VARIABLE_1}"
echo "CUSTOM_VARIABLE_2=${CUSTOM_VARIABLE_2}"
echo "PREFIX=${PREFIX}"
Expand All @@ -17,6 +18,10 @@ test "${CUSTOM_VARIABLE_1}" = 'FIR$T-CUSTOM_'\''STRING'\'' WITH SPACES AND @*! "
# shellcheck disable=SC2016 # String interpolation disabling is deliberate
test "${CUSTOM_VARIABLE_2}" = '$ECOND-CUSTOM_'\''STRING'\'' WITH SPACES AND @*! "CHARACTERS"'

if [[ "${INSTALLER_TYPE}" == "SH" ]]; then
test "${INSTALLER_UNATTENDED}" = "1"
fi

if [[ $(uname -s) == Linux ]]; then
if [[ ${INSTALLER_PLAT} != linux-* ]]; then
exit 1
Expand Down
Loading

0 comments on commit 21a84ec

Please sign in to comment.