App-perlall

 view release on metacpan or  search on metacpan

script/perlall  view on Meta::CPAN

    $patchperlpath =~ s|PatchPerl\.pm|PatchPerl/Plugin|;
    my $patchasan = `perldoc -l Devel::PatchPerl::Plugin::Asan`;
    chomp $patchasan;
    die "Devel::PatchPerl::Plugin::Asan missing\n" unless $patchasan;
    my $patchperlall = `perldoc -l Devel::PatchPerl::Plugin::perlall`;
    chomp $patchperlall;
    die "Devel::PatchPerl::Plugin::perlall missing\n" unless $patchperlall;
    $c->_system1("ssh",$m,"mkdir -p $patchperlpath");
    $c->_system1("rsync","-avz",$patchasan,"$m:$patchperlpath/Asan.pm");
    $c->_system1("rsync","-avz",$patchperlall,"$m:$patchperlpath/perlall.pm");
  }
  while ($c->stash->{vm} and @{$c->stash->{vm}}) { # restore previous vm state
    my $a = shift @{$c->stash->{vm}};
    $c->_system1(qw(sudo virsh), $a->[1], $a->[0]);
  }
  "initvm done on ".join(" ",@m)
}

=item B<config> I<(var (value))>

=cut

sub config
  :Help('Print (or update - not yet) config')
{
  my $c = shift;
  $c->addopts('options|o');
  my $file = ".perlall=";
  for ( "/etc/perlall", "$ENV{HOME}/.perlall" ) {
    $file .= $_.":" if -f $_;
  }
  print substr($file,0,-1),"\n";
  for (keys %{$c->config}) {
    print $_,"=",$c->config->{$_},"\n";
  }
  if ($c->options->{options}) {
    delete $c->options->{options};
    for (keys %{$c->options}) {
      print $_,"=",$c->options->{$_},"\n";
    }
  }
}

=item B<selfupgrade> [ --latest ]

This command upgrades perlall to its latest or stable version.

=cut

sub selfupgrade
  :Help('Upgrade perlall to its latest or stable version')
{
  my $c = shift;
  $c->addopts('latest|l');
  my $branch = $c->options->{latest} ? 'master' : 'release';
  $c->_system("wget","--no-check-certificate","-O","perlall.tmp",
	      "http://github.com/rurban/App-perlall/raw/$branch/script/perlall");
  if (-s "perlall.tmp" > 5000) {
    $c->_system("chmod","0755","perlall.tmp");
    $c->_system("mv","perlall.tmp",-l $0 ? readlink($0) : $0) or
      "$0 updated"
  } else {
    "wget download from github failed"
  }
}

=item B<help>

prints this help. With -v even more.

=cut

sub help
  :Help('List of commands. With -v more')
{
  my $c = shift;
  $c->addopts( 'verbose|v' );
  require Pod::Usage;
  return Pod::Usage::pod2usage
    ( { -message => App::Rad::Help::usage() . "\n\n"
	. App::Rad::Help::helpstr($c),
	-verbose => $c->options->{verbose} ? 3 : 0,
      } );
}

=item B<version>

=cut

sub version
  :Help('Print version')
{
  # hardlink variants (perlall-make, ...)
  print basename($0)." $main::VERSION\n";
  exit;
}

=back

=head1 CONFIGURATION

Stored in F<~/.perlall> or F</etc/perlall>

This is shell-script syntax with ENV vars and aliases.
C<alias p=$perlall> is also written by C<perlall>.

It is recommended to source this from your F<.profile> for the handy aliases.

=over 4

=item alias p=perl5.15.4d-nt

Save current perl in shell alias form.

This is stored after each perlall execution.
Dependend on p there are several other handy p aliases,
which are active if you source them from your F<~/.profile>
See F<.perlall>

=item alias perl-git="cd /usr/src/perl/blead/perl-git"



( run in 0.521 second using v1.01-cache-2.11-cpan-98e64b0badf )