| 1 | package OpenInteract2::Manage::Website::Upgrade; | ||||||||||
| 2 | |||||||||||
| 3 | # $Id: Upgrade.pm,v 1.19 2005/03/18 04:09:50 lachoy Exp $ | ||||||||||
| 4 | |||||||||||
| 5 | 87 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 87 | ▶ | use base qw( OpenInteract2::Manage::Website ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 87 | ▶ | use File::Spec::Functions qw( catdir ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 87 | ▶ | use OpenInteract2::Manage qw( SYSTEM_PACKAGES ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 87 | $OpenInteract2::Manage::Website::Upgrade::VERSION = sprintf("%d.%02d", q$Revision: 1.19 $ =~ /(\d+)\.(\d+)/); | |||||||||
| 11 | |||||||||||
| 12 | 87 | ▶ | sub get_name { | ||||||||
|
Subroutine
get_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 13 | 87 | return 'upgrade_website'; | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub get_brief_description { | ||||||||
|
Subroutine
get_brief_description: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 17 | 0 | return <<'DESC'; | |||||||||
| 18 | Upgrade your website to a new version of OpenInteract2 -- | ||||||||||
| 19 | remember to read 'perldoc OpenInteract2::Manual::Changes' | ||||||||||
| 20 | to see what has been updated and find any configuration changes | ||||||||||
| 21 | you may need to make. | ||||||||||
| 22 | DESC | ||||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 1 | ▶ | sub get_parameters { | ||||||||
|
Subroutine
get_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 26 | 1 | my ( $self ) = @_; | |||||||||
| 27 | return { | ||||||||||
| 28 | 1 | website_dir => $self->_get_website_dir_param, | |||||||||
| 29 | skip_packages => { | ||||||||||
| 30 | description => 'Indicates that we should not update the packages', | ||||||||||
| 31 | is_boolean => 'yes', | ||||||||||
| 32 | }, | ||||||||||
| 33 | }; | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub setup_task { | ||||||||
|
Subroutine
setup_task: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 37 | 0 | my ( $self ) = @_; | |||||||||
| 38 | 0 | $self->_setup_context({ skip => 'read packages' }); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub run_task { | ||||||||
|
Subroutine
run_task: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 42 | 0 | my ( $self ) = @_; | |||||||||
| 43 | 0 | my $website_dir = $self->param( 'website_dir' ); | |||||||||
| 44 | 0 | ▶ | if ( $self->param( 'skip_packages' ) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | 0 | $self->_ok( 'install package', | |||||||||
| 46 | 'Package install skipped, none installed' ); | ||||||||||
| 47 | } | ||||||||||
| 48 | else { | ||||||||||
| 49 | 0 | $self->notify_observers( progress => 'Upgrading packages', | |||||||||
| 50 | { long => 'yes' } ); | ||||||||||
| 51 | 0 | $self->_install_packages_from_bricks( $website_dir, SYSTEM_PACKAGES ); | |||||||||
| 52 | 0 | $self->notify_observers( progress => 'Package upgrade complete' ); | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 0 | my $brick = OpenInteract2::Brick->new( 'widgets' ); | |||||||||
| 56 | 0 | my $status = $brick->copy_all_resources_to( $website_dir ); | |||||||||
| 57 | 0 | $self->_set_copy_file_status( $status ); | |||||||||
| 58 | 0 | $self->notify_observers( progress => 'Widget copy complete' ); | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 87 | OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ ); | |||||||||
| 62 | |||||||||||
| 63 | 87 | 1; | |||||||||
| 64 | |||||||||||
| 65 | __END__ | ||||||||||