#!/bin/sh
#
# NAME: Miniconda3
# VER: py39_4.12.0
# PLAT: osx-64
# LINES: 594
# MD5: 3d3dab6575a3b33c53365bbf963b2402
unset DYLD_LIBRARY_PATH
if ! echo "$0" | grep '\.sh$' > /dev/null; then
printf 'Please run using "bash" or "sh", but not "." or "source"\\n' >&2
return 1
fi
# Determine RUNNING_SHELL; if SHELL is non-zero use that.
if [ -n "$SHELL" ]; then
RUNNING_SHELL="$SHELL"
else
if [ "$(uname)" = "Darwin" ]; then
RUNNING_SHELL=/bin/bash
else
if [ -d /proc ] && [ -r /proc ] && [ -d /proc/$$ ] && [ -r /proc/$$ ] && [ -L /proc/$$/exe ] && [ -r /proc/$$/exe ]; then
RUNNING_SHELL=$(readlink /proc/$$/exe)
fi
if [ -z "$RUNNING_SHELL" ] || [ ! -f "$RUNNING_SHELL" ]; then
RUNNING_SHELL=$(ps -p $$ -o args= | sed 's|^-||')
case "$RUNNING_SHELL" in
*/*)
;;
default)
RUNNING_SHELL=$(which "$RUNNING_SHELL")
;;
esac
fi
fi
fi
# Some final fallback locations
if [ -z "$RUNNING_SHELL" ] || [ ! -f "$RUNNING_SHELL" ]; then
if [ -f /bin/bash ]; then
RUNNING_SHELL=/bin/bash
else
if [ -f /bin/sh ]; then
RUNNING_SHELL=/bin/sh
fi
fi
fi
if [ -z "$RUNNING_SHELL" ] || [ ! -f "$RUNNING_SHELL" ]; then
printf 'Unable to determine your shell. Please set the SHELL env. var and re-run\\n' >&2
exit 1
fi
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
THIS_FILE=$(basename "$0")
THIS_PATH="$THIS_DIR/$THIS_FILE"
PREFIX=$HOME/miniconda3
BATCH=0
FORCE=0
SKIP_SCRIPTS=0
TEST=0
REINSTALL=0
USAGE="
usage: $0 [options]
Installs Miniconda3 py39_4.12.0
-b run install in batch mode (without manual intervention),
it is expected the license terms are agreed upon
-f no error if install prefix already exists
-h print this help message and exit
-p PREFIX install prefix, defaults to $PREFIX, must not contain spaces.
-s skip running pre/post-link/install scripts
-u update an existing installation
-t run package tests after installation (may install conda-build)
"
if which getopt > /dev/null 2>&1; then
OPTS=$(getopt bfhp:sut "$*" 2>/dev/null)
if [ ! $? ]; then
printf "%s\\n" "$USAGE"
exit 2
fi
eval set -- "$OPTS"
while true; do
case "$1" in
-h)
printf "%s\\n" "$USAGE"
exit 2
;;
-b)
BATCH=1
shift
;;
-f)
FORCE=1
shift
;;
-p)
PREFIX="$2"
shift
shift
;;
-s)
SKIP_SCRIPTS=1
shift
;;
-u)
FORCE=1
shift
;;
-t)
TEST=1
shift
;;
--)
shift
break
;;
*)
printf "ERROR: did not recognize option '%s', please try -h\\n" "$1"
exit 1
;;
esac
done
else
while getopts "bfhp:sut" x; do
case "$x" in
h)
printf "%s\\n" "$USAGE"
exit 2
;;
b)
BATCH=1
;;
f)
FORCE=1
;;
p)
PREFIX="$OPTARG"
;;
s)
SKIP_SCRIPTS=1
;;
u)
FORCE=1
;;
t)
TEST=1
;;
?)
printf "ERROR: did not recognize option '%s', please try -h\\n" "$x"
exit 1
;;
esac
done
fi
determine_glibc () {
# first parameter is min version; default minimum version to current x86_64
minimum_glibc_version=${1:-"2.17"}
# ldd seems to be consistent in that the version is always at the end after the last space.
# check that system_glibc is set to a meaningful value, e.g., 2.12, 2.17, 2.31, ...
system_glibc=$(ldd --version 2> /dev/null | head -n1 | awk '$NF ~ /^[0-9]+\.[0-9]+$/ {print $NF}')
if [ -n "${system_glibc}" ]; then
if [ "$(printf "${minimum_glibc_version}\n${system_glibc}\n" | sort -V | head -n1)" != "${minimum_glibc_version}" ]; then
printf "WARNING:\\n"
printf " The installer is not compatible with the version of the Linux distribution\\n"
printf " installed on your system. The version of GLIBC is no longer supported.\\n"
printf " Found version ${system_glibc}, which is less than ${minimum_glibc_version}\\n"
printf "Aborting installation.\\n"
exit 2
fi
fi
}
if [ "$BATCH" = "0" ] # interactive mode
then
determine_glibc "2.17"
if [ "$(uname -m)" != "x86_64" ]; then
printf "WARNING:\\n"
printf " Your operating system appears not to be 64-bit, but you are trying to\\n"
printf " install a 64-bit version of Miniconda3.\\n"
printf " Are sure you want to continue the installation? [yes|no]\\n"
printf "[no] >>> "
read -r ans
if [ "$ans" != "yes" ] && [ "$ans" != "Yes" ] && [ "$ans" != "YES" ] && \
[ "$ans" != "y" ] && [ "$ans" != "Y" ]
then
printf "Aborting installation\\n"
exit 2
fi
fi
if [ "$(uname)" != "Darwin" ]; then
printf "WARNING:\\n"
printf " Your operating system does not appear to be macOS, \\n"
printf " but you are trying to install a macOS version of Miniconda3.\\n"
printf " Are sure you want to continue the installation? [yes|no]\\n"
printf "[no] >>> "
read -r ans
if [ "$ans" != "yes" ] && [ "$ans" != "Yes" ] && [ "$ans" != "YES" ] && \
[ "$ans" != "y" ] && [ "$ans" != "Y" ]
then
printf "Aborting installation\\n"
exit 2
fi
fi
printf "\\n"
printf "Welcome to Miniconda3 py39_4.12.0\\n"
printf "\\n"
printf "In order to continue the installation process, please review the license\\n"
printf "agreement.\\n"
printf "Please, press ENTER to continue\\n"
printf ">>> "
read -r dummy
pager="cat"
if command -v "more" > /dev/null 2>&1; then
pager="more"
fi
"$pager" <<EOF
======================================
End User License Agreement - Miniconda
======================================
Copyright 2015-2022, Anaconda, Inc.
All rights reserved under the 3-clause BSD License:
This End User License Agreement (the "Agreement") is a legal agreement between you and Anaconda, Inc. ("Anaconda") and governs your use of Miniconda.
Subject to the terms of this Agreement, Anaconda hereby grants you a non-exclusive, non-transferable license to:
* Install and use the Miniconda,
* Modify and create derivative works of sample source code delivered in Miniconda subject to the Terms of Service for the Repository (as defined hereinafter) available at https://www.anaconda.com/terms-of-service, and
* Redistribute code files in source (if provided to you by Anaconda as source) and binary forms, with or without modification subject to the requirements set forth below.
Anaconda may, at its option, make available patches, workarounds or other updates to Miniconda. Unless the updates are provided with their separate governing terms, they are deemed part of Miniconda licensed to you as provided in this Agreement. This Agreement does not entitle you to any support for Miniconda.
Anaconda reserves all rights not expressly granted to you in this Agreement.
Redistribution and use in source and binary forms, with or without modifica