summaryrefslogtreecommitdiffstats
path: root/debian/patches/load-desc-failure.patch
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/patches/load-desc-failure.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/debian/patches/load-desc-failure.patch b/debian/patches/load-desc-failure.patch
new file mode 100644
index 0000000..ebf05f6
--- /dev/null
+++ b/debian/patches/load-desc-failure.patch
@@ -0,0 +1,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");