| 1 | ########################################### | ||||||||||
| 2 | package GitMeta::SshDir; | ||||||||||
| 3 | ########################################### | ||||||||||
| 4 | # 2010, Mike Schilli <m@perlmeister.com> | ||||||||||
| 5 | ########################################### | ||||||||||
| 6 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use base qw(GitMeta); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use Sysadm::Install qw(:all); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | ▶ | use Log::Log4perl qw(:easy); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | ########################################### | ||||||||||
| 13 | 0 | ▶ | sub expand { | ||||||||
|
Subroutine
expand: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 14 | ########################################### | ||||||||||
| 15 | 0 | my($self) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 0 | my $ssh = "ssh"; | |||||||||
| 18 | 0 | ▶ | $ssh = $ENV{GIT_SSH} if defined $ENV{GIT_SSH}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | |||||||||||
| 20 | 0 | $self->param_check("host", "dir"); | |||||||||
| 21 | |||||||||||
| 22 | 0 | INFO "Retrieving repos ", | |||||||||
| 23 | "from $self->{host}"; | ||||||||||
| 24 | |||||||||||
| 25 | my($stdout) = tap $ssh, $self->{host}, | ||||||||||
| 26 | 0 | "ls", $self->{dir}; | |||||||||
| 27 | |||||||||||
| 28 | 0 | my @repos = (); | |||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | while( $stdout =~ /(.*)\n/g ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | push @repos, | |||||||||
| 32 | "$self->{host}:$self->{dir}/$1"; | ||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | return @repos; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 1 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||