diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-08-11 17:02:50 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-08-11 17:02:50 +0000 |
commit | c2e3c2a0ca9dcd04d555cc6ae0bca2cc58bbd6d8 (patch) | |
tree | 4a7b9b3bf016411fa30ca2af9d090b436c9d6835 /perl-install/run_program.pm | |
parent | e7c248176455c53e143b4f4715a820ae1e5947df (diff) | |
download | drakx-c2e3c2a0ca9dcd04d555cc6ae0bca2cc58bbd6d8.tar drakx-c2e3c2a0ca9dcd04d555cc6ae0bca2cc58bbd6d8.tar.gz drakx-c2e3c2a0ca9dcd04d555cc6ae0bca2cc58bbd6d8.tar.bz2 drakx-c2e3c2a0ca9dcd04d555cc6ae0bca2cc58bbd6d8.tar.xz drakx-c2e3c2a0ca9dcd04d555cc6ae0bca2cc58bbd6d8.zip |
add get_stdout (similar to rooted_get_stdout)
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r-- | perl-install/run_program.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 78ae48559..4fc9393f6 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -16,6 +16,13 @@ sub rooted_or_die { my ($root, $name, @args) = @_; rooted($root, $name, @args) or die "$name failed\n"; } + +sub get_stdout { + my ($name, @args) = @_; + my @r; + run($name, '>', \@r, @args) or return; + wantarray ? @r : join('', @r); +} sub rooted_get_stdout { my ($root, $name, @args) = @_; my @r; |