diff options
author | Michele Noberasco <s4t4n@gentoo.org> | 2007-01-17 11:19:06 +0000 |
---|---|---|
committer | Michele Noberasco <s4t4n@gentoo.org> | 2007-01-17 11:19:06 +0000 |
commit | 1c6556508eaaf498406ac3cdfc5ade5eb24fffc1 (patch) | |
tree | e2ae9afa8ec97da1b4c6cd3a1b9b2aa5d40bdde5 /x11-plugins/wmpop3lb | |
parent | Fix patch locations (diff) | |
download | gentoo-2-1c6556508eaaf498406ac3cdfc5ade5eb24fffc1.tar.gz gentoo-2-1c6556508eaaf498406ac3cdfc5ade5eb24fffc1.tar.bz2 gentoo-2-1c6556508eaaf498406ac3cdfc5ade5eb24fffc1.zip |
Revision bump, with patch to fix bug #161530.
(Portage version: 2.1.1-r2)
Diffstat (limited to 'x11-plugins/wmpop3lb')
4 files changed, 247 insertions, 2 deletions
diff --git a/x11-plugins/wmpop3lb/ChangeLog b/x11-plugins/wmpop3lb/ChangeLog index 6c3f348dd09b..ebc7c63bc092 100644 --- a/x11-plugins/wmpop3lb/ChangeLog +++ b/x11-plugins/wmpop3lb/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for x11-plugins/wmpop3lb # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmpop3lb/ChangeLog,v 1.10 2006/05/03 00:47:44 weeve Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmpop3lb/ChangeLog,v 1.11 2007/01/17 11:19:06 s4t4n Exp $ + +*wmpop3lb-2.4.2-r2 (17 Jan 2007) + + 17 Jan 2007; Michele Noberasco <s4t4n@gentoo.org> wmpop3lb-2.4.2-r2.ebuild : + Revision bump, with patch to fix bug #161530. 03 May 2006; Jason Wever <weeve@gentoo.org> wmpop3lb-2.4.2-r1.ebuild: Added ~sparc keyword. @@ -15,7 +20,7 @@ *wmpop3lb-2.4.2-r1 (01 Dec 2005) 01 Dec 2005; Michele Noberasco <s4t4n@gentoo.org> wmpop3lb-2.4.2-r1.ebuild : - Version bump, with patch to fix bug #110683. + Revision bump, with patch to fix bug #110683. 28 Jun 2004; Aron Griffis <agriffis@gentoo.org> wmpop3lb-2.4.2.ebuild: add sed-4 dep diff --git a/x11-plugins/wmpop3lb/files/digest-wmpop3lb-2.4.2-r2 b/x11-plugins/wmpop3lb/files/digest-wmpop3lb-2.4.2-r2 new file mode 100644 index 000000000000..4269e364e398 --- /dev/null +++ b/x11-plugins/wmpop3lb/files/digest-wmpop3lb-2.4.2-r2 @@ -0,0 +1,3 @@ +MD5 40760d8963c25d58dea84679a390f1ac wmpop3lb2.4.2.tar.gz 37391 +RMD160 9625131b5284258d751089d9a9e1e11a62650eb9 wmpop3lb2.4.2.tar.gz 37391 +SHA256 209b5ca409f226032b1200779e09f3d45a3522bc08eeb9f1b63e14bd04e780f3 wmpop3lb2.4.2.tar.gz 37391 diff --git a/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch b/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch new file mode 100644 index 000000000000..16cbe4ed6bce --- /dev/null +++ b/x11-plugins/wmpop3lb/files/wmpop3lb-2.4.2-fix-RECV-and-try-STAT-if-LAST-wont-work.patch @@ -0,0 +1,190 @@ +--- wmpop3lb2.4.2/wmpop3/Pop3Client.c 2002-06-27 16:04:42.000000000 +0200 ++++ wmpop3lb2.4.2-pathed/wmpop3/Pop3Client.c 2007-01-11 14:39:12.000000000 +0200 +@@ -27,6 +27,49 @@ + + #include "Pop3Client.h" + ++/* receive full responce */ ++int do_recv(int s, void *ibuf, size_t len, int flags) ++{ ++ size_t ret, total; ++ char *p, *buf = ibuf; ++ ++ total = 0; ++ while (1) ++ { ++ /* left one byte for null termination */ ++ ret = recv(s, buf + total, len - 1 - total, flags); ++ /* if we got error or close, then brea */ ++ if (ret <= 0) ++ { ++ break; ++ } ++ /* increase size of received data */ ++ total += ret; ++ /* null terminating received data */ ++ buf[total] = 0; ++ /* left one byte for null termination ++ * if out of buffer, return */ ++ if (len - total <= 1) ++ { ++ break; ++ } ++ /* if we found end of line signal, then stop */ ++ p = strstr(buf, "\r\n"); ++ printf("p == %p\n", p); ++ if (p != 0) ++ { ++ break; ++ } ++ } ++ ++ /* if there wasn't any data, then return error code */ ++ if (total == 0) ++ { ++ return ret; ++ } ++ return total; ++} ++ + /* return size if all goes well, -1 if not expected answer */ + int send_command(char *exp_answer, char **retour, Pop3 pc) + { +@@ -61,18 +104,29 @@ + return (pc); + } + int pop3MakeConnection(Pop3 pc, char *serverName, int port){ ++ struct timeval t; + + pc->s = socket(AF_INET, SOCK_STREAM, 0 ); + memset( &(pc->server), 0 , sizeof(pc->server)); + pc->server.sin_family = AF_INET; + pc->hp = gethostbyname(serverName); + if( pc->hp == 0) ++ { ++ close(pc->s); + return -1; ++ } + memcpy( &(pc->server.sin_addr), pc->hp->h_addr, pc->hp->h_length); + pc->server.sin_port = htons(port); + if ( connect(pc->s, (struct sockaddr *)&(pc->server) + , sizeof(pc->server)) < 0 ) ++ { ++ close(pc->s); + return -1; ++ } ++ t.tv_sec = 60; ++ t.tv_usec = 0; ++ setsockopt(pc->s, SOL_SOCKET, SO_RCVTIMEO, &t, sizeof(t)); ++ setsockopt(pc->s, SOL_SOCKET, SO_SNDTIMEO, &t, sizeof(t)); + pc->connected = CONNECTED; + return 0; + } +@@ -94,7 +148,7 @@ + return -1; + } + +- size = recv(pc->s,&pc->inBuf,1024,0); ++ size = do_recv(pc->s,&pc->inBuf,1024,0); + memset(temp,0,1024); + memcpy(temp,pc->inBuf,size); + if( temp[0] != '+' ){ +@@ -104,10 +158,10 @@ + + sprintf(pc->outBuf,"USER %s\r\n",name); + send(pc->s, &pc->outBuf,strlen(pc->outBuf),0); +- size =recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + memset(temp,0,1024); + memcpy(temp,pc->inBuf,size); +- if( temp[0] != '+' ){ ++ if( temp[0] != '+' && temp[0] != '\r' ){ + fprintf(stderr,"Invalid User Name\n"); + return -1; + } +@@ -115,10 +169,10 @@ + memset(pc->outBuf,0,1024); + sprintf(pc->outBuf,"PASS %s\r\n",pass); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size =recv(pc->s,&pc->inBuf,1024,0); ++ size = do_recv(pc->s,&pc->inBuf,1024,0); + memset(temp,0,1024); + memcpy(temp,pc->inBuf,size); +- if( temp[0] != '+' ){ ++ if( temp[0] != '+' && temp[0] != '\r'){ + fprintf(stderr,"Incorrect Password\n"); + return -1; + } +@@ -213,7 +267,7 @@ + /* Find total number of messages in mail box */ + sprintf(pc->outBuf,"STAT\r\n"); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size = recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + if( pc->inBuf[0] != '+' ){ + perror("Error Receiving Stats"); + return (-1); +@@ -266,7 +320,7 @@ + /* Find total number of messages in mail box */ + sprintf(pc->outBuf,"STAT\r\n"); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size = recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + pc->inBuf[size] = '\0'; + #ifdef _DEBUG + printf(" pop3CheckMail, stat received buf (size=%d): [%s]\n", +@@ -313,7 +367,7 @@ + + sprintf(pc->outBuf,"LAST\r\n"); + send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); +- size = recv(pc->s,pc->inBuf,1024,0); ++ size = do_recv(pc->s,pc->inBuf,1024,0); + pc->inBuf[size] = '\0'; + #ifdef _DEBUG + printf(" pop3CheckMail, last received buf (size=%d): [%s]\n", +@@ -325,9 +379,25 @@ + #ifdef _DEBUG + printf(" Error Receiving LAST: [%s]\n", temp); + #endif +- pc->numOfUnreadMessages = pc->numOfMessages; ++ /* TRY STAT instead LAST */ ++ sprintf(pc->outBuf,"STAT\r\n"); ++ send(pc->s, pc->outBuf, strlen(pc->outBuf),0 ); ++ size = do_recv(pc->s,pc->inBuf,1024,0); ++ pc->inBuf[size] = '\0'; ++#ifdef _DEBUG ++ printf(" pop3CheckMail, last received buf (size=%d): [%s]\n", ++ size, pc->inBuf); ++#endif ++ memset(temp,0,1024); ++ memcpy(temp,pc->inBuf,size); ++ if( temp[0] != '+' ){ ++#ifdef _DEBUG ++ printf(" Error Receiving STAT: [%s]\n", temp); ++#endif ++ pc->numOfUnreadMessages = pc->numOfMessages; ++ } + } +- else { ++ if( temp[0] != '+' ){ + ptr = strtok(temp, " "); + ptr = strtok( 0," "); + pc->numOfUnreadMessages = pc->numOfMessages - atoi(ptr); +@@ -545,7 +615,7 @@ + printf(" %s\n", pc->outBuf); + #endif + send(pc->s, pc->outBuf, strlen(pc->outBuf), 0); +- size = recv(pc->s, pc->inBuf, 4096, 0); ++ size = do_recv(pc->s, pc->inBuf, 4096, 0); + if ('+' != pc->inBuf[0]) { + perror("error while deleting mail"); + return (1); +@@ -579,7 +649,7 @@ + if( pc->connected == NOT_CONNECTED ) + return -1; + send(pc->s, "quit\r\n", 6,0 ); +- size =recv(pc->s,&pc->inBuf,1024,0); ++ size = do_recv(pc->s,&pc->inBuf,1024,0); + pc->connected = NOT_CONNECTED; + if(pc->s != 0) + close(pc->s); diff --git a/x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild b/x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild new file mode 100644 index 000000000000..cfc82c09337b --- /dev/null +++ b/x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-plugins/wmpop3lb/wmpop3lb-2.4.2-r2.ebuild,v 1.1 2007/01/17 11:19:06 s4t4n Exp $ + +inherit eutils + +IUSE="" + +MY_P=${PN}${PV} +S=${WORKDIR}/${MY_P} +DESCRIPTION="dockapp for checking up to 7 pop3 accounts" +HOMEPAGE="http://wmpop3lb.jourdain.org" +SRC_URI="http://lbj.free.fr/wmpop3/${MY_P}.tar.gz" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~sparc ~x86" + +RDEPEND="|| ( ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXpm ) + virtual/x11 )" +DEPEND="${RDEPEND} + || ( x11-proto/xextproto virtual/x11 ) + >=sys-apps/sed-4" + +src_unpack() { + unpack ${A} ; cd ${S}/wmpop3 + + sed -i -e "s:-g2 -D_DEBUG:${CFLAGS}:" Makefile + + #Fix bug #110683 - it is already included in the following patch + #epatch ${FILESDIR}/${P}-socket-close.patch + + #Fix bug #161530 + epatch ${FILESDIR}/${P}-fix-RECV-and-try-STAT-if-LAST-wont-work.patch +} + +src_compile() { + emake -C wmpop3 || die "parallel make failed" +} + +src_install() { + dobin wmpop3/wmpop3lb + dodoc CHANGE_LOG README +} |