line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of App-Cme |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is Copyright (c) 2014-2022 by Dominique Dumont <ddumont@cpan.org>. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software, licensed under: |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# The GNU Lesser General Public License, Version 2.1, February 1999 |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# ABSTRACT: Migrate the configuration of an application |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package App::Cme::Command::migrate ; |
13
|
|
|
|
|
|
|
$App::Cme::Command::migrate::VERSION = '1.037'; |
14
|
1
|
|
|
1
|
|
666
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
15
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
16
|
1
|
|
|
1
|
|
28
|
use 5.10.1; |
|
1
|
|
|
|
|
4
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
5
|
use App::Cme -command ; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
263
|
use base qw/App::Cme::Common/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
142
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
6
|
use Config::Model::ObjTreeScanner; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
255
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub validate_args { |
25
|
0
|
|
|
0
|
1
|
|
my ($self, $opt, $args) = @_; |
26
|
0
|
|
|
|
|
|
$self->check_unknown_args($args); |
27
|
0
|
|
|
|
|
|
$self->process_args($opt,$args); |
28
|
0
|
|
|
|
|
|
return; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub opt_spec { |
32
|
0
|
|
|
0
|
1
|
|
my ( $class, $app ) = @_; |
33
|
|
|
|
|
|
|
return ( |
34
|
0
|
|
|
|
|
|
[ "backup:s" => "Create a backup of configuration files before saving." ], |
35
|
|
|
|
|
|
|
$class->cme_global_options, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub usage_desc { |
40
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
41
|
0
|
|
|
|
|
|
my $desc = $self->SUPER::usage_desc; # "%c COMMAND %o" |
42
|
0
|
|
|
|
|
|
return "$desc [application] [file ]"; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub description { |
46
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
47
|
0
|
|
|
|
|
|
return $self->get_documentation; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub execute { |
51
|
0
|
|
|
0
|
1
|
|
my ($self, $opt, $args) = @_; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my ($model, $inst, $root) = $self->init_cme($opt,$args); |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$root->migrate; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$self->save($inst,$opt) ; |
58
|
0
|
|
|
|
|
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=pod |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=encoding UTF-8 |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 NAME |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
App::Cme::Command::migrate - Migrate the configuration of an application |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 VERSION |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
version 1.037 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SYNOPSIS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# check dpkg files, update deprecated parameters and save |
80
|
|
|
|
|
|
|
cme migrate dpkg |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 DESCRIPTION |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Checks the content of the configuration file of an application (and show |
85
|
|
|
|
|
|
|
warnings if needed), update deprecated parameters (old value are saved |
86
|
|
|
|
|
|
|
to new parameters) and save the new configuration. See L<App::Cme::Command::migrate>. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
For more details, see L<Config::Model::Value/Upgrade> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 Common options |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
See L<cme/"Global Options">. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 SEE ALSO |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L<cme> |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 AUTHOR |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Dominique Dumont |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
This software is Copyright (c) 2014-2022 by Dominique Dumont <ddumont@cpan.org>. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
This is free software, licensed under: |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
The GNU Lesser General Public License, Version 2.1, February 1999 |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |