mirror of
https://github.com/netdata/netdata.git
synced 2025-04-26 13:54:48 +00:00
Fix detection of Coverity archive path in scan script. (#18112)
This commit is contained in:
parent
1d715a9907
commit
32b031c555
1 changed files with 8 additions and 21 deletions
|
@ -27,9 +27,6 @@
|
||||||
# this includes the token, so the default is not to print it.
|
# this includes the token, so the default is not to print it.
|
||||||
# COVERITY_SUBMIT_DEBUG=1
|
# COVERITY_SUBMIT_DEBUG=1
|
||||||
#
|
#
|
||||||
# Override the standard coverity build version we know is supported
|
|
||||||
# COVERITY_BUILD_VERSION="cov-analysis-linux64-2019.03"
|
|
||||||
#
|
|
||||||
# All these variables can also be exported before running this script.
|
# All these variables can also be exported before running this script.
|
||||||
#
|
#
|
||||||
# If the first parameter of this script is "install",
|
# If the first parameter of this script is "install",
|
||||||
|
@ -160,30 +157,21 @@ scanit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
installit() {
|
installit() {
|
||||||
ORIGINAL_DIR="${PWD}"
|
|
||||||
TMP_DIR="$(mktemp -d /tmp/netdata-coverity-scan-XXXXX)"
|
TMP_DIR="$(mktemp -d /tmp/netdata-coverity-scan-XXXXX)"
|
||||||
progress "Downloading coverity in ${TMP_DIR}..."
|
progress "Downloading coverity in ${TMP_DIR}..."
|
||||||
cd "${TMP_DIR}"
|
(cd "${TMP_DIR}" && debugrun curl --remote-name --remote-header-name --show-error --location --data "token=${token}&project=${repo}" https://scan.coverity.com/download/linux64)
|
||||||
|
|
||||||
debugrun curl --remote-name --remote-header-name --show-error --location --data "token=${token}&project=${repo}" https://scan.coverity.com/download/linux64
|
COVERITY_ARCHIVE="$(find "${TMP_DIR}" -maxdepth 1 -mindepth 1 -name 'cov-analysis-linux64-*.tar.gz')"
|
||||||
|
|
||||||
if [ -z "${COVERITY_BUILD_VERSION}" ]; then
|
if [ -n "${COVERITY_ARCHIVE}" ] && [ -f "${COVERITY_ARCHIVE}" ]; then
|
||||||
COVERITY_ARCHIVE="$(find "${TMP_DIR}" -maxdepth 1 -mindepth 1 -name 'cov-analysis-linux64-*.tar.gz' | cut -f 2 -d '/' | head -n 1)"
|
|
||||||
else
|
|
||||||
COVERITY_ARCHIVE="${TMP_DIR}/${COVERITY_BUILD_VERSION}.tar.gz"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "${COVERITY_ARCHIVE}" ]; then
|
|
||||||
progress "Installing coverity..."
|
progress "Installing coverity..."
|
||||||
cd "${INSTALL_DIR}"
|
run sudo tar -z -x -f "${COVERITY_ARCHIVE}" -C "${INSTALL_DIR}"
|
||||||
|
|
||||||
run sudo tar -z -x -f "${COVERITY_ARCHIVE}" || exit 1
|
|
||||||
rm -f "${COVERITY_ARCHIVE}"
|
rm -f "${COVERITY_ARCHIVE}"
|
||||||
COVERITY_PATH=$(find "${INSTALL_DIR}" -maxdepth 1 -name 'cov*linux*')
|
COVERITY_PATH=$(find "${INSTALL_DIR}" -maxdepth 1 -name 'cov*linux*')
|
||||||
export PATH=${PATH}:${COVERITY_PATH}/bin/
|
export PATH="${PATH}:${COVERITY_PATH}/bin/"
|
||||||
elif find . -name "*.tar.gz" > /dev/null 2>&1; then
|
elif find "${TMP_DIR}" -name "*.tar.gz" > /dev/null 2>&1; then
|
||||||
ls ./*.tar.gz
|
ls "${TMP_DIR}"/*.tar.gz
|
||||||
fatal "Downloaded coverity tool tarball does not appear to be the version we were expecting, exiting."
|
fatal "Downloaded coverity tool tarball does not appear to be the file-name we were expecting, exiting."
|
||||||
else
|
else
|
||||||
fatal "Failed to download coverity tool tarball!"
|
fatal "Failed to download coverity tool tarball!"
|
||||||
fi
|
fi
|
||||||
|
@ -195,7 +183,6 @@ installit() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
progress "Coverity scan tools are installed."
|
progress "Coverity scan tools are installed."
|
||||||
cd "$ORIGINAL_DIR"
|
|
||||||
|
|
||||||
# Clean temp directory
|
# Clean temp directory
|
||||||
[ -n "${TMP_DIR}" ] && rm -rf "${TMP_DIR}"
|
[ -n "${TMP_DIR}" ] && rm -rf "${TMP_DIR}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue