diff options
author | Raphaël Hertzog <hertzog@debian.org> | 2010-02-20 23:50:06 +0100 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2010-02-21 00:08:01 +0100 |
commit | 5d1795408484778f7978062bb472c97b45a5cd10 (patch) | |
tree | 8bf7aaef3ab300ace8698fe7f96ecadd36c3dfcb /scripts/Dpkg/Control/Info.pm | |
parent | 513baa2c1e20036528fd8fb986ef407d4aa8d415 (diff) | |
download | dpkg-5d1795408484778f7978062bb472c97b45a5cd10.tar.gz |
Dpkg::Interface::Storable: load() and save() accept "-" for standard input/output
Simplify code in Dpkg::Control::Info thanks to this.
Diffstat (limited to 'scripts/Dpkg/Control/Info.pm')
-rw-r--r-- | scripts/Dpkg/Control/Info.pm | 9 |
1 files changed, 3 insertions, 6 deletions
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("<standard input>")); - } 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) |