r22623 - in /trunk/libhttp-body-perl: Changes META.yml README debian/changelog debian/compat debian/control debian/rules lib/HTTP/Body.pm lib/HTTP/Body/MultiPart.pm lib/HTTP/Body/OctetStream.pm t/04multipart.t

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Tue Jul 1 10:12:45 UTC 2008


Author: eloy
Date: Tue Jul  1 10:12:45 2008
New Revision: 22623

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=22623
Log:
  * New upstream release
  * debian/control:
   + Standards-Version: updated to 3.8.0 without additional changes
   + Build-Depends: increased dependecy for debhelper to (>= 7)
  * debian/compat: updated to 7 without additional changes
  * debian/rules: use simple example from debhelper package


Modified:
    trunk/libhttp-body-perl/Changes
    trunk/libhttp-body-perl/META.yml
    trunk/libhttp-body-perl/README
    trunk/libhttp-body-perl/debian/changelog
    trunk/libhttp-body-perl/debian/compat
    trunk/libhttp-body-perl/debian/control
    trunk/libhttp-body-perl/debian/rules
    trunk/libhttp-body-perl/lib/HTTP/Body.pm
    trunk/libhttp-body-perl/lib/HTTP/Body/MultiPart.pm
    trunk/libhttp-body-perl/lib/HTTP/Body/OctetStream.pm
    trunk/libhttp-body-perl/t/04multipart.t

Modified: trunk/libhttp-body-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/Changes?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/Changes (original)
+++ trunk/libhttp-body-perl/Changes Tue Jul  1 10:12:45 2008
@@ -1,4 +1,8 @@
 This file documents the revision history for Perl extension HTTP::Body.
+
+1.04    2008-06-23 16:00:00
+        - Added tmpdir() accessor to specify an alternate directory for temp files.
+          (jgoulah)
 
 1.03    2008-04-07 08:20:00
         - Set body value for XForms data. (Daniel Ruoso)

Modified: trunk/libhttp-body-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/META.yml?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/META.yml (original)
+++ trunk/libhttp-body-perl/META.yml Tue Jul  1 10:12:45 2008
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         HTTP-Body
-version:      1.03
+version:      1.04
 version_from: lib/HTTP/Body.pm
 installdirs:  site
 requires:

Modified: trunk/libhttp-body-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/README?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/README (original)
+++ trunk/libhttp-body-perl/README Tue Jul  1 10:12:45 2008
@@ -84,6 +84,10 @@
     upload
         Get/set file uploads.
 
+    tmpdir
+        Specify a different path for temporary files. Defaults to the system
+        temporary path.
+
 AUTHOR
     Christian Hansen, "ch at ngmedia.com"
 

Modified: trunk/libhttp-body-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/debian/changelog?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/debian/changelog (original)
+++ trunk/libhttp-body-perl/debian/changelog Tue Jul  1 10:12:45 2008
@@ -1,3 +1,14 @@
+libhttp-body-perl (1.04-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * debian/control:
+   + Standards-Version: updated to 3.8.0 without additional changes
+   + Build-Depends: increased dependecy for debhelper to (>= 7)
+  * debian/compat: updated to 7 without additional changes
+  * debian/rules: use simple example from debhelper package
+
+ -- Krzysztof Krzyżaniak (eloy) <eloy at debian.org>  Tue, 01 Jul 2008 12:05:47 +0200
+
 libhttp-body-perl (1.03-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libhttp-body-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/debian/compat?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/debian/compat (original)
+++ trunk/libhttp-body-perl/debian/compat Tue Jul  1 10:12:45 2008
@@ -1,1 +1,1 @@
-6
+7

Modified: trunk/libhttp-body-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/debian/control?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/debian/control (original)
+++ trunk/libhttp-body-perl/debian/control Tue Jul  1 10:12:45 2008
@@ -1,14 +1,14 @@
 Source: libhttp-body-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 6.0.10)
+Build-Depends: debhelper (>= 7)
 Build-Depends-Indep: perl (>= 5.8.0-7),  libyaml-perl, libpath-class-perl, 
  libtest-pod-perl, libtest-pod-coverage-perl, libwww-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Krzysztof Krzyżaniak (eloy) <eloy at debian.org>,
  gregor herrmann <gregor+debian at comodo.priv.at>,
  Rene Mayorga <rmayorga at debian.org.sv>
-Standards-Version: 3.7.3
+Standards-Version: 3.8.0
 Homepage: http://search.cpan.org/dist/HTTP-Body/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhttp-body-perl/
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/

Modified: trunk/libhttp-body-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/debian/rules?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/debian/rules (original)
+++ trunk/libhttp-body-perl/debian/rules Tue Jul  1 10:12:45 2008
@@ -1,64 +1,22 @@
 #!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# If set to a true value then MakeMaker's prompt function will
-# always return the default without waiting for user input.
-export PERL_MM_USE_DEFAULT=1
-
-PACKAGE=$(shell dh_listpackages)
-
-ifndef PERL
-PERL = /usr/bin/perl
-endif
-
-TMP     =$(CURDIR)/debian/$(PACKAGE)
 
 build: build-stamp
 build-stamp:
-	dh_testdir
-	$(PERL) Makefile.PL INSTALLDIRS=vendor
-	$(MAKE)
-	TEST_POD=1 $(MAKE) test
-	touch $@
+	dh build
+	touch build-stamp
 
 clean:
-	dh_testdir
-	dh_testroot
-	dh_clean build-stamp install-stamp
-	[ ! -f Makefile ] || $(MAKE) realclean
+	dh clean
 
-install: install-stamp
-install-stamp: build-stamp
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
-	touch $@
+install: build install-stamp
+install-stamp:
+	dh install
+	touch install-stamp
 
-binary-arch:
-# We have nothing to do by default.
+binary-arch: install
 
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-	dh_installdocs
-	dh_installchangelogs Changes
-	dh_perl
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
 
-source diff:                                                                  
-	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+binary-indep: install
+	dh binary-indep
 
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
+binary: binary-arch binary-indep

Modified: trunk/libhttp-body-perl/lib/HTTP/Body.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/lib/HTTP/Body.pm?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/lib/HTTP/Body.pm (original)
+++ trunk/libhttp-body-perl/lib/HTTP/Body.pm Tue Jul  1 10:12:45 2008
@@ -4,7 +4,7 @@
 
 use Carp       qw[ ];
 
-our $VERSION = '1.03';
+our $VERSION = '1.04';
 
 our $TYPES = {
     'application/octet-stream'          => 'HTTP::Body::OctetStream',
@@ -113,7 +113,8 @@
         length         => 0,
         param          => {},
         state          => 'buffering',
-        upload         => {}
+        upload         => {},
+        tmpdir         => File::Spec->tmpdir(),
     };
 
     bless( $self, $body );
@@ -355,6 +356,18 @@
     return $self->{upload};
 }
 
