The following commit has been merged in the master branch:
commit 9e7dfecce74f4d58de5be46b387b899489869876
Author: Raphaël Hertzog <[email protected]>
Date:   Thu Feb 18 23:32:25 2010 +0100

    Update Dpkg::Deps to make use of Dpkg::Interface::Storable
    
    Parsing part is only partially supported currently.

diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm
index 7c443af..6ca6207 100644
--- a/scripts/Dpkg/Deps.pm
+++ b/scripts/Dpkg/Deps.pm
@@ -464,7 +464,7 @@ architecture is prefixed with an exclamation mark.
 
 =over 4
 
-=item $simple_dep->parse("dpkg-dev (>= 1.14.8) [!hurd-i386]")
+=item $simple_dep->parse_string("dpkg-dev (>= 1.14.8) [!hurd-i386]")
 
 Parse the dependency and modify internal properties to match the parsed
 dependency.
@@ -486,7 +486,7 @@ use Dpkg::Version;
 use Dpkg::ErrorHandling;
 use Dpkg::Gettext;
 
-use overload '""' => sub { $_[0]->output() };
+use base qw(Dpkg::Interface::Storable);
 
 sub new {
     my ($this, $arg) = @_;
@@ -498,11 +498,18 @@ sub new {
        'arches' => undef,
     };
     bless $self, $class;
-    $self->parse($arg) if defined($arg);
+    $self->parse_string($arg) if defined($arg);
     return $self;
 }
 
 sub parse {
+    my ($self, $fh, $desc) = @_;
+    my $line = <$fh>;
+    chomp($line);
+    return $self->parse_string($line);
+}
+
+sub parse_string {
     my ($self, $dep) = @_;
     return if not $dep =~
             /^\s*                           # skip leading whitespace
@@ -760,7 +767,7 @@ use warnings;
 
 use Dpkg::ErrorHandling;
 
-use overload '""' => sub { $_[0]->output() };
+use base qw(Dpkg::Interface::Storable);
 
 sub new {
     my $this = shift;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to