]> git.sven.stormbind.net Git - sven/tclcurl.git/commitdiff
Merge tag 'upstream/7.22.0+hg20160822'
authorSven Hoexter <sven@timegate.de>
Sun, 4 Sep 2016 14:47:20 +0000 (16:47 +0200)
committerSven Hoexter <sven@timegate.de>
Sun, 4 Sep 2016 14:47:20 +0000 (16:47 +0200)
Upstream version 7.22.0+hg20160822

15 files changed:
.gitignore [new file with mode: 0644]
debian/README.source [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/gbp.conf [new file with mode: 0644]
debian/patches/bts719441.patch [new file with mode: 0644]
debian/patches/bts801734.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]
debian/tclcurl.examples [new file with mode: 0644]
debian/tclcurl.files [new file with mode: 0644]
debian/tclcurl.manpages [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..845ca06
--- /dev/null
@@ -0,0 +1 @@
+.pc
diff --git a/debian/README.source b/debian/README.source
new file mode 100644 (file)
index 0000000..3d5f55c
--- /dev/null
@@ -0,0 +1,3 @@
+This package uses quilt to manage the patches in debian/patches.
+For further information please install the quilt package and read
+/usr/share/doc/quilt/README.source.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..4a8c914
--- /dev/null
@@ -0,0 +1,335 @@
+tclcurl (7.22.0+hg20151017-1) unstable; urgency=low
+
+  * Import a mercurial snapshot based on b5bc0662447d.
+    + Removed all patches, all applied upstream. Thanks Steve.
+  * Remove d/watch. The old download location is no longer available.
+  * Update d/copyright and add the link to Steve Havelkas bitbuck repository.
+  * Add d/patches/bts801734.patch - thanks to Christian Werner!
+    (Closes: #801734)
+  * Add d/patches/bts719441.patch - thanks to Christian Werner!
+    (Closes: #719441.patch)
+
+ -- Sven Hoexter <hoexter@debian.org>  Sat, 17 Oct 2015 23:26:15 +0200
+
+tclcurl (7.22.0-2) unstable; urgency=low
+
+  * Point the Homepage field to a mirror of the last website to cater
+    http://duck.debian.net/ and the DUCK challenge.
+  * Bump Standards-Version to 3.9.6.
+  * s/transfered/transferred/ in several manpages as suggest by lintian.
+
+ -- Sven Hoexter <hoexter@debian.org>  Tue, 21 Jul 2015 19:42:25 +0200
+
+tclcurl (7.22.0-1) unstable; urgency=low
+
+  * New upstream release
+    + Remove debian/patches/deprecated-curl-types - fixed upstream.
+    + Build-depend on libcurl4-gnutls-dev (>= 7.22.0).
+    + Refresh all patches.
+  * Remove overrides for dh_clean and dh_installexamples. All the
+    build artefacts which required special handling are no longer
+    included in the upstream tarball.
+  * Switch to dh compat level 9, build-depend on debhelper (>= 9).
+  * Switch LDFLAGS to DEB_LDFLAGS_MAINT_PREPEND.
+  * Change Standards-Version to 3.9.3 - no changes required.
+  * Update copyright year and download location in debian/copyright.
+  * Update homepage in debian/watch and debian/control.
+  * Continue to move the libs to /usr/lib/tcltk/ for now against
+    the will of the buildsystem. Original installation path is
+    now architecture dependend.
+
+ -- Sven Hoexter <hoexter@debian.org>  Sat, 02 Jun 2012 20:48:44 +0200
+
+tclcurl (7.19.6-3) unstable; urgency=low
+
+  * Add debian/patches/deprecated-curl-types to no longer include
+    curl/types.h and curl/easy.h. Both are deprecated and got removed
+    from recent curl releases. (Closes: #636558)
+
+ -- Sven Hoexter <hoexter@debian.org>  Thu, 04 Aug 2011 19:52:22 +0200
+
+tclcurl (7.19.6-2) unstable; urgency=low
+
+  * Bumb Standards-Version to 3.9.2 - no changes.
+  * Add ${misc:Depends} to the binary package.
+  * Update homepage url to a generic hostname.
+  * Update VCS-* to the new git repository.
+  * Convert to dh:
+    + Build-Depend on debhelper (>= 8).
+    + Increase compat level to 8.
+    + Shorten debian/rules to the bare essentials.
+    + Override dh_makeshlibs call to add tcltk-depends.
+    + Override dh_clean to not remove several left-overs included upstream.
+    + Override dh_installexamples to not install a.tcl~.
+    + Emtpy override for dh_auto_test, the referenced all.tcl doesn't exist;
+      Most of the tests require network access anyway, which isn't given
+      on the buildds.
+  * Add debian/source/format -> 1.0.
+  * Add a watch file.
+  * Add debian/patches/(man-hyphen-as-minus|man-spelling) to fix several
+    manpage issue flagged by lintian.
+
+ -- Sven Hoexter <hoexter@debian.org>  Thu, 28 Apr 2011 13:51:13 +0200
+
+tclcurl (7.19.6-1) unstable; urgency=low
+
+  * New upstream release.
+    + Build-Depend at least on libcurl4 (>= 7.19.6).
+    + Refresh patches/correct-linking.
+  * Bumb Standards-Version to 3.8.3 - no changes.
+  * Change maintainer e-mail to my @d.o address.
+
+ -- Sven Hoexter <hoexter@debian.org>  Wed, 11 Nov 2009 23:26:11 +0100
+
+tclcurl (7.19.0-1) unstable; urgency=low
+
+  * New upstream release.
+    + Refresh all patches.
+    + Build-Depend at least on libcurl4 (>= 7.19.0).
+  * Update mail address of the upstream maintainer in debian/copyright.
+  * Bump Standards-Version to 3.8.2.
+    + Add a debian/README.source file.
+  * Update debian/copyright with copyright information for Makefile.in
+    and tclconfig/tcl.m4. Thanks to Ondrej Certik for the pointer in
+    mysqltcl which has to applied here aswell.
+  * Add description header to all patches.
+  * Add patches/example-shebang. This patch adds a working shebang line
+    to those example files that carry one (Thanks to Sergei).
+  * Set the permissions for the example files to 644, except for those
+    with a working shebang line (Thanks to Sergei).
+
+ -- Sven Hoexter <sven@timegate.de>  Wed, 05 Aug 2009 21:30:47 +0200
+
+tclcurl (7.17.1-1) unstable; urgency=low
+
+  * New upstream release to support curl 7.17.1 features.
+  * Following lintian advice for debian-rules-ignores-make-clean-error.
+  * Moved the Homepage from the Description into the new Homepage field.
+  * Removed man-quoting patch; got applied upstream.
+  * Standards-Version: 3.7.3 - no changes required.
+  * Build depend on tcl-dev instead of tcl8.4-dev.
+  * Refreshed man-section and correct-linking patch.
+  * Added LDFLAGS += -Wl,-z,defs -Wl,--as-needed so that I can shorten
+    the correct-linking patch to kerberos related libs.
+  * Switched to use tcltk-depends to depend on the right Tcl version.
+  * Added Vcs-Svn field to debian/control.
+  * Reworked debian/rules to make it a bit clearer what happens.
+  * Adopt the new Tcl/Tk policy and move the lib into /usr/lib/tcltk.
+  * Added patch reformat-tclcurl3 to prevent confusion of man.
+  * Updated the copyright file and formated it to make lintian happy.
+
+ -- Sven Hoexter <sven@timegate.de>  Wed, 13 Feb 2008 21:21:39 +0100
+
+tclcurl (7.16.2-1) unstable; urgency=low
+
+  * New upstream release
+  * Changed version to the one used upstream to follow libcurl version
+  * Updated libcurl build-dep to the new libcurl version (closes: #423448)
+  * Added bc to build-dep
+  * Reorganisation of packaging; I'm now using quilt which should ease the
+    patch management a lot. I've only adopted those patches I really know
+    about why they're needed so it's completly possible that I've lost
+    something.
+
+ -- Sven Hoexter <sven@timegate.de>  Tue, 22 May 2007 17:39:30 +0200
+
+tclcurl (0.15.3-3) unstable; urgency=low
+
+  * Applied a patch to generic/tclcurl.c (provided by Andres Garcia)
+    to solve some pointer warnings from gcc 4.1 which may lead to
+    wrong code.
+    See also: http://people.debian.org/~tbm/logs/pointer/
+
+ -- Sven Hoexter <sven@timegate.de>  Sat, 21 Oct 2006 12:06:30 +0200
+
+tclcurl (0.15.3-2) unstable; urgency=low
+
+  * Change to compat level 5
+  * Change to Standards-Version 3.7.2 - nothing todo
+  * Corrected some quoting in tclcurl.n
+  * Added a crude hack to configure.in to strip some libs from the
+    linking process to lower the auto generated depends for this package
+
+ -- Sven Hoexter <sven@timegate.de>  Tue, 26 Sep 2006 11:33:44 +0200
+
+tclcurl (0.15.3-1) unstable; urgency=low
+
+  * New upstream release
+  * Upstream added .txt to the Changes and Changelog file
+  * TclCurl no longer supports Gopher
+
+ -- Sven Hoexter <sven@timegate.de>  Tue, 18 Apr 2006 08:55:57 +0200
+
+tclcurl (0.15.1-1) unstable; urgency=low
+
+  * New upstream release
+  * Change from DH_COMPAT 3 to DH_COMPAT 4 and moved it from rules
+    into the compat file.
+  * Incorporating Luk Claes NMU
+  * remerged the modifications to configure and Makefile.in partly by hand
+  * I'm going to adopt this package (closes: #228231)
+
+
+ -- Sven Hoexter <sven@timegate.de>  Wed, 29 Mar 2006 15:34:56 +0200
+
+tclcurl (0.14.1-1.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * Fix syntax error in tcl.m4 (Closes: #356871).
+
+ -- Luk Claes <luk@debian.org>  Mon, 27 Mar 2006 19:28:19 +0200
+
+tclcurl (0.14.1-1) unstable; urgency=low
+
+  * New upstream release.
+  * Switched to libcurl3-gnutls-dev build dependency.
+
+ -- Domenico Andreoli <cavok@debian.org>  Tue, 18 Oct 2005 14:35:11 +0200
+
+tclcurl (0.14.0-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Mon, 20 Jun 2005 12:42:47 +0200
+
+tclcurl (0.13.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * Updated build dependency on libcurl3-dev >= 7.13.2.
+
+ -- Domenico Andreoli <cavok@debian.org>  Fri, 22 Apr 2005 11:57:50 +0200
+
+tclcurl (0.12.2-3) unstable; urgency=low
+
+  * tclcurl package now suggests libcurl3-dev instead of libcurl2-dev.
+
+ -- Domenico Andreoli <cavok@debian.org>  Sat, 11 Dec 2004 22:18:26 +0100
+
+tclcurl (0.12.2-2) unstable; urgency=low
+
+  * Updated build dependency on libcurl3-dev >= 7.12.2.
+
+ -- Domenico Andreoli <cavok@debian.org>  Wed, 10 Nov 2004 00:34:22 +0100
+
+tclcurl (0.12.2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Sat,  6 Nov 2004 13:07:36 +0100
+
+tclcurl (0.12.0-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Sun, 18 Jul 2004 23:50:54 +0200
+
+tclcurl (0.11.0-1) unstable; urgency=low
+
+  * New upstream release (closes: #227799).
+  * I am again the maintainer but only until somebody adopts it.
+  * Updated build depends on newer versions of curl and Tcl 8.4.
+  * Updated standards version to 3.6.1.
+  * Enabled multi-threads support.
+
+ -- Domenico Andreoli <cavok@debian.org>  Sun, 15 Feb 2004 16:37:31 +0100
+
+tclcurl (0.10.5-2) unstable; urgency=low
+
+  * Updated standards version to new debian-policy version.
+  * Updated build depends to new debhelper version, and new libcurl2-dev
+    version.
+
+ -- Deedra Waters <dmwaters@linuxpowered.com>  Sun, 10 Aug 2003 15:27:36 -0400
+
+tclcurl (0.10.5-1) unstable; urgency=low
+
+  * New upstream release.
+  * Fixed a typo in the long description.
+
+ -- Deedra Waters <dmwaters@linuxpowered.com>  Tue, 10 Jun 2003 10:26:22 -0400
+
+tclcurl (0.10.4-2) unstable; urgency=low
+
+  * Adopted this package from it's maintainer (closes: #188361).
+  * Fixed some things in the rules file to make it clean up nicer.
+  * Updated the standards to the current version.
+
+ -- Deedra Waters <dmwaters@linuxpowered.com>  Sun,  4 May 2003 17:02:36 -0400
+
+tclcurl (0.10.4-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Sat,  5 Apr 2003 00:53:30 +0200
+
+tclcurl (0.10.3-1) unstable; urgency=low
+
+  * New upstream release.
+  * Updated build dependencies in order to use new libcurl2-dev package.
+  * It now suggests libcurl2-dev for documentation.
+  * Improved long description.
+
+ -- Domenico Andreoli <cavok@debian.org>  Thu,  6 Feb 2003 02:51:01 +0100
+
+tclcurl (0.10.1-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Tue, 15 Oct 2002 23:57:54 +0200
+
+tclcurl (0.9.8-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Fri, 28 Jun 2002 01:06:46 +0200
+
+tclcurl (0.9.6-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Mon,  6 May 2002 14:42:22 +0200
+
+tclcurl (0.9.5-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Wed,  3 Apr 2002 13:16:13 +0200
+
+tclcurl (0.9.3-2) unstable; urgency=low
+
+  * Removed a useless (for Debian systems) check in Makefile.in. BTW
+    this bypasses a segmentation fault during the build process on arm.
+
+ -- Domenico Andreoli <cavok@debian.org>  Mon, 18 Feb 2002 16:10:40 +0100
+
+tclcurl (0.9.3-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Tue, 29 Jan 2002 18:08:06 +0100
+
+tclcurl (0.9.2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Tue, 11 Dec 2001 19:22:21 +0100
+
+tclcurl (0.9-2) unstable; urgency=low
+
+  * Build-Depends now contains "libcurl-dev (>= 7.9.1-3) | libcurl-ssl-dev
+    (>= 7.9.1-3)" instead of only "libcurl-dev (>= 7.9-1) | libcurl-ssl-dev
+    (>= 7.9-1)" (closes: #120293).
+
+ -- Domenico Andreoli <cavok@debian.org>  Thu, 22 Nov 2001 15:47:03 +0100
+
+tclcurl (0.9-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Domenico Andreoli <cavok@debian.org>  Fri,  9 Nov 2001 16:27:42 +0100
+
+tclcurl (0.8-1) unstable; urgency=low
+
+  * Initial release (closes: #113467).
+
+ -- Domenico Andreoli <cavok@debian.org>  Wed, 26 Sep 2001 00:51:25 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..6da28a4
--- /dev/null
@@ -0,0 +1,20 @@
+Source: tclcurl
+Section: interpreters
+Priority: extra
+Maintainer: Sven Hoexter <hoexter@debian.org>
+Build-Depends: debhelper (>= 9), tcl-dev, libcurl4-gnutls-dev (>= 7.22.0),
+ quilt, bc
+Homepage: http://mirror.yellow5.com/tclcurl/
+Standards-Version: 3.9.6
+Vcs-Git: git://git.sven.stormbind.net/git/sven/tclcurl.git
+Vcs-Browser: http://git.sven.stormbind.net/?p=sven/tclcurl.git
+
+Package: tclcurl
+Architecture: any
+Suggests: libcurl4-gnutls-dev
+Depends: ${misc:Depends}, ${shlibs:Depends}, ${tclsh:Depends}
+Description: Tcl bindings to libcurl
+ This module enables the use of libcurl in Tcl scripts. Please refer to
+ the libcurl documentation available in the libcurl4-gnutls-dev package.
+ .
+ NOTE: the SSL support is provided by GnuTLS.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..808edcc
--- /dev/null
@@ -0,0 +1,66 @@
+This package was debianized by Domenico Andreoli <cavok@debian.org> on
+Wed, 26 Sep 2001 00:51:25 +0200.
+
+It is currently maintained by Sven Hoexter <sven@timegate.de>.
+
+It was downloaded from
+ http://personal.telefonica.terra.es/web/getleft/tclcurl/download.html
+Some patches were integrated in this repository:
+ https://bitbucket.org/smh377/tclcurl
+
+Current upstream author: Steve Havelka <smh377@yahoo.com>
+Original upstream author: Andres Garcia <fandom@telefonica.net>
+
+Copyright:
+
+Most files are under following copyright:
+       Copyright (c) 2001-2011 Andres Garcia
+
+
+The following files have a different copyright holder under the same license
+as the rest:
+
+Makefile.in
+tclconfig/tcl.m4
+       Copyright (c) 1999-2000 Scriptics Corporation.
+       Copyright (c) 2002-2005 ActiveState Corporation.
+
+
+       This software is copyrighted by Andres Garcia Garcia and other parties
+       parties.  The following terms apply to all files associated with the
+       software unless explicitly disclaimed in individual files.
+
+       The authors hereby grant permission to use, copy, modify, distribute,
+       and license this software and its documentation for any purpose, provided
+       that existing copyright notices are retained in all copies and that this
+       notice is included verbatim in any distributions. No written agreement,
+       license, or royalty fee is required for any of the authorized uses.
+       Modifications to this software may be copyrighted by their authors
+       and need not follow the licensing terms described here, provided that
+       the new terms are clearly indicated on the first page of each file where
+       they apply.
+
+       IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+       FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+       ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+       DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+       POSSIBILITY OF SUCH DAMAGE.
+
+       THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+       INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+       FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
+       IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+       NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+       MODIFICATIONS.
+
+       GOVERNMENT USE: If you are acquiring this software on behalf of the
+       U.S. government, the Government shall have only "Restricted Rights"
+       in the software and related documentation as defined in the Federal 
+       Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
+       are acquiring the software on behalf of the Department of Defense, the
+       software shall be classified as "Commercial Computer Software" and the
+       Government shall have only "Restricted Rights" as defined in Clause
+       252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the
+       authors grant the U.S. Government and others acting in its behalf
+       permission to use and distribute the software in accordance with the
+       terms specified in this license. 
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644 (file)
index 0000000..cec628c
--- /dev/null
@@ -0,0 +1,2 @@
+[DEFAULT]
+pristine-tar = True
diff --git a/debian/patches/bts719441.patch b/debian/patches/bts719441.patch
new file mode 100644 (file)
index 0000000..bb13b42
--- /dev/null
@@ -0,0 +1,108 @@
+Description: close the file handle in time, increase space allocated for handleName and shandleName
+Origin: https://www.androwish.org/index.html/vpatch?from=e4864fde820aac71&to=ce9a5b5886ac7381
+Author: Christian Werner <chw@ch-werner.de>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719441
+Forwarded: yes, email
+
+Index: tclcurl/generic/tclcurl.c
+===================================================================
+--- tclcurl.orig/generic/tclcurl.c
++++ tclcurl/generic/tclcurl.c
+@@ -87,7 +87,7 @@ curlCreateObjCmd (Tcl_Interp *interp,str
+     Tcl_Command         cmdToken;
+     /* We try with curl1, if it already exists with curl2...*/
+-    handleName=(char *)Tcl_Alloc(10);
++    handleName=(char *)Tcl_Alloc(32);
+     for (i=1;;i++) {
+         sprintf(handleName,"curl%d",i);
+         if (!Tcl_GetCommandInfo(interp,handleName,&info)) {
+@@ -483,6 +483,12 @@ curlSetOpts(Tcl_Interp *interp, struct c
+         case 2:
+             Tcl_Free(curlData->inFile);
+             curlData->inFile=curlstrdup(Tcl_GetString(objv));
++            if (curlData->inFlag) {
++                if (curlData->inHandle!=NULL) {
++                    fclose(curlData->inHandle);
++                    curlData->inHandle=NULL;
++                }
++            }
+             if ((strcmp(curlData->inFile,""))&&(strcmp(curlData->inFile,"stdin"))) {
+                 curlData->inFlag=1;
+             } else {
+@@ -914,6 +920,13 @@ curlSetOpts(Tcl_Interp *interp, struct c
+         case 44:
+             Tcl_Free(curlData->headerFile);
+             curlData->headerFile=curlstrdup(Tcl_GetString(objv));
++            if (curlData->headerFlag) {
++                if (curlData->headerHandle!=NULL) {
++                    fclose(curlData->headerHandle);
++                    curlData->headerHandle=NULL;
++                }
++                curl_easy_setopt(curlHandle,CURLOPT_HEADERDATA,NULL);
++            }
+             if ((strcmp(curlData->headerFile,""))&&(strcmp(curlData->headerFile,"stdout"))
+                     &&(strcmp(curlData->headerFile,"stderr"))) {
+                 curlData->headerFlag=1;
+@@ -1035,6 +1048,14 @@ curlSetOpts(Tcl_Interp *interp, struct c
+             }
+             break;
+         case 61:
++            if (curlData->headerFlag) {
++                if (curlData->headerHandle!=NULL) {
++                    fclose(curlData->headerHandle);
++                    curlData->headerHandle=NULL;
++                }
++                curl_easy_setopt(curlHandle,CURLOPT_HEADERDATA,NULL);
++                curlData->headerFlag=0;
++            }
+             if (curl_easy_setopt(curlHandle,CURLOPT_HEADERFUNCTION,
+                     curlHeaderReader)) {
+                 return TCL_ERROR;
+@@ -1114,6 +1135,13 @@ curlSetOpts(Tcl_Interp *interp, struct c
+             break;
+         case 66:
+             curlData->readProc=curlstrdup(Tcl_GetString(objv));
++            if (curlData->inFlag) {
++                if (curlData->inHandle!=NULL) {
++                    fclose(curlData->inHandle);
++                    curlData->inHandle=NULL;
++                }
++                curl_easy_setopt(curlHandle,CURLOPT_READDATA,NULL);
++            }
+             curlData->inFlag=0;
+             if (strcmp(curlData->readProc,"")) {
+                 if (curl_easy_setopt(curlHandle,CURLOPT_READFUNCTION,
+@@ -2439,12 +2467,14 @@ curlHeaderReader(void *ptr,size_t size,s
+         headerContent[charLength]=0;
+         /* There may be multiple 'Set-Cookie' headers, so we use a list */
+         if (Tcl_StringCaseMatch(headerName,"Set-Cookie",1)) {
+-            Tcl_SetVar2(curlData->interp,curlData->headerVar,headerName, \
++            Tcl_SetVar2(curlData->interp,curlData->headerVar,headerName,
+                     headerContent,TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
+         } else {
+             Tcl_SetVar2(curlData->interp,curlData->headerVar,headerName,
+                     headerContent,0);
+         }
++        Tcl_Free(headerContent);
++        Tcl_Free(headerName);
+     }
+     regExp=Tcl_RegExpCompile(curlData->interp,"(^(HTTP|http)[^\r]+)(\r*)(\n)");
+     match=Tcl_RegExpExec(curlData->interp,regExp,header,header);
+@@ -2457,6 +2487,7 @@ curlHeaderReader(void *ptr,size_t size,s
+         Tcl_SetVar2(curlData->interp,curlData->headerVar,"http",
+                 httpStatus,0);
++      Tcl_Free(httpStatus);
+     }
+     return size*nmemb;
+ }
+@@ -4159,7 +4190,7 @@ curlCreateShareObjCmd (Tcl_Interp *inter
+     Tcl_Command         cmdToken;
+     /* We try with scurl1, if it already exists with scurl2...*/
+-    shandleName=(char *)Tcl_Alloc(10);
++    shandleName=(char *)Tcl_Alloc(32);
+     for (i=1;;i++) {
+         sprintf(shandleName,"scurl%d",i);
+         if (!Tcl_GetCommandInfo(interp,shandleName,&info)) {
diff --git a/debian/patches/bts801734.patch b/debian/patches/bts801734.patch
new file mode 100644 (file)
index 0000000..321bd30
--- /dev/null
@@ -0,0 +1,52 @@
+Description: close the file handle in time in case -file option is used 
+Origin: https://www.androwish.org/index.html/vpatch?from=9afc8918cdeec6d7&to=e4864fde820aac71
+Author: Christian Werner <chw@ch-werner.de>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801734
+Forwarded: yes, email
+
+Index: b/generic/tclcurl.c
+===================================================================
+--- a/generic/tclcurl.c
++++ b/generic/tclcurl.c
+@@ -465,6 +465,12 @@ curlSetOpts(Tcl_Interp *interp, struct c
+         case 1:
+             Tcl_Free(curlData->outFile);
+             curlData->outFile=curlstrdup(Tcl_GetString(objv));
++            if (curlData->outFlag) {
++                if (curlData->outHandle!=NULL) {
++                    fclose(curlData->outHandle);
++                    curlData->outHandle=NULL;
++                }
++            }
+             if ((strcmp(curlData->outFile,""))&&(strcmp(curlData->outFile,"stdout"))) {
+                 curlData->outFlag=1;
+             } else {
+@@ -1043,6 +1049,14 @@ curlSetOpts(Tcl_Interp *interp, struct c
+         case 62:
+             Tcl_Free(curlData->bodyVarName);
+             curlData->bodyVarName=curlstrdup(Tcl_GetString(objv));
++            if (curlData->outFlag) {
++                if (curlData->outHandle!=NULL) {
++                    fclose(curlData->outHandle);
++                    curlData->outHandle=NULL;
++                }
++                curl_easy_setopt(curlHandle,CURLOPT_WRITEDATA,NULL);
++            }
++            curlData->outFlag=0;
+             if (curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION,
+                     curlBodyReader)) {
+                 return TCL_ERROR;
+@@ -1080,6 +1094,13 @@ curlSetOpts(Tcl_Interp *interp, struct c
+             break;
+         case 65:
+             curlData->writeProc=curlstrdup(Tcl_GetString(objv));
++            if (curlData->outFlag) {
++                if (curlData->outHandle!=NULL) {
++                    fclose(curlData->outHandle);
++                    curlData->outHandle=NULL;
++                }
++                curl_easy_setopt(curlHandle,CURLOPT_WRITEDATA,NULL);
++          }
+             curlData->outFlag=0;
+             if (curl_easy_setopt(curlHandle,CURLOPT_WRITEFUNCTION,
+                     curlWriteProcInvoke)) {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..5821c22
--- /dev/null
@@ -0,0 +1,2 @@
+bts801734.patch
+bts719441.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..f3638f8
--- /dev/null
@@ -0,0 +1,42 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+export DEB_LDFLAGS_MAINT_PREPEND := -Wl,-z,defs -Wl,--as-needed
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+%:
+       dh $@ --with quilt
+
+override_dh_auto_configure:
+       dh_auto_configure -- \
+               --prefix=/usr \
+               --mandir=/usr/share/man \
+               --infodir=/usr/share/info \
+               --enable-threads \
+               --with-tcl=/usr/lib \
+               --with-tclinclude=/usr/include/tcl \
+
+override_dh_auto_install:
+       dh_auto_install --destdir=$(CURDIR)/debian/tclcurl
+
+       mkdir $(CURDIR)/debian/tclcurl/usr/lib/tcltk
+       mv $(CURDIR)/debian/tclcurl/usr/lib/$(DEB_HOST_MULTIARCH)/TclCurl* \
+               $(CURDIR)/debian/tclcurl/usr/lib/tcltk
+       rm -rf \
+               $(CURDIR)/debian/tclcurl/usr/share/man/mann \
+               $(CURDIR)/debian/tclcurl/usr/bin \
+               $(CURDIR)/debian/tclcurl/usr/include \
+               $(CURDIR)/debian/tclcurl/usr/lib/$(DEB_HOST_MULTIARCH)
+
+       chmod 644 \
+               $(CURDIR)/tests/*.tcl \
+               $(CURDIR)/tests/multi/double.tcl \
+               $(CURDIR)/tests/multi/single.tcl
+
+override_dh_auto_test:
+
+override_dh_makeshlibs:
+       dh_makeshlibs
+       tcltk-depends
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..d3827e7
--- /dev/null
@@ -0,0 +1 @@
+1.0
diff --git a/debian/tclcurl.examples b/debian/tclcurl.examples
new file mode 100644 (file)
index 0000000..e7e1fb0
--- /dev/null
@@ -0,0 +1 @@
+tests/*
diff --git a/debian/tclcurl.files b/debian/tclcurl.files
new file mode 100644 (file)
index 0000000..2964de6
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/
diff --git a/debian/tclcurl.manpages b/debian/tclcurl.manpages
new file mode 100644 (file)
index 0000000..57b8354
--- /dev/null
@@ -0,0 +1 @@
+doc/*.n