From owner-freebsd-ports@FreeBSD.ORG Wed Sep 17 06:31:35 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0AB2B16A500 for ; Wed, 17 Sep 2003 06:31:35 -0700 (PDT) Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47B6A43FCB for ; Wed, 17 Sep 2003 06:31:32 -0700 (PDT) (envelope-from stijn@pcwin002.win.tue.nl) Received: from pcwin002.win.tue.nl (orb_rules@localhost [127.0.0.1]) by pcwin002.win.tue.nl (8.12.9/8.12.9) with ESMTP id h8HDVrwR019912; Wed, 17 Sep 2003 15:31:53 +0200 (CEST) (envelope-from stijn@pcwin002.win.tue.nl) Received: (from stijn@localhost) by pcwin002.win.tue.nl (8.12.9/8.12.9/Submit) id h8HDVr6r019911; Wed, 17 Sep 2003 15:31:53 +0200 (CEST) Date: Wed, 17 Sep 2003 15:31:53 +0200 From: Stijn Hoop To: Jasminko Mulahusic Message-ID: <20030917133153.GF10778@pcwin002.win.tue.nl> References: <3F684D95.7080403@fakat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: <3F684D95.7080403@fakat.com> User-Agent: Mutt/1.4.1i X-Bright-Idea: Let's abolish HTML mail! cc: ports@freebsd.org Subject: Re: dctc-0.84.1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2003 13:31:35 -0000 --jq0ap7NbKX2Kqbes Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 17, 2003 at 02:03:33PM +0200, Jasminko Mulahusic wrote: > why don't you upgrade the dctc port, as current one 0.84.1 is not working? Because someone needs to do some work to get it to run? Attached are mostly untested patches to update it to 0.85.5, but I've since become convinced that there are no usable GUIs out there for dctc, so I've lost interest (can _anyone_ point me to a text ui for dctc that works?!) I haven't submitted these because a) pkg-plist is likely broken and b) I haven't really been able to test functionality. Maybe you can correct the patches and send the update to the FreeBSD bug system? --Stijn --=20 "Linux has many different distributions, meaning that you can probably find one that is exactly what you want (I even found one that looked like a Unix system)." -- Mike Meyer, from a posting at questions@freebsd.org --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dctc-0.85.5.patch" Content-Transfer-Encoding: quoted-printable diff -urN --exclude=3DCVS /usr/ports/net/dctc/Makefile dctc/Makefile --- /usr/ports/net/dctc/Makefile Tue Aug 19 10:08:14 2003 +++ dctc/Makefile Sat Sep 13 02:24:57 2003 @@ -6,9 +6,10 @@ # =20 PORTNAME=3D dctc -PORTVERSION=3D 0.84.1 +PORTVERSION=3D 0.85.5 CATEGORIES=3D net -MASTER_SITES=3D http://unixpages.org/distfiles/ \ +MASTER_SITES=3D http://brainz.servebeer.com/dctc/ \ + http://unixpages.org/distfiles/ \ http://ac2i.tzo.com/dctc/ DISTNAME=3D ${PORTNAME}-${PORTVERSION} =20 @@ -30,14 +31,15 @@ CONFIGURE_ARGS=3D --enable-manual-db-detect --with-db=3D${LOCALBASE} MANCOMPRESSED=3D no =20 -MAN1=3D dctc.1 +MAN1=3D dctc.1 dctc_cmd.1 dctc_gdl123.1 =20 -DCTC_BINS=3D dctc dctc_cmd +DCTC_BINS=3D dctc dctc_cmd dctc_master dctc_gdl123 DOC_DIRS=3D Documentation Documentation/DCextensions DOC_FILES=3D COPYING ChangeLog INSTALL README \ KNOWN_BUGS TODO \ Documentation/BerkeleyDB \ Documentation/BerkeleyDB.nl \ + Documentation/DCextensions/ed2k_crc \ Documentation/DCextensions/p2p_capabilities \ Documentation/DCextensions/p2p_capabilities.nl \ Documentation/DCextensions/search_by_content \ @@ -54,7 +56,8 @@ Documentation/programs.nl \ Documentation/programs.pl \ Documentation/output.nl \ - Documentation/output Documentation/programs + Documentation/output Documentation/programs \ + Documentation/core_0.85.4 =20 .include =20 @@ -103,7 +106,10 @@ @${MKDIR} ${PREFIX}/share/${PORTNAME} @${INSTALL_SCRIPT} ${WRKSRC}/GDLjoiner \ ${PREFIX}/share/${PORTNAME} - @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1 +.for file in ${MAN1} + @${INSTALL_MAN} ${WRKSRC}/${file} ${MANPREFIX}/man/man1 +.endfor + @${INSTALL_MAN} ${WRKSRC}/hublist.1 ${MANPREFIX}/man/man1/dc_hublist.1 @${INSTALL_PROGRAM} ${WRKSRC}/src/hublist ${PREFIX}/bin/dc_hublist .for file in ${DCTC_BINS} @${INSTALL_PROGRAM} ${WRKSRC}/src/${file} ${PREFIX}/bin diff -urN --exclude=3DCVS /usr/ports/net/dctc/distinfo dctc/distinfo --- /usr/ports/net/dctc/distinfo Tue Feb 4 16:23:17 2003 +++ dctc/distinfo Sat Sep 13 01:29:41 2003 @@ -1 +1 @@ -MD5 (dctc-0.84.1.tar.gz) =3D 94bd260453605081d048f733ed089e21 +MD5 (dctc-0.85.5.tar.gz) =3D 8d2823e1054b3bf432ac740a5484b452 diff -urN --exclude=3DCVS /usr/ports/net/dctc/files/patch-src::dc_manage.c = dctc/files/patch-src::dc_manage.c --- /usr/ports/net/dctc/files/patch-src::dc_manage.c Sun Aug 4 20:03:54 20= 02 +++ dctc/files/patch-src::dc_manage.c Sat Sep 13 02:08:01 2003 @@ -1,6 +1,6 @@ ---- src/dc_manage.c.orig Mon Jul 22 13:20:19 2002 -+++ src/dc_manage.c Mon Jul 22 18:18:40 2002 -@@ -554,18 +554,6 @@ +--- src/dc_manage.c.orig Sat Sep 13 02:07:14 2003 ++++ src/dc_manage.c Sat Sep 13 02:07:46 2003 +@@ -587,18 +587,6 @@ =20 unconvert_path(fullpathname); =20 @@ -19,7 +19,7 @@ if(hide_absolute=3D=3D0) { if(((unsigned char)fullpathname[0])=3D=3D255) -@@ -580,6 +568,18 @@ +@@ -613,6 +601,18 @@ fullpathname[0]=3D'/'; } =20 @@ -38,7 +38,7 @@ /* it is time to verify if a slot is available */ LOCK_WRITE(user_info); if((dl_on=3D=3D0)||(virtual!=3D0)) -@@ -743,18 +743,6 @@ +@@ -776,18 +776,6 @@ =20 unconvert_path(fullpathname); =20 @@ -57,7 +57,7 @@ if(hide_absolute=3D=3D0) { if(((unsigned char)fullpathname[0])=3D=3D255) -@@ -769,6 +757,17 @@ +@@ -802,6 +790,17 @@ fullpathname[0]=3D'/'; } =20 diff -urN --exclude=3DCVS /usr/ports/net/dctc/files/patch-src::main.c dctc/= files/patch-src::main.c --- /usr/ports/net/dctc/files/patch-src::main.c Sat Oct 5 19:20:14 2002 +++ dctc/files/patch-src::main.c Sat Sep 13 02:09:04 2003 @@ -1,6 +1,6 @@ ---- src/main.c.orig Sun Sep 29 14:07:48 2002 -+++ src/main.c Sun Sep 29 14:08:52 2002 -@@ -1269,6 +1269,7 @@ +--- src/main.c.orig Sat Sep 13 02:08:20 2003 ++++ src/main.c Sat Sep 13 02:08:50 2003 +@@ -1238,6 +1238,7 @@ =20 char *virtual_share_path=3DNULL; =20 diff -urN --exclude=3DCVS /usr/ports/net/dctc/files/patch-src::mydb.c dctc/= files/patch-src::mydb.c --- /usr/ports/net/dctc/files/patch-src::mydb.c Sun Aug 4 20:03:54 2002 +++ dctc/files/patch-src::mydb.c Sat Sep 13 02:10:43 2003 @@ -1,6 +1,6 @@ ---- src/mydb.c.orig Mon Jul 22 13:48:07 2002 -+++ src/mydb.c Mon Jul 22 19:21:42 2002 -@@ -1141,6 +1141,16 @@ +--- src/mydb.c.orig Sat Sep 13 02:09:24 2003 ++++ src/mydb.c Sat Sep 13 02:10:20 2003 +@@ -1109,6 +1109,16 @@ int file_in_db(char *filename, int *virtual) { int i; @@ -13,11 +13,11 @@ + else + filename_internal=3Dfilename+1; + } else -+ filename_internal=3Dfilename; ++ filename_internal=3Dfilename; =20 G_LOCK(shared_info); if(shared_info!=3DNULL) -@@ -1151,7 +1161,7 @@ +@@ -1119,7 +1129,7 @@ =20 /* DB_ENTRY to compare */ de=3D&(g_array_index(shared_info,DB_ENTRY,i)); diff -urN --exclude=3DCVS /usr/ports/net/dctc/files/patch-src::sema.c dctc/= files/patch-src::sema.c --- /usr/ports/net/dctc/files/patch-src::sema.c Sun Aug 4 20:03:54 2002 +++ dctc/files/patch-src::sema.c Sat Sep 13 02:21:58 2003 @@ -1,6 +1,6 @@ ---- src/sema.c.orig Sun Jul 21 21:13:59 2002 -+++ src/sema.c Mon Jul 22 19:30:15 2002 -@@ -22,6 +22,10 @@ +--- src/sema.c.orig Thu Aug 21 19:03:36 2003 ++++ src/sema.c Sat Sep 13 02:19:44 2003 +@@ -25,6 +25,10 @@ # include #endif =20 @@ -11,19 +11,19 @@ #include #include #include -@@ -57,6 +61,11 @@ - #include "uaddr.h" - #include "status.h" +@@ -65,6 +69,11 @@ + #include "network.h" + #include "gdl.h" =20 +/* interval between busy wait tries measured in microseconds */ +#define MUTEX_BUSY_WAIT_TIME 5000 + -+pthread_mutex_t *semaphore_mutex =3D PTHREAD_MUTEX_INITIALIZER; ++pthread_mutex_t *semaphore_mutex =3D PTHREAD_MUTEX_INITIALIZER; + /***********************************************************************/ /* the following functions manage the bandwidth upload limit */ /* The system is build on 2 semaphores and 1 file */ -@@ -100,6 +109,8 @@ +@@ -108,6 +117,8 @@ =20 int semid; =20 @@ -32,7 +32,7 @@ fd=3Dopen(keyfile,O_CREAT|O_WRONLY|O_EXCL,0600); /* create the file if = not exists */ if(fd=3D=3D-1) { -@@ -131,7 +142,11 @@ +@@ -139,7 +150,11 @@ { close(fd); /* a key exist */ @@ -44,29 +44,29 @@ if(semid=3D=3D-1) goto create_new_sema; printf("current sema found.\n"); -@@ -293,8 +308,13 @@ +@@ -285,8 +300,13 @@ void check_sema_master(int semid) { struct sembuf sb=3D{0,-1,IPC_NOWAIT|SEM_UNDO}; /* master sema */ + int result; -+ +=20 +- if(semop(semid,&sb,1)=3D=3D0) + (void) lp_mutex_lock_(semaphore_mutex); + result =3D semop(semid,&sb,1); + (void) lp_mutex_unlock_(semaphore_mutex); -=20 -- if(semop(semid,&sb,1)=3D=3D0) -+ if (result=3D=3D0) ++ ++ if(result=3D=3D0) { - /* to get slice, the function checks if the clock thread still runs */ - create_sema_master(semid); -@@ -308,15 +328,29 @@ + /* we have successfully obtain the semaphore */ + /* 1) release it */ +@@ -448,15 +468,29 @@ /*******************************************/ void get_slice(int semid, SPD_SEMA semnum) { +#if !(defined(BSD) && (BSD >=3D 199103)) -+ struct sembuf local=3D{0,-1,0}; /* slave sema */ ++ struct sembuf local=3D{0,-1,0}; /* slave sema */ +#else -+ struct sembuf local=3D{0,-1,0|IPC_NOWAIT}; /* slave sema */ ++ struct sembuf local=3D{0,-1,0|IPC_NOWAIT}; /* slave sema */ +#endif + local.sem_num=3Dsemnum; + @@ -81,78 +81,18 @@ - /* we have what we want */ - return; + switch (semop(semid,&local,1)) { -+ case 0: (void) lp_mutex_unlock_(semaphore_mutex); -+ /* we have what we want */ -+ return; -+ break; -+ case -1: switch(errno) { -+ case EAGAIN: /* triggers busy wait */ -+ case EINTR: /* interrupted by system call, try again */ -+ pthread_yield(); -+ usleep(MUTEX_BUSY_WAIT_TIME); /* busy wait with a small time out= */ -+ continue; -+ break; -+ } - } - } - } -@@ -368,9 +402,26 @@ - /******************************/ - void lock_ul_slot_controler(int semid) - { -+#if !(defined(BSD) && (BSD >=3D 199103)) - struct sembuf get_ul_ctrl=3D{UL_SLOT_SEMA,-1,SEM_UNDO}; -+#else -+ struct sembuf get_ul_ctrl=3D{UL_SLOT_SEMA,-1,SEM_UNDO|IPC_NOWAIT}; -+#endif -+ -+ (void) lp_mutex_lock_(semaphore_mutex); -+repeat: - /* lock the UL slot controler */ -- semop(semid,&get_ul_ctrl,1); -+ if (semop(semid,&get_ul_ctrl,1)=3D=3D-1) -+ switch(errno) -+ { -+ case EAGAIN: /* triggers busy wait */ -+ case EINTR: /* interrupted by system call, try again */ -+ pthread_yield(); -+ usleep(MUTEX_BUSY_WAIT_TIME); /* busy wait with a small time out */ -+ goto repeat; -+ break; -+ } -+ (void) lp_mutex_unlock_(semaphore_mutex); - } -=20 - /*********************************/ -@@ -526,11 +577,28 @@ - perror("free_one_ul_slot"); - } - #else -+# if !(defined(BSD) && (BSD >=3D 199103)) - struct sembuf free_one_ul_slot_op=3D{UL_SLOT_BUSY_SEMA,-1,SEM_UNDO}; -- if(semop(semid,&free_one_ul_slot_op,1)=3D=3D-1) -- { -- perror("free_one_ul_slot"); -+# else -+ struct sembuf free_one_ul_slot_op=3D{UL_SLOT_BUSY_SEMA,-1,SEM_UNDO|IPC_= NOWAIT}; -+# endif -+ -+ (void) lp_mutex_lock_(semaphore_mutex); -+repeat: -+ if(semop(semid,&free_one_ul_slot_op,1)=3D=3D-1) { -+ switch(errno) { -+ case EAGAIN: /* triggers busy wait */ -+ case EINTR: /* interrupted by system call, try again */ ++ case 0: (void) lp_mutex_unlock_(semaphore_mutex); ++ /* we have what we want */ ++ return; ++ case -1: switch(errno) { ++ case EAGAIN: /* triggers busy wait */ ++ case EINTR: /* interrupted by ++ syscall, try again */ + pthread_yield(); -+ usleep(MUTEX_BUSY_WAIT_TIME); /* busy wait with a small tim= e out */ -+ goto repeat; -+ break; -+ default: -+ perror("free_one_ul_slot"); ++ usleep(MUTEX_BUSY_WAIT_TIME); ++ continue; + break; + } } -+ (void) lp_mutex_unlock_(semaphore_mutex); - #endif - nb_local_ul--; } + } diff -urN --exclude=3DCVS /usr/ports/net/dctc/files/patch-src::sema_master.= c dctc/files/patch-src::sema_master.c --- /usr/ports/net/dctc/files/patch-src::sema_master.c Thu Jan 1 01:00:00 = 1970 +++ dctc/files/patch-src::sema_master.c Sat Sep 13 01:54:40 2003 @@ -0,0 +1,18 @@ +--- src/sema_master.c.orig Sat Sep 13 01:54:10 2003 ++++ src/sema_master.c Sat Sep 13 01:54:22 2003 +@@ -44,6 +44,7 @@ + #if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) + /* union semun is defined by including */ + #else ++#ifndef __FreeBSD__ + /* according to X/OPEN we have to define it ourselves */ + union semun { + int val; /* value for SETVAL */ +@@ -51,6 +52,7 @@ + unsigned short int *array; /* array for GETALL, SETALL */ + struct seminfo *__buf; /* buffer for IPC_INFO */ + }; ++#endif + #endif + #endif +=20 diff -urN --exclude=3DCVS /usr/ports/net/dctc/files/patch-src::userinfo.c d= ctc/files/patch-src::userinfo.c --- /usr/ports/net/dctc/files/patch-src::userinfo.c Thu Jan 1 01:00:00 1970 +++ dctc/files/patch-src::userinfo.c Sat Sep 13 01:49:08 2003 @@ -0,0 +1,10 @@ +--- src/userinfo.c.orig Sat Sep 13 01:48:17 2003 ++++ src/userinfo.c Sat Sep 13 01:48:31 2003 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include +=20 + #include "userinfo.h" diff -urN --exclude=3DCVS /usr/ports/net/dctc/pkg-plist dctc/pkg-plist --- /usr/ports/net/dctc/pkg-plist Mon Nov 18 01:29:18 2002 +++ dctc/pkg-plist Sat Sep 13 02:24:00 2003 @@ -1,11 +1,14 @@ bin/dc_hublist bin/dctc bin/dctc_cmd +bin/dctc_gdl123 +bin/dctc_master share/dctc/GDLjoiner %%PORTDOCS%%share/doc/dctc/COPYING %%PORTDOCS%%share/doc/dctc/ChangeLog %%PORTDOCS%%share/doc/dctc/Documentation/BerkeleyDB %%PORTDOCS%%share/doc/dctc/Documentation/BerkeleyDB.nl +%%PORTDOCS%%share/doc/dctc/Documentation/DCextensions/ed2k_crc %%PORTDOCS%%share/doc/dctc/Documentation/DCextensions/p2p_capabilities %%PORTDOCS%%share/doc/dctc/Documentation/DCextensions/p2p_capabilities.nl %%PORTDOCS%%share/doc/dctc/Documentation/DCextensions/search_by_content @@ -22,6 +25,7 @@ %%PORTDOCS%%share/doc/dctc/Documentation/Vshare.nl %%PORTDOCS%%share/doc/dctc/Documentation/commands %%PORTDOCS%%share/doc/dctc/Documentation/commands.nl +%%PORTDOCS%%share/doc/dctc/Documentation/core_0.85.4 %%PORTDOCS%%share/doc/dctc/Documentation/output %%PORTDOCS%%share/doc/dctc/Documentation/output.nl %%PORTDOCS%%share/doc/dctc/Documentation/programs --tKW2IUtsqtDRztdT-- --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/aGJJY3r/tLQmfWcRAiDOAJ9vhAKwhE5b9Q6kfsOHWbxS6RmOygCfb+Bc fYMjv97YM2MsZ8aXnzqlkNk= =59s7 -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes--