[libconfig-model-dpkg-perl] 01/07: app dpkg-patch now use backend_arg (req CM 2.104)
dod at debian.org
dod at debian.org
Thu Jul 27 19:02:39 UTC 2017
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 62b2a2265e91baec2921a0ad7727ae8b2647042f
Author: Dominique Dumont <dod at debian.org>
Date: Mon Jul 17 12:22:42 2017 +0200
app dpkg-patch now use backend_arg (req CM 2.104)
---
lib/Config/Model/Backend/Dpkg/Patch.pm | 9 +++------
lib/Config/Model/application.d/dpkg-patch | 3 ++-
t/model_tests.d/dpkg-patch-test-conf.pl | 6 +++---
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/lib/Config/Model/Backend/Dpkg/Patch.pm b/lib/Config/Model/Backend/Dpkg/Patch.pm
index f23e63f..8adaa55 100644
--- a/lib/Config/Model/Backend/Dpkg/Patch.pm
+++ b/lib/Config/Model/Backend/Dpkg/Patch.pm
@@ -43,14 +43,11 @@ sub read {
my $patch_dir = $args{root} . $args{config_dir};
my $check = $args{check};
my $node = $args{object};
- my $file_path = $args{file_path};
- my $patch_name = $node->index_value || $args{config_file};
+ my $backend_arg = $self->instance->backend_arg;
+ my $patch_name = $node->index_value || $backend_arg;
- my $patch_file
- = ($file_path and -e $file_path) ? $file_path
- : -e "$patch_dir$file_path" ? "$patch_dir$file_path"
- : "$patch_dir$patch_name" ;
+ my $patch_file = "$patch_dir$patch_name" ;
$self->{patch_file} = $patch_file;
$logger->info("Parsing patch $patch_file");
diff --git a/lib/Config/Model/application.d/dpkg-patch b/lib/Config/Model/application.d/dpkg-patch
index 0f865e8..70e1a66 100644
--- a/lib/Config/Model/application.d/dpkg-patch
+++ b/lib/Config/Model/application.d/dpkg-patch
@@ -1,3 +1,4 @@
model = Dpkg::Patch
-require_config_file = 1
+require_backend_argument = 1
+backend_argument_info = patch name
support_info = using 'reportbug libconfig-model-dpkg-perl'
diff --git a/t/model_tests.d/dpkg-patch-test-conf.pl b/t/model_tests.d/dpkg-patch-test-conf.pl
index 1c30af6..81908b0 100644
--- a/t/model_tests.d/dpkg-patch-test-conf.pl
+++ b/t/model_tests.d/dpkg-patch-test-conf.pl
@@ -13,7 +13,7 @@ $skip = ( $@ or not -r '/etc/debian_version' ) ? 1 : 0;
@tests = (
{
name => 'libperl5i' ,
- config_file => $conf_file_name,
+ backend_arg => $conf_file_name,
load_warnings => [ qr/https protocol should/ ],
apply_fix => 1 ,
check => {
@@ -31,7 +31,7 @@ $skip = ( $@ or not -r '/etc/debian_version' ) ? 1 : 0;
},
{
name => 'moarvm' ,
- config_file => $conf_file_name,
+ backend_arg => $conf_file_name,
check => {
'Synopsis' => qr/Configure.pl/,
},
@@ -42,7 +42,7 @@ $skip = ( $@ or not -r '/etc/debian_version' ) ? 1 : 0;
},
{
name => 'by-git',
- config_file => $conf_file_name,
+ backend_arg => $conf_file_name,
dump_warnings => [ qr/Empty/ ],
check => {
Description => qr/enhance/,
--
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