[chocolate-doom] 01/01: initial cut of chocolate-update-menus

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 23 15:34:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to branch chocolate-update-menus
in repository chocolate-doom.

commit 69b7e900c6a18599ae8812eb2d758e276094d54e
Author: Jonathan Dowland <jmtd at debian.org>
Date:   Mon Jan 23 06:18:38 2017 +0000

    initial cut of chocolate-update-menus
---
 debian/chocolate-doom.install  |  3 ++-
 debian/chocolate-doom.postinst |  3 +++
 debian/chocolate-doom.prerm    |  2 ++
 debian/chocolate-update-menus  | 24 ++++++++++++++++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/debian/chocolate-doom.install b/debian/chocolate-doom.install
index f897810..26867a4 100644
--- a/debian/chocolate-doom.install
+++ b/debian/chocolate-doom.install
@@ -1,6 +1,6 @@
 usr/games/*
 usr/share/appdata/*
-usr/share/applications/*
+usr/share/applications/* /usr/share/chocolate-doom/applications/
 usr/share/applications/screensavers/chocolate-doom-screensaver.desktop
 usr/share/icons/
 usr/share/man/*
@@ -12,3 +12,4 @@ usr/share/doc/chocolate-hexen/INSTALL.hexen /usr/share/doc/chocolate-doom/
 usr/share/doc/chocolate-strife/CMDLINE.strife /usr/share/doc/chocolate-doom/
 usr/share/doc/chocolate-strife/INSTALL.strife /usr/share/doc/chocolate-doom/
 usr/share/doc/chocolate-strife/README.Strife.md /usr/share/doc/chocolate-doom/
+debian/chocolate-update-menus /usr/games/
diff --git a/debian/chocolate-doom.postinst b/debian/chocolate-doom.postinst
index 16c0186..2823d38 100644
--- a/debian/chocolate-doom.postinst
+++ b/debian/chocolate-doom.postinst
@@ -16,8 +16,11 @@ then
   update-alternatives \
   --install /usr/games/strife strife /usr/games/chocolate-strife 50 \
   --slave /usr/share/man/man6/strife.6.gz strife.6.gz /usr/share/man/man6/chocolate-strife.6.gz
+
+  /usr/games/chocolate-update-menus
 fi
 
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/chocolate-doom.prerm b/debian/chocolate-doom.prerm
index 97413a6..84094d3 100644
--- a/debian/chocolate-doom.prerm
+++ b/debian/chocolate-doom.prerm
@@ -8,8 +8,10 @@ then
   update-alternatives --remove heretic /usr/games/chocolate-heretic
   update-alternatives --remove hexen /usr/games/chocolate-hexen
   update-alternatives --remove strife /usr/games/chocolate-strife
+  /usr/games/chocolate-update-menus
 fi
 
+
 #DEBHELPER#
 
 exit 0
diff --git a/debian/chocolate-update-menus b/debian/chocolate-update-menus
new file mode 100755
index 0000000..9c90de6
--- /dev/null
+++ b/debian/chocolate-update-menus
@@ -0,0 +1,24 @@
+#!/bin/bash
+set -euo pipefail
+# chocolate-update-menus: copy/rm application files into/out of place
+# if the corresponding required IWADs are present or absent
+
+# heretic only so far
+
+src=/usr/share/chocolate-doom/applications
+# XXX: if not uid=0 (or not -d/-w), use XDG_.._DIR / ~/.config.. ?
+dst=/usr/share/applications
+
+name=chocolate-heretic.desktop
+
+# XXX: check all case variations
+# XXX: check other paths according to chocolate-* iwad search logic
+#      (different if UID!=0)
+if [ -f /usr/share/games/doom/heretic.wad ]; then
+    cp "$src/$name" "$dst"
+else
+    # XXX: ensure not locally modified first
+    if [ -f "$dst/$name" ]; then
+        rm "$dst/$name"
+    fi
+fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list