summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Control
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Dpkg/Control')
-rw-r--r--scripts/Dpkg/Control/Info.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/Dpkg/Control/Info.pm b/scripts/Dpkg/Control/Info.pm
index 14bdad149..3f3ef2604 100644
--- a/scripts/Dpkg/Control/Info.pm
+++ b/scripts/Dpkg/Control/Info.pm
@@ -1,4 +1,4 @@
-# Copyright © 2007 Raphaël Hertzog <hertzog@debian.org>
+# Copyright © 2007-2010 Raphaël Hertzog <hertzog@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,6 +24,9 @@ use Dpkg::Gettext;
use base qw(Dpkg::Interface::Storable);
+use overload
+ '@{}' => sub { return [ $_[0]->{source}, @{$_[0]->{packages}} ] };
+
=head1 NAME
Dpkg::Control::Info - parse files like debian/control
@@ -108,6 +111,7 @@ sub parse {
}
}
+=item $c->[0]
=item $c->get_source()
Returns a Dpkg::Control object containing the fields concerning the
@@ -176,6 +180,16 @@ sub output {
return $str;
}
+=item "$c"
+
+Return a string representation of the content.
+
+=item @{$c}
+
+Return a list of Dpkg::Control objects, the first one is corresponding to
+source information and the following ones are the binary packages
+information.
+
=back
=head1 AUTHOR