summaryrefslogtreecommitdiff
path: root/audio/grip
diff options
context:
space:
mode:
authorFUJISHIMA Satsuki <sf@FreeBSD.org>2002-01-22 17:11:00 +0000
committerFUJISHIMA Satsuki <sf@FreeBSD.org>2002-01-22 17:11:00 +0000
commitc4c115b14926e0982f69c42d4954021f58b51e79 (patch)
tree31f271d860bcc806de79cf3118e607309a1cedee /audio/grip
parentUpdate to 1.04. (diff)
quotes from the PR:
>>>> 1. Add a timeout to CDDB connect, so it won't hang forever. 2. Remove two patches that did nothing. 3. Fix misspellings of "psychedelic". 4. Change MASTER_SITE to MASTER_SITE_SOURCEFORGE, since SF has multiple download URLs. Note 1: I had to remove the original site when I added MASTER_SITE_SOURCEFORGE, because the md5sums don't match, although the untarred contents do. Note 2: patch-ad, which was also removed, was folded into patch-grip.c. <<<< PR: 34152 Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=53588
Diffstat (limited to 'audio/grip')
-rw-r--r--audio/grip/Makefile5
-rw-r--r--audio/grip/distinfo2
-rw-r--r--audio/grip/files/patch-ab10
-rw-r--r--audio/grip/files/patch-ac14
-rw-r--r--audio/grip/files/patch-ad29
-rw-r--r--audio/grip/files/patch-cddb.c160
-rw-r--r--audio/grip/files/patch-grip.c99
-rw-r--r--audio/grip/files/patch-grip.h18
8 files changed, 281 insertions, 56 deletions
diff --git a/audio/grip/Makefile b/audio/grip/Makefile
index 68944b14d30e..83e6e29d2b00 100644
--- a/audio/grip/Makefile
+++ b/audio/grip/Makefile
@@ -7,9 +7,10 @@
PORTNAME= grip
PORTVERSION= 2.96
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= audio
-MASTER_SITES= http://www.nostatic.org/grip/
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR=grip
EXTRACT_SUFX= .tgz
MAINTAINER= ports@geeksrus.net
diff --git a/audio/grip/distinfo b/audio/grip/distinfo
index 94535939d122..62c80fe265a1 100644
--- a/audio/grip/distinfo
+++ b/audio/grip/distinfo
@@ -1 +1 @@
-MD5 (grip-2.96.tgz) = 93bd9c4672a8d53daf32772812e624d8
+MD5 (grip-2.96.tgz) = 29d03b2874c5cb60096ac3051fbbc4e3
diff --git a/audio/grip/files/patch-ab b/audio/grip/files/patch-ab
deleted file mode 100644
index 468dd44d029f..000000000000
--- a/audio/grip/files/patch-ab
+++ /dev/null
@@ -1,10 +0,0 @@
---- grip.h.orig Tue Apr 18 10:37:44 2000
-+++ grip.h Mon Sep 4 17:59:26 2000
-@@ -257,6 +257,7 @@
- /* Low-level cd control routines -- found in cd.c */
-
- int CDInitDevice(char *device_name);
-+void CDCloseDevice(int cd_desc);
- int CDStat(int cd_desc,struct disc_info *disc,gboolean read_toc);
- int CDPlayFrames(int cd_desc,int startframe,int endframe);
- int CDPlayTrackPos(int cd_desc,struct disc_info *disc,int starttrack,
diff --git a/audio/grip/files/patch-ac b/audio/grip/files/patch-ac
deleted file mode 100644
index 454fef3fd7e1..000000000000
--- a/audio/grip/files/patch-ac
+++ /dev/null
@@ -1,14 +0,0 @@
---- cd.c.orig Tue Apr 18 10:37:44 2000
-+++ cd.c Mon Sep 4 17:59:26 2000
-@@ -98,6 +98,11 @@
- return cd_desc;
- }
-
-+void CDCloseDevice(int cd_desc)
-+{
-+ close(cd_desc);
-+}
-+
- /* Update a CD status structure... because operating system interfaces vary
- so does this function. */
-
diff --git a/audio/grip/files/patch-ad b/audio/grip/files/patch-ad
deleted file mode 100644
index 9fa8b797b681..000000000000
--- a/audio/grip/files/patch-ad
+++ /dev/null
@@ -1,29 +0,0 @@
---- grip.c.orig Thu Oct 19 04:12:53 2000
-+++ grip.c Fri Oct 20 20:55:01 2000
-@@ -314,7 +314,7 @@
- gboolean use_proxy=FALSE;
- gboolean use_proxy_env=FALSE;
-
--char *bin_search_paths[]={"/cpd/misc/bin","/usr/bin","/usr/local/bin",NULL};
-+char *bin_search_paths[]={"/cpd/misc/bin","/usr/bin","%%LOCALBASE%%/bin",NULL};
- Ripper ripper_defaults[]={
- #ifdef CDPAR
- {"grip (cdparanoia)",""},
-@@ -327,7 +327,7 @@
- #endif
- {"other",""},
- {"",""}};
--char ripexename[256]="/usr/bin/cdparanoia";
-+char ripexename[256]="%%LOCALBASE%%/bin/cdparanoia";
- char ripcmdline[256]="-d %c %t:[.%b]-%t:[.%e] %f";
- int selected_ripper=0;
- char outputdir[256];
-@@ -346,7 +346,7 @@
- gboolean disable_extra_paranoia=FALSE;
- gboolean disable_scratch_detect=FALSE;
- gboolean disable_scratch_repair=FALSE;
--char mp3exename[256]="/usr/bin/bladeenc";
-+char mp3exename[256]="%%LOCALBASE%%/bin/bladeenc";
- char mp3cmdline[256]="-%b -QUIT %f";
- int selected_encoder=1;
- char mp3fileformat[256]="~/mp3/%a/%d/%n.mp3";
diff --git a/audio/grip/files/patch-cddb.c b/audio/grip/files/patch-cddb.c
new file mode 100644
index 000000000000..14f8fa672850
--- /dev/null
+++ b/audio/grip/files/patch-cddb.c
@@ -0,0 +1,160 @@
+--- cddb.c.orig Mon Jul 16 12:15:32 2001
++++ cddb.c Mon Jan 21 22:51:21 2002
+@@ -27,6 +27,9 @@
+ #include <strings.h>
+ #endif
+ #include <ctype.h>
++#include <fcntl.h>
++#include <pthread.h>
++#include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+@@ -43,7 +46,7 @@
+ extern char *Version;
+
+ static int CDDBSum(int val);
+-static int CDDBConnect(CDDBServer *server);
++static int CDDBConnect(CDDBServer *server, int ns);
+ static void CDDBDisconnect(int sock);
+ static void CDDBSkipHTTP(int sock);
+ static int CDDBReadLine(int sock,char *inbuffer,int len);
+@@ -59,6 +62,81 @@
+ "data","folk","jazz","misc","newage",
+ "reggae","rock","soundtrack"};
+
++/* nonblocking connect */
++
++static int
++nonbconnect(int fd, struct sockaddr *pa, socklen_t cba, int ns)
++{
++ int n;
++ int s;
++ int fl;
++ fd_set rfds, wfds;
++ struct timeval tv;
++
++ if (!ns) {
++ n = connect(fd, pa, cba);
++ pthread_testcancel();
++ return n;
++ }
++
++ fl = fcntl(fd, F_GETFL, 0);
++ fcntl(fd, F_SETFL, fl | O_NONBLOCK);
++
++ if ((n = connect(fd, pa, cba)) < 0) {
++ if (errno != EINPROGRESS) {
++ return -1;
++ }
++ } else if (n == 0) {
++ fcntl(fd, F_SETFL, fl);
++ return 0;
++ }
++
++
++ for (s = 0; s < ns; s++) {
++ tv.tv_sec = 1;
++ tv.tv_usec = 0;
++ FD_ZERO(&rfds);
++ FD_SET(fd, &rfds);
++ wfds = rfds;
++ if ((n = select(fd + 1, &rfds, &wfds, 0, &tv)) > 0) {
++ break;
++ } else if (n < 0) {
++ if (errno == EINTR) {
++ s--;
++ } else {
++ return -1;
++ }
++ }
++ pthread_testcancel();
++ }
++
++ if (n == 0 && s == ns) {
++ errno = ETIMEDOUT;
++ return -1;
++ }
++
++ if (FD_ISSET(fd, &rfds) || FD_ISSET(fd, &wfds)) {
++ int err;
++ int cberr = sizeof(err);
++
++ getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &cberr);
++ if (err) {
++ errno = err;
++ return -1;
++ }
++ fcntl(fd, F_SETFL, fl);
++ tv.tv_sec = ns;
++ tv.tv_usec = 0;
++ setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
++ return 0;
++ }
++
++ /* ohshit */
++
++ errno = EIO; /* WTF? */
++ return -1;
++}
++
+ /* CDDB sum function */
+
+ static int CDDBSum(int val)
+@@ -115,7 +193,7 @@
+ }
+
+ /* Connect to a CDDB server */
+-static int CDDBConnect(CDDBServer *server)
++static int CDDBConnect(CDDBServer *server, int ns)
+ {
+ int sock;
+ struct sockaddr_in sin;
+@@ -146,8 +224,10 @@
+
+ if((sock=socket(AF_INET,SOCK_STREAM,0))<0) return -1;
+
+- if(connect(sock,(struct sockaddr *)&sin,sizeof(sin))<0) return -1;
+-
++ if(nonbconnect(sock,(struct sockaddr *)&sin,sizeof(sin),ns)<0) {
++ close(sock);
++ sock = -1;
++ }
+ return sock;
+ }
+
+@@ -243,7 +323,7 @@
+ /* Query the CDDB for the CD currently in the CD-ROM */
+
+ gboolean CDDBDoQuery(int cd_desc,CDDBServer *server,
+- CDDBHello *hello,CDDBQuery *query)
++ CDDBHello *hello,CDDBQuery *query, int ns)
+ {
+ int socket;
+ int index;
+@@ -251,7 +331,7 @@
+ char *offset_buffer,*query_buffer,*http_buffer,inbuffer[256];
+ int tot_len,len;
+
+- socket=CDDBConnect(server);
++ socket=CDDBConnect(server,ns);
+
+ if(socket==-1) return FALSE;
+
+@@ -476,14 +556,14 @@
+
+ gboolean CDDBRead(int cd_desc,CDDBServer *server,
+ CDDBHello *hello,CDDBEntry *entry,
+- DiscData *data)
++ DiscData *data, int ns)
+ {
+ int socket;
+ int index;
+ char outbuffer[256], inbuffer[512],cmdbuffer[256];
+ struct disc_info disc;
+
+- socket=CDDBConnect(server);
++ socket=CDDBConnect(server,ns);
+ if(socket==-1) return FALSE;
+
+ CDStat(cd_desc,&disc,TRUE);
diff --git a/audio/grip/files/patch-grip.c b/audio/grip/files/patch-grip.c
new file mode 100644
index 000000000000..7f931df1da6b
--- /dev/null
+++ b/audio/grip/files/patch-grip.c
@@ -0,0 +1,99 @@
+--- grip.c.orig Mon Jul 16 12:15:32 2001
++++ grip.c Mon Jan 21 23:03:30 2002
+@@ -54,6 +54,8 @@
+ #include "parsecfg.h"
+ #include "dialog/dialog.h"
+
++#define CDDB_USE_CANCEL 1
++
+ #ifdef CDPAR
+ #define size16 short
+ #define size32 int
+@@ -212,6 +214,8 @@
+
+ GdkCursor *wait_cursor;
+
++int cddb_tmo = 30;
++
+ int cd_desc;
+ int changer_slots;
+ int current_disc=0;
+@@ -315,7 +319,7 @@
+ gboolean use_proxy=FALSE;
+ gboolean use_proxy_env=FALSE;
+
+-char *bin_search_paths[]={"/cpd/misc/bin","/usr/bin","/usr/local/bin",NULL};
++char *bin_search_paths[]={"/cpd/misc/bin","/usr/bin","%%LOCALBASE%%/bin",NULL};
+ Ripper ripper_defaults[]={
+ #ifdef CDPAR
+ {"grip (cdparanoia)",""},
+@@ -328,7 +332,7 @@
+ #endif
+ {"other",""},
+ {"",""}};
+-char ripexename[256]="/usr/bin/cdparanoia";
++char ripexename[256]="%%LOCALBASE%%/bin/cdparanoia";
+ char ripcmdline[256]="-d %c %t:[.%b]-%t:[.%e] %f";
+ int selected_ripper=0;
+ char outputdir[256];
+@@ -347,7 +351,7 @@
+ gboolean disable_extra_paranoia=FALSE;
+ gboolean disable_scratch_detect=FALSE;
+ gboolean disable_scratch_repair=FALSE;
+-char mp3exename[256]="/usr/bin/bladeenc";
++char mp3exename[256]="%%LOCALBASE%%/bin/bladeenc";
+ char mp3cmdline[256]="-%b -QUIT %f";
+ int selected_encoder=1;
+ char mp3fileformat[256]="~/mp3/%a/%d/%n.mp3";
+@@ -450,7 +454,7 @@
+ "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial",
+ "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy",
+ "Cult", "Gangsta", "Top 40", "Christian Rap", "Pop/Funk", "Jungle",
+- "Native American", "Cabaret", "New Wave", "Psychadelic", "Rave", "Showtunes",
++ "Native American", "Cabaret", "New Wave", "Psychedelic", "Rave", "Showtunes",
+ "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro",
+ "Musical", "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk",
+ "Swing", "Fast Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass",
+@@ -1657,8 +1661,12 @@
+ pthread_exit(&status);
+ #elif defined(__FreeBSD__)
+ pthread_kill(cddb_thread, 0);
++#elif defined(linux)
++#if CDDB_USE_CANCEL
++ pthread_cancel(cddb_thread);
+ #else
+- pthread_kill_other_threads_np();
++ pthread_kill_other_threads_np();
++#endif
+ #endif
+ Debug("Aborted\n");
+ looking_up=FALSE;
+@@ -1722,6 +1730,7 @@
+ int cddb_found = 0;
+
+ if(!CDDBLookupDisc(&dbserver)) {
++ pthread_testcancel();
+ if(*(dbserver2.name)) {
+ if(CDDBLookupDisc(&dbserver2)) {
+ cddb_found = 1;
+@@ -1759,9 +1768,10 @@
+ strncpy(hello.hello_program,PROGRAM,256);
+ strncpy(hello.hello_version,VERSION,256);
+
+- if(!CDDBDoQuery(cd_desc,server,&hello,&query)) {
++ if(!CDDBDoQuery(cd_desc,server,&hello,&query,cddb_tmo)) {
+ update_required=TRUE;
+ } else {
++ pthread_testcancel();
+ switch(query.query_match) {
+ case MATCH_INEXACT:
+ case MATCH_EXACT:
+@@ -1770,7 +1780,7 @@
+ query.query_list[0].list_title);
+ entry.entry_genre = query.query_list[0].list_genre;
+ entry.entry_id = query.query_list[0].list_id;
+- CDDBRead(cd_desc,server,&hello,&entry,&ddata);
++ CDDBRead(cd_desc,server,&hello,&entry,&ddata,cddb_tmo);
+
+ Debug("Done\n");
+ success=TRUE;
diff --git a/audio/grip/files/patch-grip.h b/audio/grip/files/patch-grip.h
new file mode 100644
index 000000000000..9a7b02bee3e7
--- /dev/null
+++ b/audio/grip/files/patch-grip.h
@@ -0,0 +1,18 @@
+--- grip.h.orig Mon Jul 16 12:15:32 2001
++++ grip.h Mon Jan 21 22:51:22 2002
+@@ -239,13 +239,10 @@
+ char *CDDBGenre(int genre);
+ int CDDBGenreValue(char *genre);
+ gboolean CDDBDoQuery(int cd_desc,CDDBServer *server,
+- CDDBHello *hello,CDDBQuery *query);
++ CDDBHello *hello,CDDBQuery *query, int ns);
+ gboolean CDDBRead(int cd_desc,CDDBServer *server,
+ CDDBHello *hello,CDDBEntry *entry,
+- DiscData *data);
+-gboolean CDDBRead(int cd_desc,CDDBServer *server,
+- CDDBHello *hello,CDDBEntry *entry,
+- DiscData *data);
++ DiscData *data, int ns);
+ gboolean CDDBStatDiscData(int cd_desc);
+ int CDDBReadDiscData(int cd_desc, DiscData *outdata);
+ int CDDBWriteDiscData(int cd_desc,DiscData *ddata,FILE *outfile,