From 5d1795408484778f7978062bb472c97b45a5cd10 Mon Sep 17 00:00:00 2001 From: Raphaƫl Hertzog Date: Sat, 20 Feb 2010 23:50:06 +0100 Subject: Dpkg::Interface::Storable: load() and save() accept "-" for standard input/output Simplify code in Dpkg::Control::Info thanks to this. --- scripts/Dpkg/Control/Info.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'scripts/Dpkg/Control') diff --git a/scripts/Dpkg/Control/Info.pm b/scripts/Dpkg/Control/Info.pm index 3f3ef2604..7ea87a08d 100644 --- a/scripts/Dpkg/Control/Info.pm +++ b/scripts/Dpkg/Control/Info.pm @@ -56,11 +56,7 @@ sub new { }; bless $self, $class; if ($arg) { - if ($arg eq "-") { - $self->parse(\*STDIN, _g("")); - } else { - $self->load($arg); - } + $self->load($arg); } else { $self->load("debian/control"); } @@ -81,7 +77,8 @@ sub reset { =item $c->load($file) -Load the content of $file. Exits in case of errors. +Load the content of $file. Exits in case of errors. If file is "-", it +loads from the standard input. =item $c->parse($fh, $description) -- cgit v1.2.3