[libconfig-model-dpkg-perl] 19/23: update Dpkg backend to read debian/*.install files
dod at debian.org
dod at debian.org
Mon Feb 13 12:29: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 45913352fee7b1f612564ac62d3d0ea534912f10
Author: Dominique Dumont <dod at debian.org>
Date: Mon Feb 13 13:19:10 2017 +0100
update Dpkg backend to read debian/*.install files
---
lib/Config/Model/Backend/Dpkg.pm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/lib/Config/Model/Backend/Dpkg.pm b/lib/Config/Model/Backend/Dpkg.pm
index 76f1db9..9a5df05 100644
--- a/lib/Config/Model/Backend/Dpkg.pm
+++ b/lib/Config/Model/Backend/Dpkg.pm
@@ -4,7 +4,7 @@ use Carp;
use Mouse;
use Config::Model::Exception;
use UNIVERSAL;
-use Path::Tiny;
+use Path::Tiny 0.054;
use File::Path;
use Log::Log4perl qw(get_logger :levels);
use 5.20.1;
@@ -18,15 +18,32 @@ my $logger = get_logger("Backend::Dpkg::Root");
my %dispatch = (
patches => \&read_patch_series,
+ install => \&read_install_files,
);
around read_hash => sub ( $orig, $self, $obj, $elt, $file, $check, $args ) {
+ $logger->info("called for $elt ".$obj->location." file $file" );
my $method = $dispatch{$elt} // $orig;
$self->$method( $obj, $elt, $file, $check, $args );
};
+sub read_install_files ( $self, $hash, $elt, $file, $check, $args ) {
+ my $dir = path($args->{root} . $args->{config_dir});
+
+ return unless $dir->exists;
+
+ $logger->info("Checking $elt directory ($dir) for ".$hash->location );
+ foreach my $file ($dir->children(qr/\.install$/)) {
+ my $pkg = $file->basename(qr/\.install$/);
+ $logger->info("install: found $pkg install file");
+ # create element. Read backend will kick in itself
+ my @content = $hash->fetch_with_id($pkg)->grab("list")->fetch_all_values;
+ say @content;
+ }
+}
+
sub read_patch_series ( $self, $hash, $elt, $file, $check, $args ) {
my $patch_dir = $args->{root} . $args->{config_dir} . "patches";
$logger->info("Checking patches directory ($patch_dir)");
--
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