summaryrefslogtreecommitdiff
path: root/games-fps/freedoom-data/files/freedoom-data-0.11.3-Set-DOOMWADPATH.patch
blob: 0998cc45ebd15f67a22ad7544ca43c2211596c53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 19b8fe33843b1e431fb0737a57087f58c168952c Mon Sep 17 00:00:00 2001
From: William Breathitt Gray <vilhelm.gray@gmail.com>
Date: Fri, 6 Sep 2019 16:20:49 +0900
Subject: [PATCH] dist/freedoom: Set DOOMWADPATH with sensible default value if
 unset

Engines such as Odamex may not have a default search path and simply
search for freedoom1.wad relative to the current directory. This can
cause an unexpected WAD file not found error when executing the freedoom
script.

This issue is mitigated by setting a default DOOMWADPATH environment
variable with sensible search paths, if it is not already set. All
engines listed in the PORTS variable support the DOOMWADPATH environment
variable, which makes it a simple and convenient way of helping prevent
this error.
---
 dist/freedoom | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dist/freedoom b/dist/freedoom
index 62e3c4d5..0c0961a5 100755
--- a/dist/freedoom
+++ b/dist/freedoom
@@ -31,6 +31,10 @@ case "$(basename "$0")" in
         ;;
 esac
 
+if [ -z "$DOOMWADPATH" ]; then
+    export DOOMWADPATH="/usr/share/doom:/usr/share/games/doom:/usr/local/share/doom:/usr/local/share/games/doom"
+fi
+
 if [ -z "$PORT" ] && [ -h "$HOME"/.doomport ]; then
     if [ -f "$(readlink -f "$HOME"/.doomport)" ] \
         && [ -x "$(readlink -f "$HOME"/.doomport)" ]; then
-- 
2.23.0