dctc-0.84.1
Stijn Hoop
stijn at win.tue.nl
Wed Sep 17 06:31:35 PDT 2003
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
--
"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 at freebsd.org
-------------- next part --------------
diff -urN --exclude=CVS /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 @@
#
PORTNAME= dctc
-PORTVERSION= 0.84.1
+PORTVERSION= 0.85.5
CATEGORIES= net
-MASTER_SITES= http://unixpages.org/distfiles/ \
+MASTER_SITES= http://brainz.servebeer.com/dctc/ \
+ http://unixpages.org/distfiles/ \
http://ac2i.tzo.com/dctc/
DISTNAME= ${PORTNAME}-${PORTVERSION}
@@ -30,14 +31,15 @@
CONFIGURE_ARGS= --enable-manual-db-detect --with-db=${LOCALBASE}
MANCOMPRESSED= no
-MAN1= dctc.1
+MAN1= dctc.1 dctc_cmd.1 dctc_gdl123.1
-DCTC_BINS= dctc dctc_cmd
+DCTC_BINS= dctc dctc_cmd dctc_master dctc_gdl123
DOC_DIRS= Documentation Documentation/DCextensions
DOC_FILES= 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
.include <bsd.port.pre.mk>
@@ -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=CVS /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) = 94bd260453605081d048f733ed089e21
+MD5 (dctc-0.85.5.tar.gz) = 8d2823e1054b3bf432ac740a5484b452
diff -urN --exclude=CVS /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 2002
+++ 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 @@
unconvert_path(fullpathname);
@@ -19,7 +19,7 @@
if(hide_absolute==0)
{
if(((unsigned char)fullpathname[0])==255)
-@@ -580,6 +568,18 @@
+@@ -613,6 +601,18 @@
fullpathname[0]='/';
}
@@ -38,7 +38,7 @@
/* it is time to verify if a slot is available */
LOCK_WRITE(user_info);
if((dl_on==0)||(virtual!=0))
-@@ -743,18 +743,6 @@
+@@ -776,18 +776,6 @@
unconvert_path(fullpathname);
@@ -57,7 +57,7 @@
if(hide_absolute==0)
{
if(((unsigned char)fullpathname[0])==255)
-@@ -769,6 +757,17 @@
+@@ -802,6 +790,17 @@
fullpathname[0]='/';
}
diff -urN --exclude=CVS /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 @@
char *virtual_share_path=NULL;
diff -urN --exclude=CVS /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=filename+1;
+ } else
-+ filename_internal=filename;
++ filename_internal=filename;
G_LOCK(shared_info);
if(shared_info!=NULL)
-@@ -1151,7 +1161,7 @@
+@@ -1119,7 +1129,7 @@
/* DB_ENTRY to compare */
de=&(g_array_index(shared_info,DB_ENTRY,i));
diff -urN --exclude=CVS /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 <config.h>
#endif
@@ -11,19 +11,19 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-@@ -57,6 +61,11 @@
- #include "uaddr.h"
- #include "status.h"
+@@ -65,6 +69,11 @@
+ #include "network.h"
+ #include "gdl.h"
+/* interval between busy wait tries measured in microseconds */
+#define MUTEX_BUSY_WAIT_TIME 5000
+
-+pthread_mutex_t *semaphore_mutex = PTHREAD_MUTEX_INITIALIZER;
++pthread_mutex_t *semaphore_mutex = 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 @@
int semid;
@@ -32,7 +32,7 @@
fd=open(keyfile,O_CREAT|O_WRONLY|O_EXCL,0600); /* create the file if not exists */
if(fd==-1)
{
-@@ -131,7 +142,11 @@
+@@ -139,7 +150,11 @@
{
close(fd);
/* a key exist */
@@ -44,29 +44,29 @@
if(semid==-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={0,-1,IPC_NOWAIT|SEM_UNDO}; /* master sema */
+ int result;
-+
+
+- if(semop(semid,&sb,1)==0)
+ (void) lp_mutex_lock_(semaphore_mutex);
+ result = semop(semid,&sb,1);
+ (void) lp_mutex_unlock_(semaphore_mutex);
-
-- if(semop(semid,&sb,1)==0)
-+ if (result==0)
++
++ if(result==0)
{
- /* 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 >= 199103))
-+ struct sembuf local={0,-1,0}; /* slave sema */
++ struct sembuf local={0,-1,0}; /* slave sema */
+#else
-+ struct sembuf local={0,-1,0|IPC_NOWAIT}; /* slave sema */
++ struct sembuf local={0,-1,0|IPC_NOWAIT}; /* slave sema */
+#endif
+ local.sem_num=semnum;
+
@@ -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 >= 199103))
- struct sembuf get_ul_ctrl={UL_SLOT_SEMA,-1,SEM_UNDO};
-+#else
-+ struct sembuf get_ul_ctrl={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)==-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);
- }
-
- /*********************************/
-@@ -526,11 +577,28 @@
- perror("free_one_ul_slot");
- }
- #else
-+# if !(defined(BSD) && (BSD >= 199103))
- struct sembuf free_one_ul_slot_op={UL_SLOT_BUSY_SEMA,-1,SEM_UNDO};
-- if(semop(semid,&free_one_ul_slot_op,1)==-1)
-- {
-- perror("free_one_ul_slot");
-+# else
-+ struct sembuf free_one_ul_slot_op={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)==-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 time 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=CVS /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 <sys/sem.h> */
+ #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
+
diff -urN --exclude=CVS /usr/ports/net/dctc/files/patch-src::userinfo.c dctc/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 <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <glib.h>
+
+ #include "userinfo.h"
diff -urN --exclude=CVS /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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20030917/48f3fba6/attachment.bin
More information about the freebsd-ports
mailing list