Commit 74602df1 authored by boklm's avatar boklm Committed by Richard Pospesel
Browse files

Bug 41067: Use Capture::Tiny instead of IO::CaptureOutput

The IO::CaptureOutput perl module is deprecated, so we switch to
Capture::Tiny. We also remove some uses of IO::CaptureOutput where it
was not needed.
parent cfa73f9c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ You also need a few perl modules installed:
- Getopt::Long
- Template
- IO::Handle
- IO::CaptureOutput
- Capture::Tiny
- JSON
- File::Temp
- Path::Tiny
@@ -41,7 +41,7 @@ If you are running Debian or Ubuntu, you can install them with:

# apt-get install libdata-dump-perl libdata-uuid-perl libdatetime-perl \
                  libdigest-sha-perl libfile-copy-recursive-perl \
                  libfile-slurp-perl libio-all-perl libio-captureoutput-perl \
                  libfile-slurp-perl libio-all-perl libcapture-tiny-perl \
                  libio-handle-util-perl libjson-perl \
                  libparallel-forkmanager-perl libpath-tiny-perl \
                  libsort-versions-perl libstring-shellquote-perl \
@@ -51,7 +51,7 @@ If you are running Debian or Ubuntu, you can install them with:
If you are running an Arch based system, you should be able to install them with:

# pacman -S perl-datetime perl-path-tiny perl-yaml perl-yaml-libyaml \
            perl-yaml-tiny perl-template-toolkit perl-io-captureoutput \
            perl-yaml-tiny perl-template-toolkit perl-capture-tiny \
            perl-file-copy-recursive perl-string-shellquote \
            perl-sort-versions perl-data-uuid perl-data-dump perl-json \
            perl-digest-sha1 perl-io-all perl-file-slurp perl-sys-syscall \
+0 −1
Original line number Diff line number Diff line
@@ -705,7 +705,6 @@ gpg_allow_expired_keys: 1

--- |
  # This part of the file contains options written in perl
  use IO::CaptureOutput qw(capture_exec);
  (
    var_p => {
      nightly_torbrowser_version => sub {
+0 −1
Original line number Diff line number Diff line
#!/usr/bin/perl -w
use strict;
use IO::CaptureOutput qw(capture_exec);
use FindBin;
use lib "$FindBin::Bin/../rbm/lib";
use RBM;
+10 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#  $ export "PATH=$p7zipdir/bin:$PATH"

use strict;
use IO::CaptureOutput qw(capture_exec);
use Capture::Tiny qw(capture);
use File::Slurp;
use File::Find;
use Parallel::ForkManager;
@@ -48,6 +48,15 @@ sub exit_error {
    exit (exists $_[1] ? $_[1] : 1);
}

sub capture_exec {
  my @cmd = @_;
  my ($stdout, $stderr, $exit) = capture {
    system(@cmd);
  };
  return ($stdout, $stderr, $exit == 0, $exit) if wantarray();
  return $stdout;
}

sub osname {
    my ($osname) = capture_exec('uname', '-s');
    my ($arch) = capture_exec('uname', '-m');
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
use strict;
use English;
use LWP::Simple;
use IO::CaptureOutput qw(capture_exec);
use File::Temp;
use File::Basename qw(fileparse);
use FindBin;
Loading