+=item tmpdir 
+
+Specify a different path for temporary files.  Defaults to the system temporary path.
+
+=cut
+
+sub tmpdir {
+    my $self = shift;
+    $self->{tmpdir} = shift if @_;
+    return $self->{tmpdir};
+}
+
 =back
 
 =head1 AUTHOR

Modified: trunk/libhttp-body-perl/lib/HTTP/Body/MultiPart.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/lib/HTTP/Body/MultiPart.pm?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/lib/HTTP/Body/MultiPart.pm (original)
+++ trunk/libhttp-body-perl/lib/HTTP/Body/MultiPart.pm Tue Jul  1 10:12:45 2008
@@ -270,7 +270,7 @@
             $part->{filename} = $filename;
 
             if ( $filename ne "" ) {
-                my $fh = File::Temp->new( UNLINK => 0 );
+                my $fh = File::Temp->new( UNLINK => 0, DIR => $self->tmpdir );
 
                 $part->{fh}       = $fh;
                 $part->{tempname} = $fh->filename;

Modified: trunk/libhttp-body-perl/lib/HTTP/Body/OctetStream.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/lib/HTTP/Body/OctetStream.pm?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/lib/HTTP/Body/OctetStream.pm (original)
+++ trunk/libhttp-body-perl/lib/HTTP/Body/OctetStream.pm Tue Jul  1 10:12:45 2008
@@ -30,7 +30,7 @@
     my $self = shift;
 
     unless ( $self->body ) {
-        $self->body( File::Temp->new );
+        $self->body( File::Temp->new( DIR => $self->tmpdir ) );
     }
 
     if ( my $length = length( $self->{buffer} ) ) {

Modified: trunk/libhttp-body-perl/t/04multipart.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-body-perl/t/04multipart.t?rev=22623&op=diff
==============================================================================
--- trunk/libhttp-body-perl/t/04multipart.t (original)
+++ trunk/libhttp-body-perl/t/04multipart.t Tue Jul  1 10:12:45 2008
@@ -3,13 +3,14 @@
 use strict;
 use warnings;
 
-use Test::More tests => 60;
+use Test::More tests => 98;
 
 use Cwd;
 use HTTP::Body;
 use File::Spec::Functions;
 use IO::File;
 use YAML;
+use File::Temp qw/ tempdir /;
 
 my $path = catdir( getcwd(), 't', 'data', 'multipart' );
 
@@ -20,6 +21,10 @@
     my $results = YAML::LoadFile( catfile( $path, "$test-results.yml" ) );
     my $content = IO::File->new( catfile( $path, "$test-content.dat" ) );
     my $body    = HTTP::Body->new( $headers->{'Content-Type'}, $headers->{'Content-Length'} );
+    my $tempdir = tempdir( 'XXXXXXX', CLEANUP => 1, DIR => File::Spec->tmpdir() );
+    $body->tmpdir($tempdir);
+
+    my $regex_tempdir = quotemeta($tempdir);
 
     binmode $content, ':raw';
 
@@ -35,6 +40,7 @@
         my $value = $body->upload->{$field};
 
         for ( ( ref($value) eq 'ARRAY' ) ? @{$value} : $value ) {
+            like($_->{tempname}, qr{$regex_tempdir}, "has tmpdir $tempdir");
             push @temps, delete $_->{tempname};
         }
     }




More information about the Pkg-perl-cvs-commits mailing list