diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2005-04-17 22:27:35 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2005-04-17 22:27:35 +0000 |
commit | 63e2fc41dc64931d0e3bcf4b47438df03c2f9f1a (patch) | |
tree | c95bae0d50f75ace8312527cdb4ca4feff718503 /net-irc | |
parent | new 2.10 release (diff) | |
download | gentoo-2-63e2fc41dc64931d0e3bcf4b47438df03c2f9f1a.tar.gz gentoo-2-63e2fc41dc64931d0e3bcf4b47438df03c2f9f1a.tar.bz2 gentoo-2-63e2fc41dc64931d0e3bcf4b47438df03c2f9f1a.zip |
Improved /sys parser, ready for arch testing. Unmasking.
(Portage version: 2.0.51.19)
Diffstat (limited to 'net-irc')
-rw-r--r-- | net-irc/xchat-xsys/ChangeLog | 7 | ||||
-rw-r--r-- | net-irc/xchat-xsys/Manifest | 12 | ||||
-rw-r--r-- | net-irc/xchat-xsys/files/1.9.3-sysfs-instead-of-lspci.patch | 56 |
3 files changed, 39 insertions, 36 deletions
diff --git a/net-irc/xchat-xsys/ChangeLog b/net-irc/xchat-xsys/ChangeLog index 2e6184f631b5..851acba04f53 100644 --- a/net-irc/xchat-xsys/ChangeLog +++ b/net-irc/xchat-xsys/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-irc/xchat-xsys # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat-xsys/ChangeLog,v 1.8 2005/04/17 20:13:12 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat-xsys/ChangeLog,v 1.9 2005/04/17 22:27:35 chainsaw Exp $ + + 17 Apr 2005; Tony Vroon <chainsaw@gentoo.org> + files/1.9.3-sysfs-instead-of-lspci.patch: + Improved /sys parser with higher yield, will also pick up PCI adapters and + integrated video adapters. Unmasking. 17 Apr 2005; Tony Vroon <chainsaw@gentoo.org> files/1.9.3-sysfs-instead-of-lspci.patch: diff --git a/net-irc/xchat-xsys/Manifest b/net-irc/xchat-xsys/Manifest index 2b325545a1df..4853f514a61c 100644 --- a/net-irc/xchat-xsys/Manifest +++ b/net-irc/xchat-xsys/Manifest @@ -1,20 +1,10 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - MD5 a94b4009fe101872797d273b603cf610 xchat-xsys-1.9.3.ebuild 862 MD5 e47f69b8cff83add69e3bb2c54988367 xchat-xsys-1.9.1-r1.ebuild 854 MD5 42cef2da59c81f792584c3f9048a1930 metadata.xml 250 MD5 3ed827bf1e5282ac11dc92c38185add3 ChangeLog 1645 MD5 4102cd47e1c2df279bf2fe29cd1d5b89 xchat-xsys-1.9.1.ebuild 687 -MD5 645ce3cd3538e29be8fd64f83a7b9354 files/1.9.3-sysfs-instead-of-lspci.patch 3532 +MD5 6f20a4397c64b29491d5ce2e585c3cae files/1.9.3-sysfs-instead-of-lspci.patch 3710 MD5 f9d3eedf5907d949b6f52bfdbc580bd7 files/digest-xchat-xsys-1.9.1-r1 61 MD5 b9c39b3537e8ee29aa9af6c33467223b files/1.9.1-bmp-support.patch 3230 MD5 f9d3eedf5907d949b6f52bfdbc580bd7 files/digest-xchat-xsys-1.9.1 61 MD5 6a0d14cce311c0075599544fd3a107c1 files/digest-xchat-xsys-1.9.3 62 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.1-ecc0.1.6 (GNU/Linux) - -iD8DBQFCYsNrp5vW4rUFj5oRAsfoAJ9U+cTAY9/iyP4LLxntTt+vsYmv6ACaAguq -F1EsXvzU5RdJ8++1bak0V9I= -=FQtg ------END PGP SIGNATURE----- diff --git a/net-irc/xchat-xsys/files/1.9.3-sysfs-instead-of-lspci.patch b/net-irc/xchat-xsys/files/1.9.3-sysfs-instead-of-lspci.patch index a55c20c5288a..cfe01e6ac3ce 100644 --- a/net-irc/xchat-xsys/files/1.9.3-sysfs-instead-of-lspci.patch +++ b/net-irc/xchat-xsys/files/1.9.3-sysfs-instead-of-lspci.patch @@ -1,6 +1,6 @@ --- xsys2/parse.c.orig 2005-04-17 21:01:24.000000000 +0100 -+++ xsys2/parse.c 2005-04-17 21:09:07.000000000 +0100 -@@ -150,19 +150,83 @@ ++++ xsys2/parse.c 2005-04-17 23:05:40.000000000 +0100 +@@ -150,19 +150,91 @@ int xs_parse_video(char *vid_card) { @@ -10,58 +10,66 @@ - return 1; - while(fgets(vid_card, 1024, pipe) != NULL) + char buffer[1024], pcibus[42], vendor[7], device[7], vendorname[128] = "", devicename[128] = "", *position; -+ int buscount = 0; ++ int busnr = 0, devnr = 0, cardfound = 0; + -+ while ( buscount <= 8 ) ++ while ( busnr <= 9 ) { - if((pos = strchr(vid_card, '\n')) != NULL) - *pos = '\0'; -+ buscount++; -+ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:0%d:00.0/class", buscount); -+ FILE *fp = fopen(pcibus, "r"); -+ if(fp != NULL) { -+ if(fgets(buffer, 1024, fp) != NULL) -+ if(strncmp("0x03", buffer, 4) == 0) -+ break; -+ fclose(fp); ++ while ( devnr <= 9 ) { ++ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:%.2d:%.2d.0/class", busnr, devnr); ++ FILE *fp = fopen(pcibus, "r"); ++ if(fp != NULL) { ++ if(fgets(buffer, 1024, fp) != NULL) ++ if(strncmp("0x03", buffer, 4) == 0) { ++ cardfound = 1; ++ break; ++ } ++ fclose(fp); + } ++ devnr++; ++ } ++ if (cardfound == 1) ++ break; ++ busnr++; ++ devnr = 0; + } + -+ if (buscount == 9) { -+ strncpy(vid_card,"No AGP card found",42); -+ return 1; ++ if (cardfound == 0) { ++ strncpy(vid_card, "No AGP card found", 42); ++ return 0; } - if(pos == NULL) return 2; - -- pclose(pipe); -+ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:0%d:00.0/device", buscount); ++ ++ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:%.2d:%.2d.0/device", busnr, devnr); + FILE *fp = fopen(pcibus, "r"); + if(fp != NULL) { + if(fgets(buffer, 1024, fp) != NULL) + if(strstr(buffer, "0x") != NULL) { + position = strstr(buffer, "0x"); + position += 2; -+ strcpy(device, position); ++ strncpy(device, position, 7); + position = strstr(device, "\n"); + *(position) = '\0'; + } + fclose(fp); + } -+ -+ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:0%d:00.0/vendor", buscount); ++ ++ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:%.2d:%.2d.0/vendor", busnr, devnr); + FILE *fp2 = fopen(pcibus, "r"); + if(fp2 != NULL) { + if(fgets(buffer, 1024, fp) != NULL) + if(strstr(buffer, "0x") != NULL) { + position = strstr(buffer, "0x"); + position += 2; -+ strcpy(vendor, position); ++ strncpy(vendor, position, 7); + position = strstr(vendor, "\n"); + *(position) = '\0'; + } + fclose(fp2); + } -+ + +- pclose(pipe); + FILE *fp3 = fopen("/usr/share/misc/pci.ids", "r"); + if(fp3 == NULL) { + snprintf(vid_card, 42, "Found AGP card %s:%s", vendor, device); @@ -93,7 +101,7 @@ return 0; } -@@ -389,4 +453,3 @@ +@@ -389,4 +461,3 @@ } return 0; } |