~ubuntu-branches/ubuntu/trusty/lshw/trusty

« back to all changes in this revision

Viewing changes to debian/patches/lshw-X.patch

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2008-06-19 17:35:08 UTC
  • mfrom: (1.1.7 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080619173508-661hjngqxww5z0oq
Tags: 02.13-2ubuntu1
* Merge from debian unstable, remaining changes:
  - 10-cap-detection.dpatch: fixes hang when reading capabilities of some
    PCI devies (LP: 202460; needs-to-goto-debian)
  - Set maintainer to Ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: lshw-02.13/src/gui/integration/console.apps
 
2
===================================================================
 
3
--- lshw-02.13.orig/src/gui/integration/console.apps    2008-05-09 22:32:50.000000000 +0200
 
4
+++ lshw-02.13/src/gui/integration/console.apps 2008-05-10 15:55:32.000000000 +0200
 
5
@@ -1,3 +1,3 @@
 
6
 USER=root
 
7
-PROGRAM=/usr/sbin/gtk-lshw
 
8
+PROGRAM=/usr/sbin/lshw-gtk
 
9
 SESSION=true
 
10
Index: lshw-02.13/src/gui/integration/gtk-lshw.desktop
 
11
===================================================================
 
12
--- lshw-02.13.orig/src/gui/integration/gtk-lshw.desktop        2008-05-09 22:32:50.000000000 +0200
 
13
+++ lshw-02.13/src/gui/integration/gtk-lshw.desktop     2008-05-10 15:55:32.000000000 +0200
 
14
@@ -3,7 +3,7 @@
 
15
 Comment=HardWare LiSter
 
16
 Categories=Application;System;X-Red-Hat-Base;X-Fedora;
 
17
 Icon=/usr/share/lshw/artwork/logo.svg
 
18
-Exec=/usr/bin/gtk-lshw
 
19
+Exec=/usr/bin/lshw-gtk
 
20
 Type=Application
 
21
 Terminal=false
 
22
 Encoding=UTF-8
 
23
Index: lshw-02.13/src/lshw.cc
 
24
===================================================================
 
25
--- lshw-02.13.orig/src/lshw.cc 2008-05-10 15:51:50.000000000 +0200
 
26
+++ lshw-02.13/src/lshw.cc      2008-05-10 15:55:32.000000000 +0200
 
27
@@ -11,6 +11,7 @@
 
28
 #include <string.h>
 
29
 #include <stdlib.h>
 
30
 #include <iostream>
 
31
+#include <errno.h>
 
32
 
 
33
 __ID("@(#) $Id: lshw.cc 1959 2008-05-09 20:32:50Z lyonel $");
 
34
 
 
35
@@ -26,7 +27,7 @@
 
36
   fprintf(stderr, "\t-xml            output hardware tree as XML\n");
 
37
   fprintf(stderr, "\t-short          output hardware paths\n");
 
38
   fprintf(stderr, "\t-businfo        output bus information\n");
 
39
-  if(getenv("DISPLAY") && exists(SBINDIR"/gtk-lshw"))
 
40
+  if(getenv("DISPLAY") && exists(SBINDIR"/lshw-gtk"))
 
41
     fprintf(stderr, "\t-X              use graphical interface\n");
 
42
   fprintf(stderr, "\noptions can be\n");
 
43
   fprintf(stderr,
 
44
@@ -189,7 +190,19 @@
 
45
     exit(1);
 
46
   }
 
47
 
 
48
-  if(enabled("output:X")) execl(SBINDIR"/gtk-lshw", SBINDIR"/gtk-lshw", NULL);
 
49
+/*  if(enabled("output:X")) execl(SBINDIR"/gtk-lshw", SBINDIR"/gtk-lshw", NULL); */
 
50
+
 
51
+  if(enabled("output:X")) {
 
52
+        execl(SBINDIR"/lshw-gtk", SBINDIR"/lshw-gtk", NULL);                                                                                                                                                    
 
53
+        // Execl only returns if an error has occurred.
 
54
+        if ( errno == ENOENT ) {
 
55
+             fprintf(stderr, "ERROR: Sorry, cannot run the X11/GTK interface because %s/lshw-gtk\n is not available.\n", SBINDIR);                                                                               
 
56
+             fprintf(stderr, "HINT: Install the lshw-gtk package in Debian.\n");                                                                                                                                 
 
57
+        } else {
 
58
+             fprintf(stderr, "ERROR: There was an error when trying to execute %s/lshw-gtk: %s\n", SBINDIR, strerror(errno));                                                                                    
 
59
+             fprintf(stderr, "Will just print the information on screen\n");                                                                                                                                     
 
60
+        }
 
61
+  }
 
62
 
 
63
   if (geteuid() != 0)
 
64
   {