diff options
author | mglae <mglmail@arcor.de> | 2018-09-23 12:18:47 +0200 |
---|---|---|
committer | mglae <mglmail@arcor.de> | 2018-09-23 18:17:15 +0200 |
commit | 4eaaa2ce30251e94e3264fe4d55b6c2f1e7ac87d (patch) | |
tree | d26f278b0b9ed063a792120b0c8d2b2352ef22ea /tools/Linux | |
parent | 3238e00357d40352a8dd6f2478fe1c4255bb5a76 (diff) |
kodi.sh: add apport support
Diffstat (limited to 'tools/Linux')
-rw-r--r-- | tools/Linux/kodi.sh.in | 11 |
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=$? |