diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2005-04-16 19:26:20 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2005-04-16 19:26:20 +0000 |
commit | fe71ced734d5c3a3e19b8881e8ed34ca39b7a757 (patch) | |
tree | dc0d63e834fab697ceabf96c36882c640dc678f0 /net-irc/xchat-xsys/files | |
parent | Mask new xchat-xsys, experimental patch applied (diff) | |
download | gentoo-2-fe71ced734d5c3a3e19b8881e8ed34ca39b7a757.tar.gz gentoo-2-fe71ced734d5c3a3e19b8881e8ed34ca39b7a757.tar.bz2 gentoo-2-fe71ced734d5c3a3e19b8881e8ed34ca39b7a757.zip |
Version bump with experimental patch, package masked.
(Portage version: 2.0.51.19)
Diffstat (limited to 'net-irc/xchat-xsys/files')
-rw-r--r-- | net-irc/xchat-xsys/files/1.9.3-sysfs-instead-of-lspci.patch | 121 | ||||
-rw-r--r-- | net-irc/xchat-xsys/files/digest-xchat-xsys-1.9.3 | 1 |
2 files changed, 122 insertions, 0 deletions
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 new file mode 100644 index 000000000000..5b0f796735eb --- /dev/null +++ b/net-irc/xchat-xsys/files/1.9.3-sysfs-instead-of-lspci.patch @@ -0,0 +1,121 @@ +--- xsys2/parse.c.orig 2005-04-16 15:57:31.000000000 +0100 ++++ xsys2/parse.c 2005-04-16 20:10:09.000000000 +0100 +@@ -150,19 +150,85 @@ + + int xs_parse_video(char *vid_card) + { +- char *pos = NULL; +- FILE *pipe = popen(LSPCI" | grep VGA | cut -d\" \" -f5-", "r"); +- if(pipe == NULL) +- 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; ++ ++ while ( buscount <= 8 ) + { +- 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); ++ } ++ } ++ ++ if (buscount == 9) { ++ strncpy(vid_card,"No AGP card found",42); ++ return 1; + } +- if(pos == NULL) return 2; + +- pclose(pipe); ++ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:0%d:00.0/device", buscount); ++ 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); ++ position = strstr(device, "\n"); ++ *(position) = '\0'; ++ } ++ fclose(fp); ++ } ++ ++ snprintf(pcibus, 42, "/sys/bus/pci/devices/0000:0%d:00.0/vendor", buscount); ++ 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); ++ position = strstr(vendor, "\n"); ++ *(position) = '\0'; ++ } ++ fclose(fp2); ++ } ++ ++ FILE *fp3 = fopen("/usr/share/misc/pci.ids", "r"); ++ if(fp3 == NULL) { ++ snprintf(vid_card, 42, "Found AGP card %s:%s", vendor, device); ++ return 0; ++ } + ++ while(fgets(buffer, 1024, fp3) != NULL) ++ { ++ if (!isspace(buffer[0])) { ++ if(strstr(buffer, vendor) != NULL) ++ { ++ position = strstr(buffer, vendor); ++ position += 6; ++ strcpy(vendorname, position); ++ position = strstr(vendorname, "\n"); ++ *(position) = '\0'; ++ } ++ } else { ++ if(strstr(buffer, device) != NULL) ++ { ++ position = strstr(buffer, device); ++ position += 6; ++ strcpy(devicename, position); ++ position = strstr(devicename, "\n"); ++ *(position) = '\0'; ++ } ++ } ++ } ++ fclose(fp3); ++ snprintf(vid_card, 256, "%s %s", vendorname, devicename); + return 0; + } + +@@ -389,4 +455,3 @@ + } + return 0; + } +- +--- xsys2/Makefile.orig 2005-04-16 20:15:05.000000000 +0100 ++++ xsys2/Makefile 2005-04-16 20:15:42.000000000 +0100 +@@ -1,7 +1,3 @@ +-#### SET THIS VALUE TO THE LOCATION OF 'lspci' #### +-LSPCI = /sbin/lspci +- +- + #### SHOULD NOT NEED TO EDIT BELOW THIS LINE #### + VER_MAJOR = 1 + VER_MINOR = 9 +@@ -9,7 +5,7 @@ + CC = gcc + CFLAGS += -O2 -Wall -fPIC + CFLAGS += -DVER_MINOR=$(VER_MINOR) -DVER_MAJOR=$(VER_MAJOR) -DVER_PATCH=$(VER_PATCH) \ +- -DVER_STRING=\"$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)\" -DLSPCI=\"$(LSPCI)\" ++ -DVER_STRING=\"$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)\" + LDFLAGS = $(CFLAGS) -shared + LIBRARY = xsys-$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH).so + OBJECTS = xsys.o parse.o diff --git a/net-irc/xchat-xsys/files/digest-xchat-xsys-1.9.3 b/net-irc/xchat-xsys/files/digest-xchat-xsys-1.9.3 new file mode 100644 index 000000000000..717d41bf4a89 --- /dev/null +++ b/net-irc/xchat-xsys/files/digest-xchat-xsys-1.9.3 @@ -0,0 +1 @@ +MD5 7a284ae9aea5f951e8e89e1c846848fb xsys-1.9.3.tar.bz2 10578 |