From 383328d3ee10016df86c10929e9bda390c771643 Mon Sep 17 00:00:00 2001 From: Tomodachi94 Date: Mon, 2 Sep 2024 18:11:06 -0700 Subject: [PATCH] Makefile.in: add extra-install-apport target --- Makefile.in | 15 ++++++++++++++- apport/apport_crashdb.conf | 5 +++++ apport/apport_hook.py | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 apport/apport_crashdb.conf create mode 100644 apport/apport_hook.py diff --git a/Makefile.in b/Makefile.in index b0c3a470..c1c5fd6f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -192,6 +192,7 @@ install-bin: craftos $(filter fixup-liblua-path,$(MAKECMDGOALS)) echo " [CP] craftos" cp craftos "$(DESTDIR)$(BINDIR)/craftos" + # craftos2-lua does have a ``make install`` rule, but it installs a lot of # files that conflict with a standard Lua installation. install-liblua: craftos2-lua/src/liblua$(LIBEXT) @@ -219,6 +220,18 @@ extra-install-linux-plugin: linux-plugin fixup-liblua-path echo " [CP] ccemux$(LIBEXT)" cp "ccemux$(LIBEXT)" "$(DESTDIR)$(SHAREDIR)/craftos/plugins" +# Not installed by default, since this is not always wanted. +extra-install-apport: + echo " [MKDIR] $(SHAREDIR)/apport/package-hooks" + mkdir -p "$(SHAREDIR)/apport/package-hooks" + echo " [CP] apport/apport_hook.py" + cp apport/apport_hook.py $(SHAREDIR)/apport/package-hooks/craftos-pc.py + cp apport/apport_hook.py $(SHAREDIR)/apport/package-hooks/source_craftos-pc.py + echo " [MKDIR] $(SYSCONFDIR)/apport/crashdb.conf.d" + mkdir -p "$(SHAREDIR)/apport/crashdb.conf.d" + echo " [CP] apport/apport_crashdb.conf" + cp apport/apport_crashdb.conf $(SYSCONFDIR)/apport/crashdb.conf.d/craftos_pc-crashdb.conf + uninstall: echo " [RM] $(DESTDIR)$(BINDIR)/craftos" rm -f "$(DESTDIR)$(BINDIR)/craftos" @@ -237,5 +250,5 @@ uninstall: test: craftos ./craftos --headless --script $(shell pwd)/resources/CraftOSTest.lua -d "$(shell mktemp -d)" -.PHONY: all macapp clean rebuild install install-bin install-headers install-liblua install-linux install-darwin extra-install-linux-plugin uninstall test +.PHONY: all macapp clean rebuild install install-bin install-headers install-liblua install-linux install-darwin extra-install-linux-plugin extra-install-apport uninstall test .SILENT: diff --git a/apport/apport_crashdb.conf b/apport/apport_crashdb.conf new file mode 100644 index 00000000..5a37763f --- /dev/null +++ b/apport/apport_crashdb.conf @@ -0,0 +1,5 @@ +craftos_pc = { + 'impl': 'launchpad', + 'project': 'craftos-pc', + 'bug_pattern_base': None, +} diff --git a/apport/apport_hook.py b/apport/apport_hook.py new file mode 100644 index 00000000..7d41d8d7 --- /dev/null +++ b/apport/apport_hook.py @@ -0,0 +1,6 @@ +from apport.hookutils import * +import apport.packaging + +def add_info(report, ui): + if not apport.packaging.is_distro_package(report['Package'].split()[0]): + report['CrashDB'] = 'craftos_pc'