1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 08-lshw-X.dpatch by Ghe Rivero <ghe@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
8
diff -urNad lshw-02.11.01~/src/gui/integration/console.apps lshw-02.11.01/src/gui/integration/console.apps
9
--- lshw-02.11.01~/src/gui/integration/console.apps 2007-08-05 23:11:59.000000000 +0200
10
+++ lshw-02.11.01/src/gui/integration/console.apps 2007-10-08 17:23:16.000000000 +0200
13
-PROGRAM=/usr/sbin/gtk-lshw
14
+PROGRAM=/usr/sbin/lshw-gtk
16
diff -urNad lshw-02.11.01~/src/gui/integration/gtk-lshw.desktop lshw-02.11.01/src/gui/integration/gtk-lshw.desktop
17
--- lshw-02.11.01~/src/gui/integration/gtk-lshw.desktop 2007-08-05 23:11:59.000000000 +0200
18
+++ lshw-02.11.01/src/gui/integration/gtk-lshw.desktop 2007-10-08 17:23:04.000000000 +0200
20
Comment=HardWare LiSter
21
Categories=Application;System;X-Red-Hat-Base;X-Fedora;
22
Icon=/usr/share/lshw/artwork/logo.svg
23
-Exec=/usr/bin/gtk-lshw
24
+Exec=/usr/bin/lshw-gtk
28
diff -urNad lshw-02.11.01~/src/lshw.cc lshw-02.11.01/src/lshw.cc
29
--- lshw-02.11.01~/src/lshw.cc 2007-10-08 17:21:32.000000000 +0200
30
+++ lshw-02.11.01/src/lshw.cc 2007-10-08 17:22:28.000000000 +0200
37
__ID("@(#) $Id: lshw.cc 1818 2007-08-05 21:11:59Z lyonel $");
40
fprintf(stderr, "\t-xml output hardware tree as XML\n");
41
fprintf(stderr, "\t-short output hardware paths\n");
42
fprintf(stderr, "\t-businfo output bus information\n");
43
- if(getenv("DISPLAY") && exists(SBINDIR"/gtk-lshw"))
44
+ if(getenv("DISPLAY") && exists(SBINDIR"/lshw-gtk"))
45
fprintf(stderr, "\t-X use graphical interface\n");
46
fprintf(stderr, "\noptions can be\n");
52
- if(enabled("output:X")) execl(SBINDIR"/gtk-lshw", SBINDIR"/gtk-lshw", NULL);
53
+/* if(enabled("output:X")) execl(SBINDIR"/gtk-lshw", SBINDIR"/gtk-lshw", NULL); */
55
+ if(enabled("output:X")) {
56
+ execl(SBINDIR"/lshw-gtk", SBINDIR"/lshw-gtk", NULL);
57
+ // Execl only returns if an error has occurred.
58
+ if ( errno == ENOENT ) {
59
+ fprintf(stderr, "ERROR: Sorry, cannot run the X11/GTK interface because %s/lshw-gtk\n is not available.\n", SBINDIR);
60
+ fprintf(stderr, "HINT: Install the lshw-gtk package in Debian.\n");
62
+ fprintf(stderr, "ERROR: There was an error when trying to execute %s/lshw-gtk: %s\n", SBINDIR, strerror(errno));
63
+ fprintf(stderr, "Will just print the information on screen\n");