From 0070b751bb6ef3a9f41dfde9a560f33fba6e97c2 Mon Sep 17 00:00:00 2001 From: Justin Hammond Date: Tue, 7 Jan 2020 14:41:43 +0800 Subject: [PATCH] Update Sentry Debug Upload File. (#13) * sentry upload debug files --- tools/sentry-upload-debug.sh | 58 ++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/tools/sentry-upload-debug.sh b/tools/sentry-upload-debug.sh index 4b0152e..7f29eb8 100755 --- a/tools/sentry-upload-debug.sh +++ b/tools/sentry-upload-debug.sh @@ -12,25 +12,44 @@ then echo "Please Set the SENTRY_TOKEN enviroment variable" exit -1 fi -#echo "deb http://deb.debian.org/debian-debug/ buster-debug main" > /etc/apt/sources.list.d/debug.list -#echo "deb http://deb.debian.org/debian-debug/ buster-proposed-updates-debug main" >> /etc/apt/sources.list.d/debug.list -#echo "deb http://deb.debian.org/debian-debug/ testing-debug main" >> /etc/apt/sources.list.d/debug.list -#echo "deb http://deb.debian.org/debian-debug/ unstable-debug main" >> /etc/apt/sources.list.d/debug.list -#echo "deb http://deb.debian.org/debian-debug/ experimental-debug main" >> /etc/apt/sources.list.d/debug.list -apt-get update -apt-get install -y curl -if [ ! -f /usr/local/bin/sentry-cli ]; then curl -sL https://sentry.io/get-cli/ | bash; fi -#apt-get install -t unstable libqt5core5a-dbgsym libqt5network5-dbgsym libqt5remoteobjects5-dbgsym -#rm /etc/apt/sources.list.d/debug.list +echo "deb http://deb.debian.org/debian-debug/ buster-debug main" > /etc/apt/sources.list.d/debug.list +echo "deb http://deb.debian.org/debian-debug/ buster-proposed-updates-debug main" >> /etc/apt/sources.list.d/debug.list +echo "deb http://deb.debian.org/debian-debug/ testing-debug main" >> /etc/apt/sources.list.d/debug.list +echo "deb http://deb.debian.org/debian-debug/ unstable-debug main" >> /etc/apt/sources.list.d/debug.list +echo "deb http://deb.debian.org/debian-debug/ experimental-debug main" >> /etc/apt/sources.list.d/debug.list +if [ ! -f /usr/local/bin/sentry-cli ]; then + apt-get update + apt-get install -y curl elfutils + apt-get install -y -t unstable libqt5core5a-dbgsym libqt5network5-dbgsym libqt5remoteobjects5-dbgsym + ARCH=`uname -m` + if [ "$ARCH" == "aarch64" ]; then + echo "Installing sentry-cli for arm64" + curl http://bamboo.my-ho.st/bamboo/browse/INFRA-SCL/latest/artifact/shared/sentry-cli-arm64/sentry-cli -o /usr/local/bin/sentry-cli + chmod +x /usr/local/bin/sentry-cli + elif [ "$ARCH" == "armv7l" ]; then + echo "Installing sentry-cli for armhf" + curl http://bamboo.my-ho.st/bamboo/browse/INFRA-SCL/latest/artifact/shared/sentry-cli-armhf/sentry-cli -o /usr/local/bin/sentry-cli + chmod +x /usr/local/bin/sentry-cli + else + echo "Installing sentry-cli for $ARCH" + curl -sL https://sentry.io/get-cli/ | bash + fi +fi function findDBGFile() { local DBGFILE - DBGFILE=`ls /usr/lib/debug/usr/$1* 2> /dev/null` + DBGFILE=`eu-unstrip -n -e $1 | awk '{print $4}'` if (( $? != 0)); then return 1 fi - echo $DBGFILE - return 0 + if [ "$DBGFILE" == "-" ]; then + return 1 + elif [ "$DBGFILE" == "." ]; then + return 1 + else + echo $DBGFILE + return 0 + fi } @@ -44,17 +63,18 @@ ldd $EXECUTABLE | awk '{print $3}' | useable=`sentry-cli difutil check $lib | grep "Usable: yes"` if [ ! -z "$useable" ]; then RP=`realpath $lib` - #DBGFILE=$(findDBGFile $lib) - #if (( $? == 0)); then - # LIBS+=" $DBGFILE" - #fi + DBGFILE=$(findDBGFile $lib) + if (( $? == 0)); then + LIBS+=" $DBGFILE" + fi LIBS+=" $RP" - echo "Got Lib:" $RP " " $PKG " " $DBGFILE + echo "Got Lib:" $RP " " $DBGFILE fi fi done - echo $LIBS /usr/local/bin/ozwdaemon + LIBS+=" /usr/local/lib/ozwdaemon" + echo $LIBS sentry-cli --auth-token $SENTRY_TOKEN upload-dif -o openzwave -p qt-openzwave $LIBS --wait }