From 3d48de9e673e0c4e7d8cacb03343a84ff2cd3e55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Thu, 19 May 2016 11:35:28 +0200
Subject: 1.4.1 bump

---
 .gitignore                                         |  1 +
 ...ke-DownloadStream-work-without-Class-XSAc.patch | 64 ++++++++++++++++++++++
 perl-MongoDB.spec                                  | 18 +++---
 sources                                            |  2 +-
 4 files changed, 76 insertions(+), 9 deletions(-)
 create mode 100644 
MongoDB-1.4.1-PERL-622-Make-DownloadStream-work-without-Class-XSAc.patch

diff --git a/.gitignore b/.gitignore
index 1d0501d..490d1ac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@
 /MongoDB-v1.2.2.tar.gz
 /MongoDB-v1.2.3.tar.gz
 /MongoDB-v1.4.0.tar.gz
+/MongoDB-v1.4.1.tar.gz
diff --git 
a/MongoDB-1.4.1-PERL-622-Make-DownloadStream-work-without-Class-XSAc.patch 
b/MongoDB-1.4.1-PERL-622-Make-DownloadStream-work-without-Class-XSAc.patch
new file mode 100644
index 0000000..f889442
--- /dev/null
+++ b/MongoDB-1.4.1-PERL-622-Make-DownloadStream-work-without-Class-XSAc.patch
@@ -0,0 +1,64 @@
+From ebb2328ea497f53b684f5e06e569b2f43b1fc07c Mon Sep 17 00:00:00 2001
+From: David Golden <x...@xdg.me>
+Date: Wed, 18 May 2016 11:52:02 -0400
+Subject: [PATCH] PERL-622 Make DownloadStream work without Class::XSAccessor
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Petr Pisar: Ported to 1.4.1
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ lib/MongoDB/GridFSBucket/DownloadStream.pm | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/lib/MongoDB/GridFSBucket/DownloadStream.pm 
b/lib/MongoDB/GridFSBucket/DownloadStream.pm
+index 265a80f..a4939c6 100644
+--- a/lib/MongoDB/GridFSBucket/DownloadStream.pm
++++ b/lib/MongoDB/GridFSBucket/DownloadStream.pm
+@@ -165,11 +165,11 @@ sub _get_next_chunk {
+ 
+ sub _ensure_buffer {
+     my ($self) = @_;
+-    if ( $self->_buffer ) { return length $self->_buffer }
++    if ( $self->{_buffer} ) { return length $self->{_buffer} }
+ 
+     $self->_get_next_chunk;
+ 
+-    return length $self->_buffer;
++    return length $self->{_buffer};
+ }
+ 
+ sub _readline_scalar {
+@@ -182,11 +182,11 @@ sub _readline_scalar {
+ 
+     return unless $self->_ensure_buffer;
+     my $newline_index;
+-    while ( ( $newline_index = index $self->_buffer, $/ ) < 0 ) {
++    while ( ( $newline_index = index $self->{_buffer}, $/ ) < 0 ) {
+         last unless $self->_get_next_chunk;
+     }
+-    my $substr_len = $newline_index < 0 ? length $self->_buffer : 
$newline_index + 1;
+-    return substr $self->_buffer, $self->_offset, $substr_len, '';
++    my $substr_len = $newline_index < 0 ? length $self->{_buffer} : 
$newline_index + 1;
++    return substr $self->{_buffer}, $self->_offset, $substr_len, '';
+ }
+ 
+ sub _read_all {
+@@ -344,9 +344,9 @@ sub read {
+ 
+     return 0 unless $self->_ensure_buffer;
+ 
+-    while ( length $self->_buffer < $len ) { last unless 
$self->_get_next_chunk }
+-    my $read_len = min( length $self->_buffer, $len );
+-    $$buffref .= substr $self->_buffer, $self->_offset, $read_len, '';
++    while ( length $self->{_buffer} < $len ) { last unless 
$self->_get_next_chunk }
++    my $read_len = min( length $self->{_buffer}, $len );
++    $$buffref .= substr $self->{_buffer}, $self->_offset, $read_len, '';
+     return $read_len;
+ }
+ 
+-- 
+2.5.5
+
diff --git a/perl-MongoDB.spec b/perl-MongoDB.spec
index 6e1adc8..b58d84c 100644
--- a/perl-MongoDB.spec
+++ b/perl-MongoDB.spec
@@ -1,6 +1,6 @@
 Name:           perl-MongoDB
-Version:        1.4.0
-Release:        3%{?dist}
+Version:        1.4.1
+Release:        1%{?dist}
 Summary:        A MongoDB Driver for Perl
 ## Installed:
 # lib/MongoDB/_Link.pm:             ASL 2.0 and (GPL+ or Artistic)
@@ -19,6 +19,9 @@ URL:            http://search.cpan.org/dist/MongoDB/
 Source0:        
http://www.cpan.org/authors/id/M/MO/MONGODB/MongoDB-v%{version}.tar.gz
 # Use system libbson if available <https://jira.mongodb.org/browse/PERL-521>
 Patch0:         MongoDB-v1.2.2-Use-system-libbson-library-if-possible.patch
+# Fix DownloadStream without Class::XSAccessor,
+# <https://jira.mongodb.org/browse/PERL-622>, in upstream after 1.4.1
+Patch1:         
MongoDB-1.4.1-PERL-622-Make-DownloadStream-work-without-Class-XSAc.patch
 # Build
 BuildRequires:  coreutils
 BuildRequires:  findutils
@@ -30,9 +33,6 @@ BuildRequires:  perl-generators
 BuildRequires:  perl(Config)
 BuildRequires:  perl(Config::AutoConf) >= 0.22
 BuildRequires:  perl(constant)
-# MongoDB::GridFSBucket::UploadStream will exhaust memory if Moo is instaled
-# without optional Class::XSAccessor <https://jira.mongodb.org/browse/PERL-621>
-BuildRequires:  perl(Class::XSAccessor)
 BuildRequires:  perl(Cwd)
 BuildRequires:  perl(File::Spec::Functions)
 BuildRequires:  perl(inc::Module::Install)
@@ -117,9 +117,6 @@ BuildRequires:  perl(Types::Serialiser)
 Requires:       perl(:MODULE_COMPAT_%(eval "$(perl -V:version)"; echo 
$version))
 Suggests:       perl(Authen::SASL)
 Requires:       perl(Authen::SCRAM::Client) >= 0.003
-# MongoDB::GridFSBucket::UploadStream will exhaust memory if Moo is instaled
-# without optional Class::XSAccessor <https://jira.mongodb.org/browse/PERL-621>
-Requires:       perl(Class::XSAccessor)
 # Prefer IO::Socket::IP over IO::Socket::INET
 Requires:       perl(IO::Socket::IP) >= 0.25
 Requires:       perl(IO::Socket::SSL) >= 1.42
@@ -143,6 +140,7 @@ The perl database access module for MongoDB.
 %setup -q -n MongoDB-v%{version}
 # Unbundle libbson
 %patch0 -p1
+%patch1 -p1
 rm -r bson
 sed -i -e '/^bson\//d' MANIFEST
 # Remove bundled modules
@@ -189,6 +187,10 @@ exit $test_rc
 %{_mandir}/man3/*
 
 %changelog
+* Thu May 19 2016 Petr Pisar <ppi...@redhat.com> - 1.4.1-1
+- 1.4.1 bump
+- Fix MongoDB::GridFSBucket::DownloadStream to work without Class::XSAccessor
+
 * Tue May 17 2016 Petr Pisar <ppi...@redhat.com> - 1.4.0-3
 - Enable grid tests and add an explicit dependency on Class::XSAccessor to 
avoid
   a Moo memory bug
diff --git a/sources b/sources
index 7ea8f47..9f24e15 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-a9ac8335cca8aa3e308e1fdf4435edf4  MongoDB-v1.4.0.tar.gz
+79280c1a9403dd39807c0feb503f37b2  MongoDB-v1.4.1.tar.gz
-- 
cgit v0.12


        
http://pkgs.fedoraproject.org/cgit/perl-MongoDB.git/commit/?h=master&id=3d48de9e673e0c4e7d8cacb03343a84ff2cd3e55
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org

Reply via email to