Hello community,

here is the log from the commit of package hwinfo for openSUSE:Factory checked 
in at 2016-08-03 11:42:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hwinfo (Old)
 and      /work/SRC/openSUSE:Factory/.hwinfo.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hwinfo"

Changes:
--------
--- /work/SRC/openSUSE:Factory/hwinfo/hwinfo.changes    2016-07-20 
09:16:59.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.hwinfo.new/hwinfo.changes       2016-08-03 
11:42:05.000000000 +0200
@@ -1,0 +2,6 @@
+Thu Jul 28 13:54:59 UTC 2016 - snw...@suse.com
+
+- fix input device name detection for usb devices (bsc#989633)
+- 21.30
+
+-------------------------------------------------------------------

Old:
----
  hwinfo-21.29.tar.xz

New:
----
  hwinfo-21.30.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hwinfo.spec ++++++
--- /var/tmp/diff_new_pack.NrGa9h/_old  2016-08-03 11:42:06.000000000 +0200
+++ /var/tmp/diff_new_pack.NrGa9h/_new  2016-08-03 11:42:06.000000000 +0200
@@ -36,7 +36,7 @@
 Group:          Hardware/Other
 # Until migration to github this should be correct url
 Url:            http://gitorious.org/opensuse/hwinfo
-Version:        21.29
+Version:        21.30
 Release:        0
 Source:         %{name}-%{version}.tar.xz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ hwinfo-21.29.tar.xz -> hwinfo-21.30.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.29/VERSION new/hwinfo-21.30/VERSION
--- old/hwinfo-21.29/VERSION    2016-07-14 10:59:21.000000000 +0200
+++ new/hwinfo-21.30/VERSION    2016-07-28 15:50:17.000000000 +0200
@@ -1 +1 @@
-21.29
+21.30
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.29/changelog new/hwinfo-21.30/changelog
--- old/hwinfo-21.29/changelog  2016-07-14 10:59:21.000000000 +0200
+++ new/hwinfo-21.30/changelog  2016-07-28 15:50:17.000000000 +0200
@@ -1,3 +1,6 @@
+2016-07-28:    21.30
+       - fix input device name detection for usb devices (bsc #989633)
+
 2016-07-14:    21.29
        - refine last patch a bit (bsc #960507)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hwinfo-21.29/src/hd/usb.c 
new/hwinfo-21.30/src/hd/usb.c
--- old/hwinfo-21.29/src/hd/usb.c       2016-07-14 10:59:21.000000000 +0200
+++ new/hwinfo-21.30/src/hd/usb.c       2016-07-28 15:50:17.000000000 +0200
@@ -569,41 +569,48 @@
       s
     );
 
-    for(hd = hd_data->hd; hd; hd = hd->next) {
-      if(
-        hd->module == hd_data->module &&
-        hd->sysfs_id &&
-        s &&
-        !strcmp(s, hd->sysfs_id)
-      ) {
-        t = NULL;
-        str_printf(&t, 0, "/dev/input/%s", sf_cdev_name);
-
-        if(strncmp(sf_cdev_name, "mouse", sizeof "mouse" - 1)) {
-          if(!hd->unix_dev_name) {
-            hd->unix_dev_name = t;
-            hd->unix_dev_num = dev_num;
-          }
-        }
-        else {
-          free_mem(hd->unix_dev_name);
-          free_mem(hd->unix_dev_name2);
-
-          hd->unix_dev_name2 = t;
-          hd->unix_dev_num2 = dev_num;
-
-          dev_num.major = 13;
-          dev_num.minor = 63;
-          hd->unix_dev_name = new_str(DEV_MICE);
+    /* find device (matching sysfs path) */
+    hd = hd_find_sysfs_id(hd_data, s);
+
+    /* not found? - retry one level up */
+    if(!hd) {
+      char *ns = new_str(s), *nt;
+      if((nt = strrchr(ns, '/'))) {
+        *nt = 0;
+        hd = hd_find_sysfs_id(hd_data, ns);
+      }
+      free_mem(ns);
+    }
+
+    /* when we have it, add input device name */
+    if(hd) {
+      t = NULL;
+      str_printf(&t, 0, "/dev/input/%s", sf_cdev_name);
+
+      if(strncmp(sf_cdev_name, "mouse", sizeof "mouse" - 1)) {
+        if(!hd->unix_dev_name) {
+          hd->unix_dev_name = t;
           hd->unix_dev_num = dev_num;
+        }
+      }
+      else {
+        free_mem(hd->unix_dev_name);
+        free_mem(hd->unix_dev_name2);
+
+        hd->unix_dev_name2 = t;
+        hd->unix_dev_num2 = dev_num;
+
+        dev_num.major = 13;
+        dev_num.minor = 63;
+        hd->unix_dev_name = new_str(DEV_MICE);
+        hd->unix_dev_num = dev_num;
 
-          // make it a mouse, #216091
-          if(hd->base_class.id == bc_none) {
-            hd->base_class.id = bc_mouse;
-            hd->sub_class.id = sc_mou_usb;
-            hd->compat_vendor.id = MAKE_ID(TAG_SPECIAL, 0x0200);
-            hd->compat_device.id = MAKE_ID(TAG_SPECIAL, 0x001);
-          }
+        // make it a mouse, #216091
+        if(hd->base_class.id == bc_none) {
+          hd->base_class.id = bc_mouse;
+          hd->sub_class.id = sc_mou_usb;
+          hd->compat_vendor.id = MAKE_ID(TAG_SPECIAL, 0x0200);
+          hd->compat_device.id = MAKE_ID(TAG_SPECIAL, 0x001);
         }
       }
     }


Reply via email to