[libconfig-model-dpkg-perl] 01/03: dpkg control backend: improved error message for unknown flags
dod at debian.org
dod at debian.org
Fri Aug 23 16:44:17 UTC 2013
This is an automated email from the git hooks/post-receive script.
dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.
commit 7e87c6446ef6ab9efa1898f7ee9e3eef43577fd7
Author: Dominique Dumont <dod at debian.org>
Date: Fri Aug 23 18:36:11 2013 +0200
dpkg control backend: improved error message for unknown flags
---
lib/Config/Model/Backend/Dpkg/Control.pm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/Config/Model/Backend/Dpkg/Control.pm b/lib/Config/Model/Backend/Dpkg/Control.pm
index 77a83c5..ba855c8 100644
--- a/lib/Config/Model/Backend/Dpkg/Control.pm
+++ b/lib/Config/Model/Backend/Dpkg/Control.pm
@@ -118,14 +118,16 @@ sub store_section_in_tree {
. $node->location
. ")" );
- # control parameters are case insensitive
- my $found = $node->find_element( $key, case => 'any' ) ;
+ # control parameters are case insensitive. Falling back on $key
+ # means $key is unknown. fetch_element will trigger a meaningful
+ # error message
+ my $found = $node->find_element( $key, case => 'any' ) || $key;
my ($v,$l,$a, at c) = @$v_ref;
$logger->debug("$key value: $v");
- my $type = $node->element_type($found);
my $elt_obj = $node->fetch_element( name => $found, check => $check );
+ my $type = $node->element_type($found);
$elt_obj->annotation(join("\n", at c)) if @c ;
$elt_obj->notify_change(note => $a, really => 1) if $a ;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git
More information about the Pkg-perl-cvs-commits
mailing list