Bug#245606: FTBFS: Duplicate case values

Matt Kraai Matt Kraai <kraai@ftbfs.org>, 245606@bugs.debian.org
Fri, 23 Apr 2004 09:14:44 -0700


--4bRzO86E/ozDv8r1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: libwww-curl-perl
Version: 2.0-6
Severity: serious
Tags: patch

This package fails to build from source:

 ...
 cc -c  -I/usr/include -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -g -O2   -DVERSION=\"2.0\" -DXS_VERSION=\"2.0\" -fPIC "-I/usr/lib/perl/5.8/CORE"  -DHAVE_INTERNAL_VARS Curl.c
 Curl.xs: In function `callback_index':
 Curl.xs:105: error: duplicate case value
 Curl.xs:104: error: previously used here
 Curl.xs: In function `perl_curl_form_delete':
 Curl.xs:199: warning: passing arg 1 of `curl_formfree' from incompatible pointer type
 Curl.xs: In function `fwrite_wrapper':
 Curl.xs:218: warning: unused variable `sv'
 Curl.c: In function `XS_WWW__Curl__easy_init':
 Curl.c:533: warning: unused variable `ix'
 Curl.c: In function `XS_WWW__Curl__easy_version':
 Curl.c:646: warning: unused variable `items'
 Curl.xs: In function `XS_WWW__Curl__easy_setopt':
 Curl.xs:629: error: duplicate case value
 Curl.xs:620: error: previously used here
 Curl.c: In function `XS_WWW__Curl__easy_internal_setopt':
 Curl.c:783: warning: unused variable `option'
 Curl.c:784: warning: unused variable `value'
 Curl.c: In function `XS_WWW__Curl__form_add':
 Curl.c:1070: warning: unused variable `name'
 Curl.c:1071: warning: unused variable `value'
 Curl.c: In function `XS_WWW__Curl__form_addfile':
 Curl.c:1101: warning: unused variable `filename'
 Curl.c:1102: warning: unused variable `description'
 Curl.c:1103: warning: unused variable `type'
 make[1]: *** [Curl.o] Error 1
 make[1]: Leaving directory `/tmp/buildd/libwww-curl-perl-2.0'
 make: *** [build-stamp] Error 2
 pbuilder: Failed autobuilding of package
 ...

The duplicate values are CURLOPT_PASSWDDATA and
CURLOPT_PASSWDFUNCTION, which are both defined as 0 in recent
versions of curl because they are obsolete.  The attached patch
removes them.

-- 
Matt Kraai            kraai@ftbfs.org            http://ftbfs.org/

--4bRzO86E/ozDv8r1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

diff -ru libwww-curl-perl-2.0-old/Curl.xs libwww-curl-perl-2.0/Curl.xs
--- libwww-curl-perl-2.0-old/Curl.xs	2003-04-22 05:18:45.000000000 -0700
+++ libwww-curl-perl-2.0/Curl.xs	2004-04-23 08:33:45.000000000 -0700
@@ -100,11 +100,6 @@
 	case CURLOPT_PROGRESSDATA:
 	    return CALLBACK_PROGRESS;
 	    break;
-
-	case CURLOPT_PASSWDFUNCTION:
-	case CURLOPT_PASSWDDATA:
-	    return CALLBACK_PASSWD;
-	    break;
     }
     croak("Bad callback index requested\n");
     return CALLBACK_LAST;
@@ -386,52 +381,6 @@
 }
 
 
-/* Password callback for calling a perl callback */
-
-static int passwd_callback_func(void *clientp, char *prompt, char *buffer, int buflen)
-{
-    dSP;
-    char *data;
-    SV *sv;
-    STRLEN len;
-    int count;
-
-    perl_curl_easy *self;
-    self=(perl_curl_easy *)clientp;
-
-    ENTER;
-    SAVETMPS;
-    PUSHMARK(sp);
-    if (self->callback_ctx[CALLBACK_PASSWD]) {
-        XPUSHs(sv_2mortal(newSVsv(self->callback_ctx[CALLBACK_PASSWD])));
-    } else {
-	XPUSHs(&PL_sv_undef);
-    }
-    XPUSHs(sv_2mortal(newSVpv(prompt, 0)));
-    XPUSHs(sv_2mortal(newSViv(buflen)));
-    PUTBACK;
-    count = perl_call_sv(self->callback[CALLBACK_PASSWD], G_ARRAY);
-    SPAGAIN;
-    if (count != 2)
-	croak("callback for CURLOPT_PASSWDFUNCTION didn't return status + data\n");
-
-    sv = POPs;
-    count = POPi;
-
-    data = SvPV(sv,len);
- 
-    /* only allowed to return the number of bytes asked for */
-    len = (len<(buflen-1) ? len : (buflen-1));
-    memcpy(buffer,data,len);
-    buffer[buflen]=0; /* ensure C string terminates */
-
-    PUTBACK;
-    FREETMPS;
-    LEAVE;
-    return count;
-}
-
-
 #if 0
 /* awaiting closepolicy prototype */
 int 
@@ -536,14 +485,12 @@
 	curl_easy_setopt(self->curl, CURLOPT_READFUNCTION, read_callback_func);
 	curl_easy_setopt(self->curl, CURLOPT_HEADERFUNCTION, header_callback_func);
 	curl_easy_setopt(self->curl, CURLOPT_PROGRESSFUNCTION, progress_callback_func);
-	curl_easy_setopt(self->curl, CURLOPT_PASSWDFUNCTION, passwd_callback_func);
 
 	/* set our own object as the context for all curl callbacks */
 	curl_easy_setopt(self->curl, CURLOPT_FILE, self); 
 	curl_easy_setopt(self->curl, CURLOPT_INFILE, self); 
 	curl_easy_setopt(self->curl, CURLOPT_WRITEHEADER, self); 
 	curl_easy_setopt(self->curl, CURLOPT_PROGRESSDATA, self); 
-	curl_easy_setopt(self->curl, CURLOPT_PASSWDDATA, self); 
 
 	/* we always collect this, in case it's wanted */
 	curl_easy_setopt(self->curl, CURLOPT_ERRORBUFFER, self->errbuf);
@@ -572,7 +519,6 @@
 	curl_easy_setopt(clone->curl, CURLOPT_READFUNCTION, read_callback_func);
 	curl_easy_setopt(clone->curl, CURLOPT_HEADERFUNCTION, header_callback_func);
 	curl_easy_setopt(clone->curl, CURLOPT_PROGRESSFUNCTION, progress_callback_func);
-	curl_easy_setopt(clone->curl, CURLOPT_PASSWDFUNCTION, passwd_callback_func);
 	*/
 
 	/* set our own object as the context for all curl callbacks */
@@ -580,7 +526,6 @@
 	curl_easy_setopt(clone->curl, CURLOPT_INFILE, clone); 
 	curl_easy_setopt(clone->curl, CURLOPT_WRITEHEADER, clone); 
 	curl_easy_setopt(clone->curl, CURLOPT_PROGRESSDATA, clone); 
-	curl_easy_setopt(clone->curl, CURLOPT_PASSWDDATA, clone); 
 
 	/* we always collect this, in case it's wanted */
 	curl_easy_setopt(clone->curl, CURLOPT_ERRORBUFFER, clone->errbuf);
@@ -617,7 +562,6 @@
 	case CURLOPT_INFILE:
 	case CURLOPT_WRITEHEADER:
 	case CURLOPT_PROGRESSDATA:
-	case CURLOPT_PASSWDDATA:
 	    perl_curl_easy_register_callback(self,&(self->callback_ctx[callback_index(option)]),value);
 	    break;
 
@@ -626,7 +570,6 @@
 	case CURLOPT_READFUNCTION:
         case CURLOPT_HEADERFUNCTION:
 	case CURLOPT_PROGRESSFUNCTION:
-	case CURLOPT_PASSWDFUNCTION:
 	    perl_curl_easy_register_callback(self,&(self->callback[callback_index(option)]),value);
 	    break;
 

--4bRzO86E/ozDv8r1--