[libconfig-model-dpkg-perl] 01/01: first stab at using cme to create meta packages
dod at debian.org
dod at debian.org
Fri Jul 29 16:24:47 UTC 2016
This is an automated email from the git hooks/post-receive script.
dod pushed a commit to branch cme-dpkg-from-scratch
in repository libconfig-model-dpkg-perl.
commit 78a634f427f513c034fdd3935df07968acb06c0a
Author: Dominique Dumont <dod at debian.org>
Date: Mon Jul 11 19:49:03 2016 +0200
first stab at using cme to create meta packages
---
lib/Config/Model/Dpkg/Control/BinaryHash.pm | 24 ++++++++++++++++++++++++
lib/Config/Model/models/Dpkg/Control.pl | 1 +
2 files changed, 25 insertions(+)
diff --git a/lib/Config/Model/Dpkg/Control/BinaryHash.pm b/lib/Config/Model/Dpkg/Control/BinaryHash.pm
new file mode 100644
index 0000000..215f2c0
--- /dev/null
+++ b/lib/Config/Model/Dpkg/Control/BinaryHash.pm
@@ -0,0 +1,24 @@
+package Config::Model::Dpkg::Control::BinaryHash;
+
+use 5.010;
+
+use Mouse;
+extends qw/Config::Model::HashId/;
+
+sub get_default_keys {
+ my $self = shift ;
+
+ # Currently, Dpkg model is set so that this function returns an
+ # empty list. But it may change and I may forgot about this
+ # override. So I'm cautious.
+ my @res = $self->SUPER::get_default_keys();
+
+ my $source = $self->grab_value('- source Source');
+
+ # source is mandatory but may be undef if binary hash is accessed
+ # before source is set
+ push @res, $source if defined $source and not @res;
+
+ return wantarray ? @res : \@res;
+}
+1;
diff --git a/lib/Config/Model/models/Dpkg/Control.pl b/lib/Config/Model/models/Dpkg/Control.pl
index 4882a2f..0749883 100644
--- a/lib/Config/Model/models/Dpkg/Control.pl
+++ b/lib/Config/Model/models/Dpkg/Control.pl
@@ -19,6 +19,7 @@
'config_class_name' => 'Dpkg::Control::Binary',
'type' => 'node'
},
+ 'class' => 'Config::Model::Dpkg::Control::BinaryHash',
'index_type' => 'string',
'ordered' => '1',
'summary' => 'package binary description',
--
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