2022-08-10 05:34:40 -05:00
|
|
|
# shellcheck shell=bash
|
|
|
|
|
2020-03-12 10:22:23 -05:00
|
|
|
_setup_env() {
|
|
|
|
echo "Setting up the environment..."
|
2022-08-10 05:34:40 -05:00
|
|
|
WD=$(cd "$(dirname "$1")" && pwd)
|
2020-03-12 10:22:23 -05:00
|
|
|
SOURCEDIR=$(realpath "${WD}/../..")
|
|
|
|
BUILDROOT=$(realpath "${WD}/../../$2-build")
|
|
|
|
DESKTOPROOT=${BUILDROOT}/desktop
|
|
|
|
METAROOT=${BUILDROOT}/meta
|
|
|
|
SERVERROOT=${BUILDROOT}/server
|
|
|
|
WEBROOT=${BUILDROOT}/web
|
|
|
|
DISTROOT=$(realpath "${WD}/../../dist")
|
2024-02-09 04:55:03 -06:00
|
|
|
APP_RELEASE=$(grep "^APP_RELEASE" web/version.py | cut -d"=" -f2 | sed 's/ //g')
|
|
|
|
APP_REVISION=$(grep "^APP_REVISION" web/version.py | cut -d"=" -f2 | sed 's/ //g')
|
|
|
|
APP_NAME=$(grep "^APP_NAME" web/branding.py | cut -d"=" -f2 | sed "s/'//g" | sed 's/^ //' | sed 's/ //g' | tr '[:upper:]' '[:lower:]')
|
2020-03-12 10:22:23 -05:00
|
|
|
APP_LONG_VERSION=${APP_RELEASE}.${APP_REVISION}
|
2024-02-09 04:55:03 -06:00
|
|
|
APP_SUFFIX=$(grep "^APP_SUFFIX" web/version.py | cut -d"=" -f2 | sed 's/ //g' | sed "s/'//g")
|
2022-08-10 09:54:51 -05:00
|
|
|
if [ -n "${APP_SUFFIX}" ]; then
|
2020-03-12 10:22:23 -05:00
|
|
|
APP_LONG_VERSION=${APP_LONG_VERSION}-${APP_SUFFIX}
|
|
|
|
fi
|
2023-03-17 07:17:53 -05:00
|
|
|
|
|
|
|
# Setting up the correct Python version for Ubuntu 18 and EL-8, which have
|
|
|
|
# new Python versions installed parallel to the old ones.
|
|
|
|
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F "=" '{ print $2 }' | sed 's/"//g' | awk -F "." '{ print $1 }')
|
|
|
|
SYSTEM_PYTHON_PATH='/usr/bin/python3'
|
2024-05-23 04:04:08 -05:00
|
|
|
PYTHON_BINARY=$("${SYSTEM_PYTHON_PATH}" -c "import sys; print('python%d.%.d' % (sys.version_info.major, sys.version_info.minor))")
|
2024-05-28 01:20:21 -05:00
|
|
|
PYTHON_BINARY_WITHOUT_DOTS='python3'
|
2023-03-27 07:38:02 -05:00
|
|
|
if [ "$2" == 'redhat' ] && [ "${OS_VERSION}" == "8" ]; then
|
2023-03-17 07:17:53 -05:00
|
|
|
SYSTEM_PYTHON_PATH='/usr/bin/python3.9'
|
|
|
|
PYTHON_BINARY='python3.9'
|
2024-05-28 01:20:21 -05:00
|
|
|
PYTHON_BINARY_WITHOUT_DOTS='python39'
|
2023-03-17 07:17:53 -05:00
|
|
|
fi
|
2020-03-12 10:22:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
_cleanup() {
|
|
|
|
echo "Cleaning up the old environment and app..."
|
2022-08-10 05:34:40 -05:00
|
|
|
if test -f "${SOURCEDIR}/runtime/pgAdmin4"; then
|
|
|
|
rm -rf "${SOURCEDIR}/runtime/pgAdmin4"
|
2020-03-12 10:22:23 -05:00
|
|
|
fi
|
2022-08-10 05:34:40 -05:00
|
|
|
if test -d "${BUILDROOT}"; then
|
|
|
|
rm -rf "${BUILDROOT}"
|
2020-03-12 10:22:23 -05:00
|
|
|
fi
|
2022-08-10 05:34:40 -05:00
|
|
|
rm -f "${DISTROOT}/pgadmin4"*".$1"
|
2020-03-12 10:22:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
_setup_dirs() {
|
|
|
|
echo "Creating output directories..."
|
2022-08-10 05:34:40 -05:00
|
|
|
test -d "${BUILDROOT}" || mkdir "${BUILDROOT}"
|
|
|
|
test -d "${DESKTOPROOT}" || mkdir "${DESKTOPROOT}"
|
|
|
|
test -d "${METAROOT}" || mkdir "${METAROOT}"
|
|
|
|
test -d "${SERVERROOT}" || mkdir "${SERVERROOT}"
|
|
|
|
test -d "${WEBROOT}" || mkdir "${WEBROOT}"
|
|
|
|
test -d "${DISTROOT}" || mkdir "${DISTROOT}"
|
2020-03-12 10:22:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
_create_python_virtualenv() {
|
|
|
|
echo "Creating the virtual environment..."
|
|
|
|
|
2022-08-10 05:34:40 -05:00
|
|
|
cd "${SERVERROOT}" || exit
|
2020-03-12 10:22:23 -05:00
|
|
|
|
|
|
|
# Create the required directories
|
|
|
|
mkdir -p "usr/${APP_NAME}"
|
2022-08-10 05:34:40 -05:00
|
|
|
cd "usr/${APP_NAME}" || exit
|
2020-03-12 10:22:23 -05:00
|
|
|
|
|
|
|
# Create the blank venv
|
2023-03-17 08:52:14 -05:00
|
|
|
"${SYSTEM_PYTHON_PATH}" -m venv venv
|
2022-08-10 05:34:40 -05:00
|
|
|
# shellcheck disable=SC1091
|
2023-03-17 07:17:53 -05:00
|
|
|
. venv/bin/activate
|
2020-03-12 10:22:23 -05:00
|
|
|
|
2021-01-29 02:08:27 -06:00
|
|
|
# Make sure we have the wheel package present, as well as the latest pip
|
|
|
|
pip3 install --upgrade pip
|
2023-12-18 04:36:19 -06:00
|
|
|
pip3 install setuptools
|
2020-06-12 05:42:35 -05:00
|
|
|
pip3 install wheel
|
|
|
|
|
|
|
|
# Install the requirements
|
Update SQLAlchemy, Flask, Flask-SQLAlchemy, and other packages to current versions. #5901
- Update Flask, Flask-SQLAlchemy, Flask-Babel, Flask-Security-Too, Flask-SocketIO, pytz, psutil, SQLAlchemy, bcrypt, cryptography, eventlet, Authlib, requests python packages
- Remove pinned dnspython, Werkzeug packages from requirements.txt
2023-03-15 01:27:16 -05:00
|
|
|
pip3 install --no-cache-dir --no-binary psycopg -r "${SOURCEDIR}/requirements.txt"
|
2020-03-12 10:22:23 -05:00
|
|
|
|
2021-03-05 03:58:30 -06:00
|
|
|
# Fixup the paths in the venv activation scripts
|
|
|
|
sed -i 's/VIRTUAL_ENV=.*/VIRTUAL_ENV="\/usr\/pgadmin4\/venv"/g' venv/bin/activate
|
|
|
|
sed -i 's/setenv VIRTUAL_ENV .*/setenv VIRTUAL_ENV "\/usr\/pgadmin4\/venv"/g' venv/bin/activate.csh
|
|
|
|
sed -i 's/set -gx VIRTUAL_ENV .*/set -gx VIRTUAL_ENV "\/usr\/pgadmin4\/venv"/g' venv/bin/activate.fish
|
|
|
|
|
2022-02-14 06:53:52 -06:00
|
|
|
# Remove __pycache__
|
|
|
|
find . -name "__pycache__" -type d -print0 | xargs -0 rm -rf
|
|
|
|
|
2021-03-05 04:15:45 -06:00
|
|
|
# Fixup hash bangs
|
|
|
|
sed -i 's/#!.*\/python3/#\!\/usr\/pgadmin4\/venv\/bin\/python3/g' venv/bin/*
|
|
|
|
|
2020-03-12 10:22:23 -05:00
|
|
|
# Figure out some paths for use when completing the venv
|
|
|
|
# Use "python3" here as we want the venv path
|
2023-12-18 01:57:05 -06:00
|
|
|
DIR_PYMODULES_PATH=$(python3 -c "from sysconfig import get_path; print(get_path('platstdlib'))")
|
2021-01-29 02:08:27 -06:00
|
|
|
|
2023-03-17 07:17:53 -05:00
|
|
|
# Use {SYSTEM_PYTHON_PATH} here as we want the system path
|
2022-08-10 05:34:40 -05:00
|
|
|
if [ "$1" == "debian" ]; then
|
2023-03-17 07:46:17 -05:00
|
|
|
PYSYSLIB_PATH=$("${SYSTEM_PYTHON_PATH}" -c "import sys; print('%s/lib/python%d.%.d' % (sys.prefix, sys.version_info.major, sys.version_info.minor))")
|
2020-03-18 07:51:11 -05:00
|
|
|
else
|
2023-03-17 07:46:17 -05:00
|
|
|
PYSYSLIB_PATH=$("${SYSTEM_PYTHON_PATH}" -c "import sys; print('%s/lib64/python%d.%.d' % (sys.prefix, sys.version_info.major, sys.version_info.minor))")
|
2020-03-18 07:51:11 -05:00
|
|
|
fi
|
|
|
|
|
2020-03-12 10:22:23 -05:00
|
|
|
# Symlink in the rest of the Python libs. This is required because the runtime
|
|
|
|
# will clear PYTHONHOME for safety, which has the side-effect of preventing
|
|
|
|
# it from finding modules that are not explicitly included in the venv
|
2022-08-10 05:34:40 -05:00
|
|
|
cd "${DIR_PYMODULES_PATH}" || exit
|
2020-03-12 10:22:23 -05:00
|
|
|
|
|
|
|
# Files
|
2022-08-10 05:34:40 -05:00
|
|
|
for FULLPATH in "${PYSYSLIB_PATH}"/*.py; do
|
2020-03-12 10:22:23 -05:00
|
|
|
FILE=${FULLPATH##*/}
|
2022-08-10 05:34:40 -05:00
|
|
|
if [ ! -e "${FILE}" ]; then
|
|
|
|
ln -s "${FULLPATH}" "${FILE}"
|
2020-03-12 10:22:23 -05:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Paths
|
2022-08-10 05:34:40 -05:00
|
|
|
for FULLPATH in "${PYSYSLIB_PATH}"/*/; do
|
2020-03-12 10:22:23 -05:00
|
|
|
FULLPATH=${FULLPATH%*/}
|
|
|
|
FILE=${FULLPATH##*/}
|
2022-08-10 05:34:40 -05:00
|
|
|
if [ ! -e "${FILE}" ]; then
|
|
|
|
ln -s "${FULLPATH}" "${FILE}"
|
2020-03-12 10:22:23 -05:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Remove tests
|
2022-08-10 05:34:40 -05:00
|
|
|
cd site-packages || exit
|
2020-03-12 10:22:23 -05:00
|
|
|
find . -name "test" -type d -print0 | xargs -0 rm -rf
|
|
|
|
find . -name "tests" -type d -print0 | xargs -0 rm -rf
|
|
|
|
|
|
|
|
# Link the python<version> directory to python so that the private environment path is found by the application.
|
2022-08-10 05:34:40 -05:00
|
|
|
if test -d "${DIR_PYMODULES_PATH}"; then
|
2022-08-10 09:54:51 -05:00
|
|
|
ln -s "$(basename "${DIR_PYMODULES_PATH}")" "${DIR_PYMODULES_PATH}/../python"
|
2020-03-12 10:22:23 -05:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
_build_runtime() {
|
2021-01-29 02:08:27 -06:00
|
|
|
echo "Assembling the desktop runtime..."
|
|
|
|
|
2024-07-01 00:57:42 -05:00
|
|
|
# Get a fresh copy of electron.
|
2021-01-29 02:08:27 -06:00
|
|
|
|
2024-07-01 00:57:42 -05:00
|
|
|
ELECTRON_ARCH="x64"
|
|
|
|
if [ "$(uname -m)" == "arm64" ]; then
|
|
|
|
ELECTRON_ARCH="arm64"
|
|
|
|
fi
|
2021-01-29 02:08:27 -06:00
|
|
|
|
2024-08-01 05:33:05 -05:00
|
|
|
ELECTRON_VERSION="$(npm info electron version)"
|
2021-12-08 23:09:21 -06:00
|
|
|
|
2022-08-10 05:34:40 -05:00
|
|
|
pushd "${BUILDROOT}" > /dev/null || exit
|
2021-01-29 02:08:27 -06:00
|
|
|
while true;do
|
2024-07-01 00:57:42 -05:00
|
|
|
wget "https://github.com/electron/electron/releases/download/v${ELECTRON_VERSION}/electron-v${ELECTRON_VERSION}-linux-${ELECTRON_ARCH}.zip" && break
|
|
|
|
rm "electron-v${ELECTRON_VERSION}-linux-${ELECTRON_ARCH}.zip"
|
2021-01-29 02:08:27 -06:00
|
|
|
done
|
2024-07-01 00:57:42 -05:00
|
|
|
unzip "electron-v${ELECTRON_VERSION}-linux-${ELECTRON_ARCH}.zip" -d "electron-v${ELECTRON_VERSION}-linux-${ELECTRON_ARCH}"
|
2022-08-10 05:34:40 -05:00
|
|
|
popd > /dev/null || exit
|
2021-01-29 02:08:27 -06:00
|
|
|
|
2024-07-01 00:57:42 -05:00
|
|
|
# Copy electron into the staging directory
|
2020-03-12 10:22:23 -05:00
|
|
|
mkdir -p "${DESKTOPROOT}/usr/${APP_NAME}/bin"
|
2021-01-29 02:08:27 -06:00
|
|
|
|
2022-05-31 05:32:21 -05:00
|
|
|
# Change the permission for others and group the same as the owner
|
2024-07-01 00:57:42 -05:00
|
|
|
chmod -R og=u "${BUILDROOT}/electron-v${ELECTRON_VERSION}-linux-${ELECTRON_ARCH}"/*
|
2022-05-31 05:32:21 -05:00
|
|
|
# Explicitly remove write permissions for others and group
|
2024-07-01 00:57:42 -05:00
|
|
|
chmod -R og-w "${BUILDROOT}/electron-v${ELECTRON_VERSION}-linux-${ELECTRON_ARCH}"/*
|
2022-05-31 05:32:21 -05:00
|
|
|
|
2024-07-01 00:57:42 -05:00
|
|
|
BUNDLEDIR="${DESKTOPROOT}/usr/${APP_NAME}/bin"
|
2021-01-29 02:08:27 -06:00
|
|
|
|
|
|
|
# WGET:
|
2024-07-01 00:57:42 -05:00
|
|
|
cp -r "${BUILDROOT}/electron-v${ELECTRON_VERSION}-linux-${ELECTRON_ARCH}"/* "${BUNDLEDIR}"
|
2021-01-29 02:08:27 -06:00
|
|
|
# WGET END
|
|
|
|
|
2024-07-01 00:57:42 -05:00
|
|
|
mv "${BUNDLEDIR}/electron" "${BUNDLEDIR}/${APP_NAME}"
|
2021-01-29 02:08:27 -06:00
|
|
|
|
2024-07-01 00:57:42 -05:00
|
|
|
mkdir -p "${BUNDLEDIR}/resources/app"
|
|
|
|
cp -r "${SOURCEDIR}/runtime/assets" "${BUNDLEDIR}/resources/app/assets"
|
|
|
|
cp -r "${SOURCEDIR}/runtime/src" "${BUNDLEDIR}/resources/app/src"
|
2021-01-29 02:08:27 -06:00
|
|
|
|
2024-07-01 00:57:42 -05:00
|
|
|
cp "${SOURCEDIR}/runtime/package.json" "${BUNDLEDIR}/resources/app"
|
2024-08-20 02:33:32 -05:00
|
|
|
cp "${SOURCEDIR}/runtime/.yarnrc.yml" "${BUNDLEDIR}/resources/app"
|
2024-08-01 02:48:01 -05:00
|
|
|
|
|
|
|
# Install the runtime node_modules
|
|
|
|
pushd "${BUNDLEDIR}/resources/app" > /dev/null || exit
|
|
|
|
yarn set version berry
|
|
|
|
yarn set version 3
|
|
|
|
yarn plugin import workspace-tools
|
|
|
|
yarn workspaces focus --production
|
|
|
|
|
2024-08-30 03:39:53 -05:00
|
|
|
# remove the yarn cache
|
|
|
|
rm -rf .yarn .yarn*
|
2024-08-01 02:48:01 -05:00
|
|
|
popd > /dev/null || exit
|
2021-01-29 02:08:27 -06:00
|
|
|
|
|
|
|
# Create the icon
|
|
|
|
mkdir -p "${DESKTOPROOT}/usr/share/icons/hicolor/128x128/apps/"
|
|
|
|
cp "${SOURCEDIR}/pkg/linux/pgadmin4-128x128.png" "${DESKTOPROOT}/usr/share/icons/hicolor/128x128/apps/${APP_NAME}.png"
|
|
|
|
mkdir -p "${DESKTOPROOT}/usr/share/icons/hicolor/64x64/apps/"
|
|
|
|
cp "${SOURCEDIR}/pkg/linux/pgadmin4-64x64.png" "${DESKTOPROOT}/usr/share/icons/hicolor/64x64/apps/${APP_NAME}.png"
|
|
|
|
mkdir -p "${DESKTOPROOT}/usr/share/icons/hicolor/48x48/apps/"
|
|
|
|
cp "${SOURCEDIR}/pkg/linux/pgadmin4-48x48.png" "${DESKTOPROOT}/usr/share/icons/hicolor/48x48/apps/${APP_NAME}.png"
|
|
|
|
mkdir -p "${DESKTOPROOT}/usr/share/icons/hicolor/32x32/apps/"
|
|
|
|
cp "${SOURCEDIR}/pkg/linux/pgadmin4-32x32.png" "${DESKTOPROOT}/usr/share/icons/hicolor/32x32/apps/${APP_NAME}.png"
|
|
|
|
mkdir -p "${DESKTOPROOT}/usr/share/icons/hicolor/16x16/apps/"
|
|
|
|
cp "${SOURCEDIR}/pkg/linux/pgadmin4-16x16.png" "${DESKTOPROOT}/usr/share/icons/hicolor/16x16/apps/${APP_NAME}.png"
|
|
|
|
|
2020-03-12 10:22:23 -05:00
|
|
|
mkdir -p "${DESKTOPROOT}/usr/share/applications"
|
2021-01-29 02:08:27 -06:00
|
|
|
cp "${SOURCEDIR}/pkg/linux/pgadmin4.desktop" "${DESKTOPROOT}/usr/share/applications"
|
2020-03-12 10:22:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
_build_docs() {
|
|
|
|
echo "Building the documentation..."
|
|
|
|
cd "${SERVERROOT}" && mkdir -p "usr/${APP_NAME}/share/docs/en_US/html"
|
2022-08-10 05:34:40 -05:00
|
|
|
cd "${SOURCEDIR}/docs/en_US" || exit
|
2020-03-12 10:22:23 -05:00
|
|
|
python3 build_code_snippet.py
|
2023-03-17 07:46:17 -05:00
|
|
|
SYS_PYTHONPATH=$("${SYSTEM_PYTHON_PATH}" -c "import sys; print(':'.join([p for p in sys.path if p]))")
|
2022-08-10 10:43:48 -05:00
|
|
|
# shellcheck disable=SC2153
|
2023-03-17 07:17:53 -05:00
|
|
|
PYTHONPATH=$PYTHONPATH:${SYS_PYTHONPATH} python3 -msphinx . "${SERVERROOT}/usr/${APP_NAME}/share/docs/en_US/html"
|
2020-03-12 10:22:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
_copy_code() {
|
|
|
|
echo "Copying the server code..."
|
|
|
|
|
2024-06-24 06:39:28 -05:00
|
|
|
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F "=" '{ print $2 }' | sed 's/"//g' | awk -F "." '{ print $1 }')
|
|
|
|
if [ "$1" == 'redhat' ] && [ "${OS_VERSION}" == "8" ]; then
|
2024-06-24 05:35:22 -05:00
|
|
|
echo "Setting file permission through umask..."
|
|
|
|
umask u+rwx,go+rx,go-w
|
|
|
|
fi
|
|
|
|
|
2020-03-12 10:22:23 -05:00
|
|
|
# Remove any TCL-related files that may cause us problems
|
|
|
|
find "${SERVERROOT}/usr/${APP_NAME}/venv/" -name "_tkinter*" -print0 | xargs -0 rm -rf
|
|
|
|
|
2022-08-10 05:34:40 -05:00
|
|
|
pushd "${SOURCEDIR}/web" > /dev/null || exit
|
2024-08-01 02:48:01 -05:00
|
|
|
yarn set version berry
|
|
|
|
yarn set version 3
|
2020-03-12 10:22:23 -05:00
|
|
|
yarn install
|
|
|
|
yarn run bundle
|
2022-08-10 05:34:40 -05:00
|
|
|
popd > /dev/null || exit
|
2020-03-12 10:22:23 -05:00
|
|
|
|
|
|
|
# copy the web directory to the bundle as it is required by runtime
|
|
|
|
cp -r "${SOURCEDIR}/web" "${SERVERROOT}/usr/${APP_NAME}/web/"
|
|
|
|
cp "${SOURCEDIR}/pkg/linux/config_distro.py" "${SERVERROOT}/usr/${APP_NAME}/web/"
|
2022-08-10 05:34:40 -05:00
|
|
|
cd "${SERVERROOT}/usr/${APP_NAME}/web/" || exit
|
2020-03-12 10:22:23 -05:00
|
|
|
rm -f pgadmin4.db config_local.*
|
2024-08-30 03:39:53 -05:00
|
|
|
rm -rf jest.config.js babel.* package.json .yarn* yarn* .editorconfig .eslint* node_modules/ regression/ tools/ pgadmin/static/js/generated/.cache
|
2020-03-12 10:22:23 -05:00
|
|
|
find . -name "tests" -type d -print0 | xargs -0 rm -rf
|
|
|
|
find . -name "feature_tests" -type d -print0 | xargs -0 rm -rf
|
|
|
|
find . -name "__pycache__" -type d -print0 | xargs -0 rm -rf
|
|
|
|
|
2020-07-17 11:06:16 -05:00
|
|
|
# License files
|
|
|
|
cp "${SOURCEDIR}/LICENSE" "${SERVERROOT}/usr/${APP_NAME}/"
|
|
|
|
cp "${SOURCEDIR}/DEPENDENCIES" "${SERVERROOT}/usr/${APP_NAME}/"
|
|
|
|
|
2020-03-12 10:22:23 -05:00
|
|
|
# Web setup script
|
|
|
|
mkdir -p "${WEBROOT}/usr/${APP_NAME}/bin/"
|
|
|
|
cp "${SOURCEDIR}/pkg/linux/setup-web.sh" "${WEBROOT}/usr/${APP_NAME}/bin/"
|
2021-03-08 05:17:55 -06:00
|
|
|
|
2021-11-23 03:16:47 -06:00
|
|
|
# Ensure our venv will use the correct Python interpreter, even if the
|
2021-03-08 05:17:55 -06:00
|
|
|
# user has configured an alternative default.
|
|
|
|
# DO THIS LAST!
|
2022-08-10 05:34:40 -05:00
|
|
|
cd "${SERVERROOT}/usr/${APP_NAME}/venv/bin" || exit
|
2023-03-17 07:46:17 -05:00
|
|
|
PYTHON_INTERPRETER=$("${SYSTEM_PYTHON_PATH}" -c "import os, sys; print(os.path.realpath(sys.executable))")
|
|
|
|
PYTHON_VERSION=$("${SYSTEM_PYTHON_PATH}" -c "import sys; print('%d.%d' % (sys.version_info.major, sys.version_info.minor))")
|
2021-03-08 05:17:55 -06:00
|
|
|
rm python && ln -s python3 python
|
2022-08-10 05:34:40 -05:00
|
|
|
rm "python${PYTHON_VERSION}" && ln -s python3 "python${PYTHON_VERSION}"
|
2021-03-08 05:17:55 -06:00
|
|
|
rm python3 && ln -s "${PYTHON_INTERPRETER}" python3
|
2020-03-12 10:22:23 -05:00
|
|
|
}
|
|
|
|
|
2023-08-03 05:38:59 -05:00
|
|
|
|
|
|
|
_generate_sbom() {
|
|
|
|
echo "Generating SBOMs..."
|
|
|
|
# Note that we don't generate an SBOM for the Meta package as it doesn't contain any files.
|
|
|
|
syft "${SERVERROOT}/" -o cyclonedx-json > "${SERVERROOT}/usr/${APP_NAME}/sbom-server.json"
|
|
|
|
syft "${DESKTOPROOT}/" -o cyclonedx-json > "${DESKTOPROOT}/usr/${APP_NAME}/sbom-desktop.json"
|
|
|
|
syft "${WEBROOT}/" -o cyclonedx-json > "${WEBROOT}/usr/${APP_NAME}/sbom-web.json"
|
2023-08-16 02:35:35 -05:00
|
|
|
}
|