Hello community, here is the log from the commit of package hwinfo checked in at Thu Sep 7 01:16:44 CEST 2006. -------- --- hwinfo/hwinfo.changes 2006-08-29 17:52:16.000000000 +0200 +++ hwinfo/hwinfo.changes 2006-09-04 15:25:17.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Sep 4 15:25:08 CEST 2006 - snwint@suse.de + +- more general modalias matching (#199112) +- more device files (#159405) +- mvidner: add pkgconfig file + +------------------------------------------------------------------- Old: ---- hwinfo-13.1.tar.bz2 New: ---- hwinfo-13.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hwinfo.spec ++++++ --- /var/tmp/diff_new_pack.N5WYdp/_old 2006-09-07 01:16:34.000000000 +0200 +++ /var/tmp/diff_new_pack.N5WYdp/_new 2006-09-07 01:16:34.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package hwinfo (Version 13.1) +# spec file for package hwinfo (Version 13.2) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -20,9 +20,9 @@ PreReq: /sbin/ldconfig %insserv_prereq %fillup_prereq Autoreqprov: on Summary: Hardware Library -Version: 13.1 +Version: 13.2 Release: 1 -Source: hwinfo-13.1.tar.bz2 +Source: hwinfo-13.2.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -55,10 +55,10 @@ make tinystatic install -m 644 src/libhd_tiny.a %{buildroot}%{_libdir} make clean - make tiny + make tiny LIBDIR=%{_libdir} make tinyinstall DESTDIR=%{buildroot} LIBDIR=%{_libdir} make clean - make + make LIBDIR=%{_libdir} make doc gzip -9c doc/hwinfo.8 >hwinfo.8.gz @@ -92,10 +92,15 @@ %{_libdir}/libhd.a %{_libdir}/libhd_tiny.so* %{_libdir}/libhd_tiny.a +%{_libdir}/pkgconfig/hwinfo.pc /usr/include/hd.h %doc doc/libhd/html %changelog -n hwinfo +* Mon Sep 04 2006 - snwint@suse.de +- more general modalias matching (#199112) +- more device files (#159405) +- mvidner: add pkgconfig file * Tue Aug 29 2006 - snwint@suse.de - updated X11 data - x86 emulation was not turned on for broken BIOSes (#188839) ++++++ hwinfo-13.1.tar.bz2 -> hwinfo-13.2.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/Changelog new/hwinfo-13.2/Changelog --- old/hwinfo-13.1/Changelog 2006-08-29 17:51:41.000000000 +0200 +++ new/hwinfo-13.2/Changelog 2006-09-04 14:56:25.000000000 +0200 @@ -1,3 +1,8 @@ +4/9/2006: v13.2 + - more general modalias matching (#199112) + - more device files (#159405) + - mvidner: add pkgconfig file + 29/8/2006: v13.1 - updated X11 data - x86 emulation was not turned on for broken BIOSes (#188839) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/Makefile new/hwinfo-13.2/Makefile --- old/hwinfo-13.1/Makefile 2006-08-29 16:17:47.000000000 +0200 +++ new/hwinfo-13.2/Makefile 2006-09-04 15:24:50.000000000 +0200 @@ -1,7 +1,7 @@ TOPDIR = $(CURDIR) SUBDIRS = src -TARGETS = hwinfo -CLEANFILES = hwinfo hwinfo.static hwscan hwscan.static hwscand hwscanqueue doc/libhd doc/*~ +TARGETS = hwinfo hwinfo.pc +CLEANFILES = hwinfo hwinfo.pc hwinfo.static hwscan hwscan.static hwscand hwscanqueue doc/libhd doc/*~ LIBDIR = /usr/lib ULIBDIR = $(LIBDIR) LIBS = -lhd @@ -31,6 +31,10 @@ hwscanqueue: hwscanqueue.o $(CC) $< $(LDFLAGS) -o $@ +hwinfo.pc: hwinfo.pc.in + VERSION=`cat VERSION`; \ + sed -e "s,@VERSION@,$${VERSION},g" -e 's,@LIBDIR@,$(ULIBDIR),g;s,@LIBS@,$(LIBS),g' $< > $@.tmp && mv $@.tmp $@ + # kept for compatibility shared: @make @@ -68,7 +72,7 @@ install: install -d -m 755 $(DESTDIR)/sbin $(DESTDIR)/usr/sbin $(DESTDIR)$(ULIBDIR) \ - $(DESTDIR)/usr/include + $(DESTDIR)$(ULIBDIR)/pkgconfig $(DESTDIR)/usr/include install -m 755 hwinfo $(DESTDIR)/usr/sbin install -m 755 src/ids/check_hd $(DESTDIR)/usr/sbin install -m 755 src/ids/convert_hd $(DESTDIR)/usr/sbin @@ -79,6 +83,7 @@ else \ install -m 644 $(LIBHD) $(DESTDIR)$(ULIBDIR) ; \ fi + install -m 644 hwinfo.pc $(DESTDIR)$(ULIBDIR)/pkgconfig install -m 644 src/hd/hd.h $(DESTDIR)/usr/include install -m 755 getsysinfo $(DESTDIR)/usr/sbin install -m 755 src/isdn/cdb/mk_isdnhwdb $(DESTDIR)/usr/sbin diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/VERSION new/hwinfo-13.2/VERSION --- old/hwinfo-13.1/VERSION 2006-06-30 10:51:40.000000000 +0200 +++ new/hwinfo-13.2/VERSION 2006-09-04 14:23:33.000000000 +0200 @@ -1 +1 @@ -13.1 +13.2 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/hwinfo.pc.in new/hwinfo-13.2/hwinfo.pc.in --- old/hwinfo-13.1/hwinfo.pc.in 1970-01-01 01:00:00.000000000 +0100 +++ new/hwinfo-13.2/hwinfo.pc.in 2006-09-04 14:52:23.000000000 +0200 @@ -0,0 +1,12 @@ +# Package Information for pkg-config + +prefix=/usr +exec_prefix=${prefix} +libdir=@LIBDIR@ +includedir=${prefix}/include + +Name: hwinfo +Description: Hardware Detection Library +Version: @VERSION@ +Libs: -L${libdir} @LIBS@ +Cflags: -I${includedir} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/src/hd/hd.c new/hwinfo-13.2/src/hd/hd.c --- old/hwinfo-13.1/src/hd/hd.c 2006-08-29 16:52:03.000000000 +0200 +++ new/hwinfo-13.2/src/hd/hd.c 2006-09-04 14:44:56.000000000 +0200 @@ -5582,7 +5582,7 @@ { str_list_t *sl, *udevinfo; hd_udevinfo_t **uip, *ui; - char *s, buf[256]; + char *s = NULL, buf[256]; udevinfo = read_file("| " PROG_UDEVINFO " -e 2>/dev/null", 0, 0); @@ -5608,19 +5608,21 @@ if(!ui) continue; if(sscanf(sl->str, "N: %255s", buf) == 1) { - free_mem(ui->name); - ui->name = new_str(buf); + str_printf(&ui->name, 0, "/dev/%s", buf); continue; } if(sscanf(sl->str, "S: %255s", buf) == 1) { - add_str_list(&ui->links, buf); + str_printf(&s, 0, "/dev/%s", buf); + add_str_list(&ui->links, s); continue; } } + s = free_mem(s); + for(ui = hd_data->udevinfo; ui; ui = ui->next) { ADD2LOG("%s\n", ui->sysfs); if(ui->name) ADD2LOG(" name: %s\n", ui->name); @@ -6001,5 +6003,28 @@ } +/* + * Compare module names. + */ +int hd_mod_cmp(char *str1, char *str2) +{ + char *s; + int i; + + str1 = strdup(str1); + str2 = strdup(str2); + + for(s = str1; *s; s++) if(*s == '-') *s = '_'; + for(s = str2; *s; s++) if(*s == '-') *s = '_'; + + i = strcmp(str1, str2); + + free(str1); + free(str2); + + return i; +} + + /** @} */ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/src/hd/hd.h new/hwinfo-13.2/src/hd/hd.h --- old/hwinfo-13.1/src/hd/hd.h 2006-08-28 14:23:06.000000000 +0200 +++ new/hwinfo-13.2/src/hd/hd.h 2006-09-04 14:23:42.000000000 +0200 @@ -1446,7 +1446,7 @@ /** * module information type */ -typedef enum modinfo_type_e { mi_none = 0, mi_pci, mi_usb, mi_pcmcia } modinfo_type_t; +typedef enum modinfo_type_e { mi_none = 0, mi_pci, mi_other } modinfo_type_t; /** * module.alias information diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/src/hd/hd_int.h new/hwinfo-13.2/src/hd/hd_int.h --- old/hwinfo-13.1/src/hd/hd_int.h 2006-08-29 16:51:54.000000000 +0200 +++ new/hwinfo-13.2/src/hd/hd_int.h 2006-09-04 14:45:09.000000000 +0200 @@ -246,6 +246,8 @@ char *hd_get_hddb_dir(void); char *hd_get_hddb_path(char *sub); +int hd_mod_cmp(char *str1, char *str2); + #ifdef __cplusplus } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/src/hd/hddb.c new/hwinfo-13.2/src/hd/hddb.c --- old/hwinfo-13.1/src/hd/hddb.c 2006-08-29 16:15:38.000000000 +0200 +++ new/hwinfo-13.2/src/hd/hddb.c 2006-09-04 14:46:30.000000000 +0200 @@ -173,7 +173,7 @@ unsigned u; char alias[256], module[256]; - /* lenght + 1! */ + /* length + 1! */ for(len = 1, sl = file; sl; sl = sl->next) len++; modinfo = new_mem(len * sizeof *modinfo); @@ -181,9 +181,15 @@ for(m = modinfo, sl = file; sl; sl = sl->next) { if(sscanf(sl->str, "alias %255s %255s", alias, module) != 2) continue; + m->module = new_str(module); + m->alias = new_str(alias); + m->type = mi_other; + if(!strncmp(alias, "pci:", sizeof "pci:" - 1)) { s = alias + sizeof "pci:" - 1; + m->type = mi_pci; + if(!(s = get_mi_field(s, "v", 8, &m->pci.vendor, &u))) continue; m->pci.has.vendor = u; @@ -204,34 +210,9 @@ if(!(s = get_mi_field(s, "i", 2, &m->pci.prog_if, &u))) continue; m->pci.has.prog_if = u; - - m->module = new_str(module); - m->alias = new_str(alias); - m++->type = mi_pci; - - continue; - } - - if(!strncmp(alias, "usb:", sizeof "usb:" - 1)) { - s = alias + sizeof "usb:" - 1; - - m->module = new_str(module); - m->alias = new_str(alias); - m++->type = mi_usb; - - continue; - } - - if(!strncmp(alias, "pcmcia:", sizeof "pcmcia:" - 1)) { - s = alias + sizeof "pcmcia:" - 1; - - m->module = new_str(module); - m->alias = new_str(alias); - m++->type = mi_pcmcia; - - continue; } + m++; } /* note: list stops at first entry with m->type == mi_none */ @@ -241,8 +222,8 @@ for(m = modinfo; m->type; m++) { switch(m->type) { case mi_pci: - fprintf(stderr, "%s:%d, %s\n v 0x%x:%u, d 0x%x:%u, sv 0x%x:%u, sd 0x%x:%u, bc 0x%x:%u, sc 0x%x:%u, i 0x%x:%u\n", - m->module, m->type, m->alias, + fprintf(stderr, "%s: %s\n v 0x%x:%u, d 0x%x:%u, sv 0x%x:%u, sd 0x%x:%u, bc 0x%x:%u, sc 0x%x:%u, i 0x%x:%u\n", + m->module, m->alias, m->pci.vendor, m->pci.has.vendor, m->pci.device, m->pci.has.device, m->pci.sub_vendor, m->pci.has.sub_vendor, @@ -253,10 +234,9 @@ ); break; - case mi_usb: - case mi_pcmcia: - fprintf(stderr, "%s:%d, %s\n", - m->module, m->type, m->alias + case mi_other: + fprintf(stderr, "%s: %s\n", + m->module, m->alias ); break; @@ -347,8 +327,7 @@ } break; - case mi_usb: - case mi_pcmcia: + case mi_other: if(match->alias && db->alias) { if(!fnmatch(db->alias, match->alias, 0)) { s = strchr(db->alias, '*'); @@ -369,7 +348,7 @@ { driver_info_t **di = NULL, *di2; pci_t *pci; - char *mod_list[16 /* arbitrary */]; + char *mod_list[16 /* arbitrary, > 0 */]; int mod_prio[sizeof mod_list / sizeof *mod_list]; int i, prio, mod_list_len; modinfo_t match = { }; @@ -382,18 +361,8 @@ ) { match.type = mi_pci; } - else if( - ID_TAG(hd->vendor.id) == TAG_USB || - ID_TAG(hd->device.id) == TAG_USB - ) { - match.type = mi_usb; - } - else if( - ID_TAG(hd->vendor.id) == TAG_PCMCIA || - ID_TAG(hd->device.id) == TAG_PCMCIA || - (hd->modalias && !strncmp(hd->modalias, "pcmcia:", sizeof "pcmcia:" - 1)) - ) { - match.type = mi_pcmcia; + else { + match.type = mi_other; } match.alias = hd->modalias; @@ -447,7 +416,7 @@ di2->any.type == di_module && di2->any.hddb0 && di2->any.hddb0->str && - !strcmp(di2->any.hddb0->str, modinfo_db->module) + !hd_mod_cmp(di2->any.hddb0->str, modinfo_db->module) ) break; } @@ -469,6 +438,11 @@ } } + if(!mod_list_len && hd->modalias && !strchr(hd->modalias, ':')) { + mod_prio[mod_list_len] = 0; + mod_list[mod_list_len++] = hd->modalias; + } + for(prio = 256; prio >= 0; prio--) { for(i = 0; i < mod_list_len; i++) { if(mod_prio[i] == prio) { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/src/hd/int.c new/hwinfo-13.2/src/hd/int.c --- old/hwinfo-13.1/src/hd/int.c 2006-08-29 16:15:38.000000000 +0200 +++ new/hwinfo-13.2/src/hd/int.c 2006-09-04 14:22:38.000000000 +0200 @@ -855,7 +855,6 @@ { hd_udevinfo_t *ui; hd_t *hd; - char *s = NULL; str_list_t *sl; if(!hd_data->udevinfo) read_udevinfo(hd_data); @@ -863,33 +862,52 @@ if(!hd_data->udevinfo) return; for(hd = hd_data->hd; hd; hd = hd->next) { + if(!hd->unix_dev_names && hd->unix_dev_name) { + add_str_list(&hd->unix_dev_names, hd->unix_dev_name); + } + if(!hd->sysfs_id) continue; for(ui = hd_data->udevinfo; ui; ui = ui->next) { if(ui->name && !strcmp(ui->sysfs, hd->sysfs_id)) { - hd->unix_dev_names = free_str_list(hd->unix_dev_names); - hd->unix_dev_name = free_mem(hd->unix_dev_name); - str_printf(&s, 0, "/dev/%s", ui->name); - add_str_list(&hd->unix_dev_names, s); + if(!search_str_list(hd->unix_dev_names, ui->name)) { + add_str_list(&hd->unix_dev_names, ui->name); + } for(sl = ui->links; sl; sl = sl->next) { - str_printf(&s, 0, "/dev/%s", sl->str); - add_str_list(&hd->unix_dev_names, s); + if(!search_str_list(hd->unix_dev_names, sl->str)) { + add_str_list(&hd->unix_dev_names, sl->str); + } } - s = free_mem(s); - sl = hd->unix_dev_names; + if(!hd->unix_dev_name) { + sl = hd->unix_dev_names; - if(hd_data->flags.udev) { - /* use first link as canonical device name */ - if(ui->links) sl = sl->next; - } + if(hd_data->flags.udev) { + /* use first link as canonical device name */ + if(ui->links) sl = sl->next; + } - hd->unix_dev_name = new_str(sl->str); + hd->unix_dev_name = new_str(sl->str); + } break; } } } + + for(hd = hd_data->hd; hd; hd = hd->next) { + if(!hd->unix_dev_names) continue; + + for(ui = hd_data->udevinfo; ui; ui = ui->next) { + if(search_str_list(hd->unix_dev_names, ui->name)) { + for(sl = ui->links; sl; sl = sl->next) { + if(!search_str_list(hd->unix_dev_names, sl->str)) { + add_str_list(&hd->unix_dev_names, sl->str); + } + } + } + } + } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/src/hd/net.c new/hwinfo-13.2/src/hd/net.c --- old/hwinfo-13.1/src/hd/net.c 2006-08-29 16:21:48.000000000 +0200 +++ new/hwinfo-13.2/src/hd/net.c 2006-09-01 12:39:25.000000000 +0200 @@ -453,12 +453,17 @@ hd_t *hd, *hd_card; hd_res_t *res, *res2; struct stat sbuf; + char *s, *sf_dev, *sf_dev_name, *module; /* * Actually there are two (.0 & .1), but only one seems to be used - so we * don't care. */ - if(stat("/sys/devices/platform/mv643xx_eth.0", &sbuf) || !S_ISDIR(sbuf.st_mode)) return; + sf_dev = "/sys/devices/platform/mv643xx_eth.0"; + sf_dev_name = "mv643xx_eth.0"; + module = "mv643xx_eth"; + + if(stat(sf_dev, &sbuf) || !S_ISDIR(sbuf.st_mode)) return; for(hd = hd_data->hd ; hd; hd = hd->next) { if( @@ -471,8 +476,16 @@ hd_card->base_class.id = bc_network; hd_card->sub_class.id = 0; - hd_card->sysfs_id = new_str("/devices/platform/mv643xx_eth.0"); - hd_card->sysfs_bus_id = new_str("mv643xx_eth.0"); + hd_card->sysfs_id = new_str(hd_sysfs_id(sf_dev)); + hd_card->sysfs_bus_id = new_str(sf_dev_name); + + if((s = get_sysfs_attr_by_path(sf_dev, "modalias"))) { + hd_card->modalias = canon_str(s, strlen(s)); + ADD2LOG(" modalias = \"%s\"\n", hd_card->modalias); + } + else { + hd_card->modalias = new_str(module); + } if(hd) { hd_card->attached_to = hd->idx; @@ -484,8 +497,8 @@ hd_card->device.name = new_str("Gigabit Ethernet"); } - if(hd_module_is_active(hd_data, "mv643xx_eth")) { - add_str_list(&hd_card->drivers, "mv643xx_eth"); + if(hd_module_is_active(hd_data, module)) { + add_str_list(&hd_card->drivers, module); } for(hd = hd_data->hd ; hd; hd = hd->next) { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/hwinfo-13.1/src/hd/usb.c new/hwinfo-13.2/src/hd/usb.c --- old/hwinfo-13.1/src/hd/usb.c 2006-08-29 17:47:08.000000000 +0200 +++ new/hwinfo-13.2/src/hd/usb.c 2006-09-04 14:11:26.000000000 +0200 @@ -556,10 +556,15 @@ str_printf(&t, 0, "/dev/input/%s", sf_cdev_name); if(strncmp(sf_cdev_name, "mouse", sizeof "mouse" - 1)) { - hd->unix_dev_name = t; - hd->unix_dev_num = dev_num; + 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; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org