aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Schupp <w.schupp@a1.net>2018-09-24 11:35:16 +0200
committerGitHub <noreply@github.com>2018-09-24 11:35:16 +0200
commitaed977ab4dfd42350707efb5b35e67561a2c24cd (patch)
treec660b8da0134237cbde90fdb269f6cdd6b0e7172
parente5a2f5462464a3e5bcf09e6fa03d3da07a81beb7 (diff)
parent4eaaa2ce30251e94e3264fe4d55b6c2f1e7ac87d (diff)
Merge pull request #14464 from mglae/lea_kodi_script_apport
kodi.sh: add apport support
-rw-r--r--tools/Linux/kodi.sh.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/Linux/kodi.sh.in b/tools/Linux/kodi.sh.in
index 5e5360c96f..a16b448984 100644
--- a/tools/Linux/kodi.sh.in
+++ b/tools/Linux/kodi.sh.in
@@ -83,6 +83,8 @@ if [ ! -x ${KODI_BINARY} ]; then
exit 2
fi
+APPORT_CORE="/var/crash/$(echo -n ${KODI_BINARY}|tr / _).$(id -u).crash"
+
migrate_home()
{
[ "$(basename $0)" = "xbmc" ] && echo "WARNING: Running ${bin_name} as "xbmc" is deprecated and will be removed in later versions, please switch to using the ${bin_name} binary"
@@ -143,6 +145,14 @@ print_crash_report()
systemd-coredumpctl dump -o core $(basename ${KODI_BINARY}) > /dev/null 2>&1
elif command_exists coredumpctl; then
coredumpctl dump -o core $(basename ${KODI_BINARY}) > /dev/null 2>&1
+ elif command_exists apport-unpack && test -f "${APPORT_CORE}"; then
+ TMP_DIR="$(mktemp -d -p ${HOME})"
+ if [ -d "${TMP_DIR}" ]; then
+ rm -f "${HOME}/core"
+ apport-unpack "${APPORT_CORE}" "${TMP_DIR}"
+ mv "${TMP_DIR}/CoreDump" "${HOME}/core"
+ rm -rf "${TMP_DIR}"
+ fi
fi
single_stacktrace "$PWD" 1
# Find in plugins directories
@@ -195,6 +205,7 @@ fi
LOOP=1
while [ $(( $LOOP )) = "1" ]
do
+ [ -f "${APPORT_CORE}" ] && rm -f "${APPORT_CORE}"
LOOP=0
${KODI_BINARY} $SAVED_ARGS
RET=$?