[libcatmandu-perl] 23/30: Fixing add for indexes
Jonas Smedegaard
dr at jones.dk
Tue Dec 19 11:10:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/1.0700-1
in repository libcatmandu-perl.
commit 5fd2a7dcead414b9c7cc57414be8dd0b47640816
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date: Mon Nov 6 14:15:03 2017 +0100
Fixing add for indexes
---
lib/Catmandu/Store/File/Memory/Index.pm | 6 +++++-
lib/Catmandu/Store/File/Simple/Index.pm | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/Catmandu/Store/File/Memory/Index.pm b/lib/Catmandu/Store/File/Memory/Index.pm
index 6b2ba13..1a76d27 100644
--- a/lib/Catmandu/Store/File/Memory/Index.pm
+++ b/lib/Catmandu/Store/File/Memory/Index.pm
@@ -56,7 +56,11 @@ sub add {
$self->store->_files->{$name}->{$id} = +{_id => $id,};
- return $self->get($id);
+ my $new_data = $self->get($id);
+
+ $data->{$_} = $new_data->{$_} for keys %$new_data;
+
+ 1;
}
sub get {
diff --git a/lib/Catmandu/Store/File/Simple/Index.pm b/lib/Catmandu/Store/File/Simple/Index.pm
index ac1f718..78f50d4 100644
--- a/lib/Catmandu/Store/File/Simple/Index.pm
+++ b/lib/Catmandu/Store/File/Simple/Index.pm
@@ -96,7 +96,11 @@ sub add {
# Throws an exception when the path can't be created
path($path)->mkpath;
- return $self->get($id);
+ my $new_data = $self->get($id);
+
+ $data->{$_} = $new_data->{$_} for keys %$new_data;
+
+ 1;
}
sub get {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git
More information about the Pkg-perl-cvs-commits
mailing list