#!/bin/sh
#
# Created by constructor 3.4.3
#
# NAME: Miniforge3
# VER: 23.1.0-1
# PLAT: osx-arm64
# MD5: daf4638548b003cd8f8133a8c912504f
set -eu
unset DYLD_LIBRARY_PATH DYLD_FALLBACK_LIBRARY_PATH
if ! echo "$0" | grep '\.sh$' > /dev/null; then
printf 'Please run using "bash"/"dash"/"sh"/"zsh", but not "." or "source".\n' >&2
return 1
fi
# Export variables to make installer metadata available to pre/post install scripts
# NOTE: If more vars are added, make sure to update the examples/scripts tests too
export INSTALLER_NAME='Miniforge3'
export INSTALLER_VER='23.1.0-1'
export INSTALLER_PLAT='osx-arm64'
export INSTALLER_TYPE="SH"
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
THIS_FILE=$(basename "$0")
THIS_PATH="$THIS_DIR/$THIS_FILE"
PREFIX="$HOME/miniforge3"
BATCH=0
FORCE=0
KEEP_PKGS=1
SKIP_SCRIPTS=0
TEST=0
REINSTALL=0
USAGE="
usage: $0 [options]
Installs ${INSTALLER_NAME} ${INSTALLER_VER}
-b run install in batch mode (without manual intervention),
it is expected the license terms (if any) 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)
"
# We used to have a getopt version here, falling back to getopts if needed
# However getopt is not standardized and the version on Mac has different
# behaviour. getopts is good enough for what we need :)
# More info: https://unix.stackexchange.com/questions/62950/
while getopts "bifhkp:sut" x; do
case "$x" in
h)
printf "%s\\n" "$USAGE"
exit 2
;;
b)
BATCH=1
;;
i)
BATCH=0
;;
f)
FORCE=1
;;
k)
KEEP_PKGS=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
# For testing, keep the package cache around longer
CLEAR_AFTER_TEST=0
if [ "$TEST" = "1" ] && [ "$KEEP_PKGS" = "0" ]; then
CLEAR_AFTER_TEST=1
KEEP_PKGS=1
fi
if [ "$BATCH" = "0" ] # interactive mode
then
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 %s.\\n" "${INSTALLER_NAME}"
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 %s %s\\n" "${INSTALLER_NAME}" "${INSTALLER_VER}"
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'
Miniforge installer code uses BSD-3-Clause license as stated below.
Binary packages that come with it have their own licensing terms
and by installing miniforge you agree to the licensing terms of individual
packages as well. They include different OSI-approved licenses including
the GNU General Public License and can be found in pkgs/<pkg-name>/info/licenses
folders.
Miniforge installer comes with a boostrapping executable that is used
when installing miniforge and is deleted after miniforge is installed.
The bootstrapping executable uses micromamba, cli11, cpp-filesystem,
curl, c-ares, krb5, libarchive, libev, lz4, nghttp2, openssl, libsolv,
nlohmann-json, reproc and zstd which are licensed under BSD-3-Clause,
MIT and OpenSSL licenses. Licenses and copyright notices of these
projects can be found at the following URL.
https://github.com/conda-forge/micromamba-feedstock/tree/master/recipe.
=============================================================================
Copyright (c) 2019-2022, conda-forge
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EOF
printf "\\n"
printf "Do you accept the license terms? [yes|no]\\n"
printf "[no] >>> "
read -r ans
while [ "$ans" != "yes" ] && [ "$ans" != "Yes" ] && [ "$ans" != "YES" ] && \
[ "$ans" != "no" ] && [ "$ans" != "No" ] && [ "$ans" != "NO" ]
do
printf "Please answer 'yes' or 'no':'\\n"
printf ">>> "
read -r ans
done
if [ "$ans" != "yes" ] && [ "$ans" != "Yes" ] && [ "$ans" != "YES" ]
then
printf "The license agreement wasn't approved, aborting installation.\\n"
exit 2
fi
printf "\\n"
printf "%s will now be installed into this location:\\n" "${INSTALLER_NAME}"
printf "%s\\n" "$PREFIX"
printf "\\n"
printf " - Press ENTER to confirm the location\\n"
printf " - Press CTRL-C to abort the installation\\n"
printf " - Or specify a different location below\\n"
printf "\\n"
printf "[%s] >>> " "$PREFIX"
read -r user_prefix
if [ "$user_prefix" != "" ]; then
case "$user_prefix" in
*\ * )
printf "ERROR: Cannot install into directories with spaces\\n" >&2
exit 1
;;
*)
eval PREFIX="$user_prefix"
;;
esac
fi
fi # !BATCH
case "$PREFIX" in
*\ * )
printf "ERROR: Cannot install into directories with spaces\\n" >&2
exit 1
;;
esac
if [ "$FORCE" = "0" ] && [ -e "$PREFIX" ]; then
printf "ERROR: File or directory already exists: '%s'\\n" "$PREFIX" >&2
printf "If you want to update an existing installation, use the -u option.\\n" >&2
exit 1
elif [ "$FORCE" = "1" ] && [ -e "$PREFIX" ]; then
REINSTALL=1
fi
if ! mkdir -p "$PREFIX"; then
printf "ERROR: Could not create directory: '%s'\\n" "$PREFIX" >&2
exit 1
fi
# pwd does not convert two leading slashes to one
# https://github.com/conda/constructor/issues/284
PREFIX=$(cd "$PREFIX"; p