| 1 | # | ||
| 2 | # $Id$ | ||
| 3 | # | ||
| 4 | # devel::subversion Brik | ||
| 5 | # | ||
| 6 | package Metabrik::Devel::Subversion; | ||
| 7 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | ▶ | use base qw(Metabrik::Shell::Command Metabrik::System::Package); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | sub brik_properties { | ||
| 13 | return { | ||
| 14 | revision => '$Revision$', | ||
| 15 | tags => [ qw(unstable svn) ], | ||
| 16 | author => 'GomoR <GomoR[at]metabrik.org>', | ||
| 17 | license => 'http://opensource.org/licenses/BSD-3-Clause', | ||
| 18 | attributes => { | ||
| 19 | datadir => [ qw(datadir) ], | ||
| 20 | }, | ||
| 21 | commands => { | ||
| 22 | install => [ ], # Inherited | ||
| 23 | checkout => [ qw(repository directory|OPTIONAL) ], | ||
| 24 | clone => [ qw(repository directory|OPTIONAL) ], | ||
| 25 | }, | ||
| 26 | require_binaries => { | ||
| 27 | 'svn' => [ ], | ||
| 28 | }, | ||
| 29 | need_packages => { | ||
| 30 | ubuntu => [ qw(subversion) ], | ||
| 31 | debian => [ qw(subversion) ], | ||
| 32 | kali => [ qw(subversion) ], | ||
| 33 | }, | ||
| 34 | }; | ||
| 35 | } | ||
| 36 | |||
| 37 | sub checkout { | ||
| 38 | my $self = shift; | ||
| 39 | my ($repository, $directory) = @_; | ||
| 40 | |||
| 41 | $directory ||= ''; | ||
| 42 | $self->brik_help_run_undef_arg('checkout', $repository) or return; | ||
| 43 | |||
| 44 | my $cmd = "svn co $repository $directory"; | ||
| 45 | $self->execute($cmd) or return; | ||
| 46 | |||
| 47 | return $directory; | ||
| 48 | } | ||
| 49 | |||
| 50 | # alias to checkout | ||
| 51 | sub clone { | ||
| 52 | my $self = shift; | ||
| 53 | |||
| 54 | return $self->checkout(@_); | ||
| 55 | } | ||
| 56 | |||
| 57 | 1; | ||
| 58 | |||
| 59 | __END__ | ||