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

« back to all changes in this revision

Viewing changes to debian/patches/08-lshw-X.dpatch

  • 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
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 08-lshw-X.dpatch by Ghe Rivero <ghe@debian.org>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
6
 
 
7
 
@DPATCH@
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
11
 
@@ -1,3 +1,3 @@
12
 
 USER=root
13
 
-PROGRAM=/usr/sbin/gtk-lshw
14
 
+PROGRAM=/usr/sbin/lshw-gtk
15
 
 SESSION=true
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
19
 
@@ -3,7 +3,7 @@
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
25
 
 Type=Application
26
 
 Terminal=false
27
 
 Encoding=UTF-8
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
31
 
@@ -10,6 +10,7 @@
32
 
 #include <stdio.h>
33
 
 #include <stdlib.h>
34
 
 #include <iostream>
35
 
+#include <errno.h>
36
 
 
37
 
 __ID("@(#) $Id: lshw.cc 1818 2007-08-05 21:11:59Z lyonel $");
38
 
 
39
 
@@ -25,7 +26,7 @@
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");
47
 
   fprintf(stderr,
48
 
@@ -173,7 +174,19 @@
49
 
     exit(1);
50
 
   }
51
 
 
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); */
54
 
+
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");                                                                                                                                 
61
 
+        } else {
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");                                                                                                                                     
64
 
+        }
65
 
+  }
66
 
 
67
 
   if (geteuid() != 0)
68
 
   {