Re: audio/sox: getting rid of wget
Any further comments, besides REVISION=0 ? Jan On 2012/03/24 07:09, Jan Stary wrote: SoX uses wget(1) to play(1) remote files such as streaming radios. That is in fact a bug in the port (RUN_DEPENDS). Rather than adding wget to DEPENDS, the small patch below replaces that functionality with the base ftp(1). Index: Makefile === RCS file: /cvs/ports/audio/sox/Makefile,v retrieving revision 1.50 diff -u -p -u -p -r1.50 Makefile --- Makefile 23 Mar 2012 13:16:41 - 1.50 +++ Makefile 25 Mar 2012 16:27:03 - @@ -8,6 +8,7 @@ SHARED_LIBS +=sox 3.0 # .2.0 CATEGORIES= audio HOMEPAGE=http://sox.sourceforge.net/ MAINTAINER= Jan Stary h...@stare.cz +REVISION=1 # GPLv2+ PERMIT_PACKAGE_CDROM=Yes Index: patches/patch-src_formats_c === RCS file: patches/patch-src_formats_c diff -N patches/patch-src_formats_c --- /dev/null 1 Jan 1970 00:00:00 - +++ patches/patch-src_formats_c 25 Mar 2012 16:27:03 - @@ -0,0 +1,21 @@ +$OpenBSD$ +--- src/formats.c.orig Sat Mar 24 06:29:07 2012 src/formats.cSat Mar 24 06:29:53 2012 +@@ -348,7 +348,7 @@ static int sox_checkformat(sox_format_t * ft) + return SOX_SUCCESS; + } + +-static sox_bool is_url(char const * text) /* detects only wget-supported URLs */ ++static sox_bool is_url(char const * text) + { + return !( + strncasecmp(text, http: , (size_t)5) +@@ -385,7 +385,7 @@ static FILE * xfopen(char const * identifier, char con + else if (is_url(identifier)) { + FILE * f = NULL; + #ifdef HAVE_POPEN +-char const * const command_format = wget --no-check-certificate -q -O- \%s\; ++char const * const command_format = ftp -a -V -o - \%s\; + char * command = lsx_malloc(strlen(command_format) + strlen(identifier)); + sprintf(command, command_format, identifier); + f = popen(command, POPEN_MODE);
Re: audio/sox: getting rid of wget
On Fri, Mar 30, 2012 at 10:08 PM, Jan Stary h...@stare.cz wrote: Any further comments, besides REVISION=0 ? Sure... That this diff was already committed :) :)
Re: audio/sox: getting rid of wget
On Mar 24 13:50:46, Stuart Henderson wrote: please 'cvs add' the patch and send a 'cvs diff -uNp' with everything including the REVISION bump. I was wondering how to do this properly, and didn't figure out I could I could 'cvs add' against anoncvs. (Which means I must have missed in the documentation - can you point me please?) Better diff below. Thanks Jan On 2012/03/24 07:09, Jan Stary wrote: SoX uses wget(1) to play(1) remote files such as streaming radios. That is in fact a bug in the port (RUN_DEPENDS). Rather than adding wget to DEPENDS, the small patch below replaces that functionality with the base ftp(1). Index: Makefile === RCS file: /cvs/ports/audio/sox/Makefile,v retrieving revision 1.50 diff -u -p -u -p -r1.50 Makefile --- Makefile23 Mar 2012 13:16:41 - 1.50 +++ Makefile25 Mar 2012 16:27:03 - @@ -8,6 +8,7 @@ SHARED_LIBS += sox 3.0 # .2.0 CATEGORIES=audio HOMEPAGE= http://sox.sourceforge.net/ MAINTAINER=Jan Stary h...@stare.cz +REVISION= 1 # GPLv2+ PERMIT_PACKAGE_CDROM= Yes Index: patches/patch-src_formats_c === RCS file: patches/patch-src_formats_c diff -N patches/patch-src_formats_c --- /dev/null 1 Jan 1970 00:00:00 - +++ patches/patch-src_formats_c 25 Mar 2012 16:27:03 - @@ -0,0 +1,21 @@ +$OpenBSD$ +--- src/formats.c.orig Sat Mar 24 06:29:07 2012 src/formats.c Sat Mar 24 06:29:53 2012 +@@ -348,7 +348,7 @@ static int sox_checkformat(sox_format_t * ft) + return SOX_SUCCESS; + } + +-static sox_bool is_url(char const * text) /* detects only wget-supported URLs */ ++static sox_bool is_url(char const * text) + { + return !( + strncasecmp(text, http: , (size_t)5) +@@ -385,7 +385,7 @@ static FILE * xfopen(char const * identifier, char con + else if (is_url(identifier)) { + FILE * f = NULL; + #ifdef HAVE_POPEN +-char const * const command_format = wget --no-check-certificate -q -O- \%s\; ++char const * const command_format = ftp -a -V -o - \%s\; + char * command = lsx_malloc(strlen(command_format) + strlen(identifier)); + sprintf(command, command_format, identifier); + f = popen(command, POPEN_MODE);
audio/sox: getting rid of wget
SoX uses wget(1) to play(1) remote files such as streaming radios. That is in fact a bug in the port (RUN_DEPENDS). Rather than adding wget to DEPENDS, the small patch below replaces that functionality with the base ftp(1). REVISION needs to be bumped I guess. Jan $OpenBSD$ --- src/formats.c.orig Sat Mar 24 06:29:07 2012 +++ src/formats.c Sat Mar 24 06:29:53 2012 @@ -348,7 +348,7 @@ static int sox_checkformat(sox_format_t * ft) return SOX_SUCCESS; } -static sox_bool is_url(char const * text) /* detects only wget-supported URLs */ +static sox_bool is_url(char const * text) { return !( strncasecmp(text, http: , (size_t)5) @@ -385,7 +385,7 @@ static FILE * xfopen(char const * identifier, char con else if (is_url(identifier)) { FILE * f = NULL; #ifdef HAVE_POPEN -char const * const command_format = wget --no-check-certificate -q -O- \%s\; +char const * const command_format = ftp -a -V -o - \%s\; char * command = lsx_malloc(strlen(command_format) + strlen(identifier)); sprintf(command, command_format, identifier); f = popen(command, POPEN_MODE);
Re: audio/sox: getting rid of wget
On Fri, Mar 23, 2012 at 11:09 PM, Jan Stary h...@stare.cz wrote: SoX uses wget(1) to play(1) remote files such as streaming radios. That is in fact a bug in the port (RUN_DEPENDS). Rather than adding wget to DEPENDS, the small patch below replaces that functionality with the base ftp(1). REVISION needs to be bumped I guess. Jan $OpenBSD$ --- src/formats.c.orig Sat Mar 24 06:29:07 2012 +++ src/formats.c Sat Mar 24 06:29:53 2012 @@ -348,7 +348,7 @@ static int sox_checkformat(sox_format_t * ft) return SOX_SUCCESS; } -static sox_bool is_url(char const * text) /* detects only wget-supported URLs */ +static sox_bool is_url(char const * text) { return !( strncasecmp(text, http: , (size_t)5) @@ -385,7 +385,7 @@ static FILE * xfopen(char const * identifier, char con else if (is_url(identifier)) { FILE * f = NULL; #ifdef HAVE_POPEN - char const * const command_format = wget --no-check-certificate -q -O- \%s\; + char const * const command_format = ftp -a -V -o - \%s\; char * command = lsx_malloc(strlen(command_format) + strlen(identifier)); Whoa ... does lsx_malloc() add an extra byte for the null terminator or are we looking at a buffer overrun here? sprintf(command, command_format, identifier); f = popen(command, POPEN_MODE); --patrick
Re: audio/sox: getting rid of wget
On Mar 23 23:19:02, patrick keshishian wrote: On Fri, Mar 23, 2012 at 11:09 PM, Jan Stary h...@stare.cz wrote: SoX uses wget(1) to play(1) remote files such as streaming radios. That is in fact a bug in the port (RUN_DEPENDS). Rather than adding wget to DEPENDS, the small patch below replaces that functionality with the base ftp(1). REVISION needs to be bumped I guess. Jan $OpenBSD$ --- src/formats.c.orig Sat Mar 24 06:29:07 2012 +++ src/formats.c Sat Mar 24 06:29:53 2012 @@ -348,7 +348,7 @@ static int sox_checkformat(sox_format_t * ft) return SOX_SUCCESS; } -static sox_bool is_url(char const * text) /* detects only wget-supported URLs */ +static sox_bool is_url(char const * text) { return !( strncasecmp(text, http: , (size_t)5) @@ -385,7 +385,7 @@ static FILE * xfopen(char const * identifier, char con else if (is_url(identifier)) { FILE * f = NULL; #ifdef HAVE_POPEN - char const * const command_format = wget --no-check-certificate -q -O- \%s\; + char const * const command_format = ftp -a -V -o - \%s\; char * command = lsx_malloc(strlen(command_format) + strlen(identifier)); Whoa ... does lsx_malloc() add an extra byte for the null terminator or are we looking at a buffer overrun here? The two bytes of %s will be replaced, so I think 'command' has enough bytes. sprintf(command, command_format, identifier); f = popen(command, POPEN_MODE); --patrick
Re: audio/sox: getting rid of wget
On Fri, Mar 23, 2012 at 11:45 PM, Jan Stary h...@stare.cz wrote: On Mar 23 23:19:02, patrick keshishian wrote: On Fri, Mar 23, 2012 at 11:09 PM, Jan Stary h...@stare.cz wrote: SoX uses wget(1) to play(1) remote files such as streaming radios. That is in fact a bug in the port (RUN_DEPENDS). Rather than adding wget to DEPENDS, the small patch below replaces that functionality with the base ftp(1). REVISION needs to be bumped I guess. Jan $OpenBSD$ --- src/formats.c.orig Sat Mar 24 06:29:07 2012 +++ src/formats.c Sat Mar 24 06:29:53 2012 @@ -348,7 +348,7 @@ static int sox_checkformat(sox_format_t * ft) return SOX_SUCCESS; } -static sox_bool is_url(char const * text) /* detects only wget-supported URLs */ +static sox_bool is_url(char const * text) { return !( strncasecmp(text, http: , (size_t)5) @@ -385,7 +385,7 @@ static FILE * xfopen(char const * identifier, char con else if (is_url(identifier)) { FILE * f = NULL; #ifdef HAVE_POPEN - char const * const command_format = wget --no-check-certificate -q -O- \%s\; + char const * const command_format = ftp -a -V -o - \%s\; char * command = lsx_malloc(strlen(command_format) + strlen(identifier)); Whoa ... does lsx_malloc() add an extra byte for the null terminator or are we looking at a buffer overrun here? The two bytes of %s will be replaced, so I think 'command' has enough bytes. you are right. sprintf(command, command_format, identifier); f = popen(command, POPEN_MODE);
Re: audio/sox: getting rid of wget
please 'cvs add' the patch and send a 'cvs diff -uNp' with everything including the REVISION bump. On 2012/03/24 07:09, Jan Stary wrote: SoX uses wget(1) to play(1) remote files such as streaming radios. That is in fact a bug in the port (RUN_DEPENDS). Rather than adding wget to DEPENDS, the small patch below replaces that functionality with the base ftp(1). REVISION needs to be bumped I guess. Jan $OpenBSD$ --- src/formats.c.origSat Mar 24 06:29:07 2012 +++ src/formats.c Sat Mar 24 06:29:53 2012 @@ -348,7 +348,7 @@ static int sox_checkformat(sox_format_t * ft) return SOX_SUCCESS; } -static sox_bool is_url(char const * text) /* detects only wget-supported URLs */ +static sox_bool is_url(char const * text) { return !( strncasecmp(text, http: , (size_t)5) @@ -385,7 +385,7 @@ static FILE * xfopen(char const * identifier, char con else if (is_url(identifier)) { FILE * f = NULL; #ifdef HAVE_POPEN -char const * const command_format = wget --no-check-certificate -q -O- \%s\; +char const * const command_format = ftp -a -V -o - \%s\; char * command = lsx_malloc(strlen(command_format) + strlen(identifier)); sprintf(command, command_format, identifier); f = popen(command, POPEN_MODE);