summaryrefslogtreecommitdiffstats
path: root/debian/patches/load-desc-failure.patch
blob: ebf05f6f58aa5da10b05d54f6718c7616acd500b (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
39
40
41
42
From b30f08f4cd5791a9895df07c1acb061518c73cbe Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Thu, 2 Jan 2014 13:13:22 +0000
Subject: Display more helpful output when failing to load a device

If the device is known to be one of the devices in the groff binary package
rather than groff-base, refer the user to that.

Forwarded: not-needed
Last-Update: 2023-07-08

Patch-Name: load-desc-failure.patch
---
 src/roff/groff/groff.cpp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 4eb732969..d4cb3c122 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -378,9 +378,18 @@ int main(int argc, char **argv)
   }
   font::set_unknown_desc_command_handler(handle_unknown_desc_command);
   const char *desc = font::load_desc();
-  if (0 /* nullptr */ == desc)
-    fatal("cannot load 'DESC' description file for device '%1'",
-	  device);
+  if (0 /* nullptr */ == desc) {
+    if (strcmp(device, "X100") == 0 || strcmp(device, "X100-12") == 0 ||
+	strcmp(device, "X75") == 0 || strcmp(device, "X75-12") == 0 ||
+	strcmp(device, "dvi") == 0 || strcmp(device, "html") == 0 ||
+	strcmp(device, "lbp") == 0 || strcmp(device, "lj4") == 0)
+      fatal("cannot load 'DESC' description file for device '%1' "
+	    "(try installing the 'groff' package?)",
+	    device);
+    else
+      fatal("cannot load 'DESC' description file for device '%1'",
+	    device);
+  }
   if (need_postdriver && (0 /* nullptr */ == postdriver))
     fatal_with_file_and_line(desc, 0, "device description file missing"
 			     " 'postpro' directive");