mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
More Sonarqube fixes for macOS
This commit is contained in:
parent
0f11033989
commit
2bc60c9142
@ -1,12 +1,12 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
_setup_env() {
|
_setup_env() {
|
||||||
FUNCS_DIR=$(cd $(dirname "$0") && pwd)/../..
|
FUNCS_DIR=$(cd "$(dirname "$0")" && pwd)/../..
|
||||||
APP_RELEASE=$(grep "^APP_RELEASE" ${FUNCS_DIR}/web/config.py | cut -d"=" -f2 | sed 's/ //g')
|
APP_RELEASE=$(grep "^APP_RELEASE" "${FUNCS_DIR}/web/config.py" | cut -d"=" -f2 | sed 's/ //g')
|
||||||
APP_REVISION=$(grep "^APP_REVISION" ${FUNCS_DIR}/web/config.py | cut -d"=" -f2 | sed 's/ //g')
|
APP_REVISION=$(grep "^APP_REVISION" "${FUNCS_DIR}/web/config.py" | cut -d"=" -f2 | sed 's/ //g')
|
||||||
APP_NAME=$(grep "^APP_NAME" ${FUNCS_DIR}/web/config.py | cut -d"=" -f2 | sed "s/'//g" | sed 's/^ //')
|
APP_NAME=$(grep "^APP_NAME" "${FUNCS_DIR}/web/config.py" | cut -d"=" -f2 | sed "s/'//g" | sed 's/^ //')
|
||||||
APP_LONG_VERSION=${APP_RELEASE}.${APP_REVISION}
|
APP_LONG_VERSION=${APP_RELEASE}.${APP_REVISION}
|
||||||
APP_SUFFIX=$(grep "^APP_SUFFIX" ${FUNCS_DIR}/web/config.py | cut -d"=" -f2 | sed 's/ //g' | sed "s/'//g")
|
APP_SUFFIX=$(grep "^APP_SUFFIX" "${FUNCS_DIR}/web/config.py" | cut -d"=" -f2 | sed 's/ //g' | sed "s/'//g")
|
||||||
if [ -n "${APP_SUFFIX}" ]; then
|
if [ -n "${APP_SUFFIX}" ]; then
|
||||||
APP_LONG_VERSION=${APP_LONG_VERSION}-${APP_SUFFIX}
|
APP_LONG_VERSION=${APP_LONG_VERSION}-${APP_SUFFIX}
|
||||||
fi
|
fi
|
||||||
@ -94,6 +94,7 @@ _create_python_env() {
|
|||||||
|
|
||||||
# Fixup shebangs
|
# Fixup shebangs
|
||||||
cd "${BUNDLE_DIR}/Contents/Frameworks/Python.framework/Versions/Current/bin" || exit
|
cd "${BUNDLE_DIR}/Contents/Frameworks/Python.framework/Versions/Current/bin" || exit
|
||||||
|
# shellcheck disable=SC2016
|
||||||
grep -RiIl 'mac-build' ./* | xargs sed -i '' 's/\/.*\/python3\./\$(dirname \"$0\")\/python3./g'
|
grep -RiIl 'mac-build' ./* | xargs sed -i '' 's/\/.*\/python3\./\$(dirname \"$0\")\/python3./g'
|
||||||
|
|
||||||
# Remove some things we don't need
|
# Remove some things we don't need
|
||||||
@ -146,10 +147,10 @@ _fixup_imports() {
|
|||||||
local TODO TODO_OLD FW_RELPATH LIB LIB_BN
|
local TODO TODO_OLD FW_RELPATH LIB LIB_BN
|
||||||
|
|
||||||
echo "Fixing imports on the core appbundle..."
|
echo "Fixing imports on the core appbundle..."
|
||||||
pushd "$1" > /dev/null
|
pushd "$1" > /dev/null || exit
|
||||||
|
|
||||||
# Find all the files that may need tweaks
|
# Find all the files that may need tweaks
|
||||||
TODO=$(file $(find . -perm +0111 -type f) | \
|
TODO=$(file "$(find . -perm +0111 -type f)" | \
|
||||||
grep -v "Frameworks/Python.framework" | \
|
grep -v "Frameworks/Python.framework" | \
|
||||||
grep -v "Frameworks/nwjs" | \
|
grep -v "Frameworks/nwjs" | \
|
||||||
grep -E "Mach-O 64-bit" | \
|
grep -E "Mach-O 64-bit" | \
|
||||||
@ -157,7 +158,7 @@ _fixup_imports() {
|
|||||||
uniq)
|
uniq)
|
||||||
|
|
||||||
# Add anything in the site-packages Python directory
|
# Add anything in the site-packages Python directory
|
||||||
TODO+=$(file $(find ./Contents/Frameworks/Python.framework/Versions/Current/lib/python*/site-packages -perm +0111 -type f) | \
|
TODO+=$(file "$(find ./Contents/Frameworks/Python.framework/Versions/Current/lib/python*/site-packages -perm +0111 -type f)" | \
|
||||||
grep -E "Mach-O 64-bit" | \
|
grep -E "Mach-O 64-bit" | \
|
||||||
awk -F ':| ' '{ORS=" "; print $1}' | \
|
awk -F ':| ' '{ORS=" "; print $1}' | \
|
||||||
uniq)
|
uniq)
|
||||||
@ -249,7 +250,7 @@ _complete_bundle() {
|
|||||||
for FILE in "${BUNDLE_DIR}"/Contents/Resources/*.lproj/InfoPlist.strings; do
|
for FILE in "${BUNDLE_DIR}"/Contents/Resources/*.lproj/InfoPlist.strings; do
|
||||||
sed -i '' 's/CFBundleGetInfoString =.*/CFBundleGetInfoString = "Copyright (C) 2013 - 2022, The pgAdmin Development Team";/g' "${FILE}"
|
sed -i '' 's/CFBundleGetInfoString =.*/CFBundleGetInfoString = "Copyright (C) 2013 - 2022, The pgAdmin Development Team";/g' "${FILE}"
|
||||||
sed -i '' 's/NSHumanReadableCopyright =.*/NSHumanReadableCopyright = "Copyright (C) 2013 - 2022, The pgAdmin Development Team";/g' "${FILE}"
|
sed -i '' 's/NSHumanReadableCopyright =.*/NSHumanReadableCopyright = "Copyright (C) 2013 - 2022, The pgAdmin Development Team";/g' "${FILE}"
|
||||||
echo CFBundleDisplayName = \"${APP_NAME}\"\; >> "${FILE}"
|
echo CFBundleDisplayName = \""${APP_NAME}"\"\; >> "${FILE}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# PkgInfo
|
# PkgInfo
|
||||||
@ -334,15 +335,13 @@ _codesign_binaries() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo Signing "${BUNDLE_DIR}" libraries...
|
echo Signing "${BUNDLE_DIR}" libraries...
|
||||||
for i in $(find "${BUNDLE_DIR}" -type f -name "*.dylib*")
|
find "${BUNDLE_DIR}" -type f -name "*.dylib*" -exec \
|
||||||
do
|
|
||||||
codesign --deep --force --verify --verbose --timestamp \
|
codesign --deep --force --verify --verbose --timestamp \
|
||||||
--options runtime \
|
--options runtime \
|
||||||
--entitlements "${BUILD_ROOT}/entitlements.plist" \
|
--entitlements "${BUILD_ROOT}/entitlements.plist" \
|
||||||
-i org.pgadmin.pgadmin4 \
|
-i org.pgadmin.pgadmin4 \
|
||||||
--sign "${DEVELOPER_ID}" \
|
--sign "${DEVELOPER_ID}" \
|
||||||
"$i"
|
{} \;
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_codesign_bundle() {
|
_codesign_bundle() {
|
||||||
|
@ -8,7 +8,7 @@ set -e -E
|
|||||||
# Debugging shizz
|
# Debugging shizz
|
||||||
trap 'ERRCODE=$? && if [ ${ERRCODE} -ne 0 ]; then echo "The command \"${BASH_COMMAND}\" failed in \"${FUNCNAME}\" with exit code ${ERRCODE}."; fi' EXIT
|
trap 'ERRCODE=$? && if [ ${ERRCODE} -ne 0 ]; then echo "The command \"${BASH_COMMAND}\" failed in \"${FUNCNAME}\" with exit code ${ERRCODE}."; fi' EXIT
|
||||||
|
|
||||||
SCRIPT_DIR=$(cd $(dirname "$0") && pwd)
|
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||||
export SCRIPT_DIR
|
export SCRIPT_DIR
|
||||||
SOURCE_DIR=$(realpath "${SCRIPT_DIR}"/../..)
|
SOURCE_DIR=$(realpath "${SCRIPT_DIR}"/../..)
|
||||||
export SOURCE_DIR
|
export SOURCE_DIR
|
||||||
@ -57,6 +57,7 @@ if [ "${PGADMIN_PYTHON_VERSION}" == "" ]; then
|
|||||||
export PGADMIN_PYTHON_VERSION=3.9.9
|
export PGADMIN_PYTHON_VERSION=3.9.9
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=SC1091
|
||||||
source "${SCRIPT_DIR}/build-functions.sh"
|
source "${SCRIPT_DIR}/build-functions.sh"
|
||||||
|
|
||||||
_setup_env
|
_setup_env
|
||||||
|
Loading…
Reference in New Issue
Block a user