| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Sys::Config::Manage::Remove; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20311
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
30
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
29
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use File::Basename; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
76
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use base 'Error::Helper'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
724
|
|
|
7
|
1
|
|
|
1
|
|
1554
|
use String::ShellQuote; |
|
|
1
|
|
|
|
|
790
|
|
|
|
1
|
|
|
|
|
60
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use File::Spec; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
19
|
|
|
9
|
1
|
|
|
1
|
|
4
|
use File::Path qw(remove_tree); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
47
|
|
|
10
|
1
|
|
|
1
|
|
4
|
use String::ShellQuote; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
2563
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Sys::Config::Manage::Remove - Removes no longer desired files and/or directories. |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 VERSION |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Version 0.0.1 |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = '0.0.1'; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
use Sys::Config::Manage::Remove; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $foo = Sys::Config::Manage::Remove->new(); |
|
30
|
|
|
|
|
|
|
... |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 METHODS |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 new |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head3 args hash |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head4 scm |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
This is a initialized Sys::Config::Manage object. |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
$foo=Sys::Config::Manage::Remove->new(\%args); |
|
43
|
|
|
|
|
|
|
if($foo->error){ |
|
44
|
|
|
|
|
|
|
warn('error:'.$foo->error.': '.$foo->errorString); |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub new{ |
|
50
|
0
|
|
|
0
|
1
|
|
my %args; |
|
51
|
0
|
0
|
|
|
|
|
if(defined($_[1])){ |
|
52
|
0
|
|
|
|
|
|
%args= %{$_[1]}; |
|
|
0
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
}; |
|
54
|
0
|
|
|
|
|
|
my $method='new'; |
|
55
|
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
my $self = { |
|
57
|
|
|
|
|
|
|
module=>'Sys-Config-Manage-Scripts', |
|
58
|
|
|
|
|
|
|
perror=>undef, |
|
59
|
|
|
|
|
|
|
error=>undef, |
|
60
|
|
|
|
|
|
|
errorString=>"", |
|
61
|
|
|
|
|
|
|
}; |
|
62
|
0
|
|
|
|
|
|
bless $self; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
#make sure we have a Sys::Config::Manage |
|
65
|
0
|
0
|
|
|
|
|
if(!defined( $args{scm} ) ){ |
|
66
|
0
|
|
|
|
|
|
$self->{perror}=1; |
|
67
|
0
|
|
|
|
|
|
$self->{error}=1; |
|
68
|
0
|
|
|
|
|
|
$self->{errorString}='Nothing passed for the Sys::Config::Manage object'; |
|
69
|
0
|
|
|
|
|
|
$self->warn; |
|
70
|
0
|
|
|
|
|
|
return $self; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
#make sure that it is really a Sys::Config::Manage object |
|
74
|
0
|
0
|
|
|
|
|
if( ref( $args{scm} ) ne "Sys::Config::Manage" ){ |
|
75
|
0
|
|
|
|
|
|
$self->{perror}=1; |
|
76
|
0
|
|
|
|
|
|
$self->{error}=2; |
|
77
|
0
|
|
|
|
|
|
$self->{errorString}='$args{scm} is not a Sys::Config::Manage object'; |
|
78
|
0
|
|
|
|
|
|
$self->warn; |
|
79
|
0
|
|
|
|
|
|
return $self; |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
$self->{scm}=$args{scm}; |
|
83
|
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return $self; |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 add |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This adds a directory or file to be removed. |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
$foo->add( $configDir, $somethingToAdd ); |
|
92
|
|
|
|
|
|
|
if ( $foo->error ){ |
|
93
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub add{ |
|
99
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
|
100
|
0
|
|
|
|
|
|
my $configDir=$_[1]; |
|
101
|
0
|
|
|
|
|
|
my $item=$_[2]; |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
#blank any previous errors |
|
104
|
0
|
0
|
|
|
|
|
if (!$self->errorblank) { |
|
105
|
0
|
|
|
|
|
|
return undef; |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
#make sure we have a directory to use |
|
109
|
0
|
0
|
|
|
|
|
if (!defined($configDir)) { |
|
110
|
0
|
|
|
|
|
|
$configDir=$self->{scm}->selectConfigDir; |
|
111
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
112
|
0
|
|
|
|
|
|
$self->{error}=5; |
|
113
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->selectConfigDir errored error="'. |
|
114
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
115
|
0
|
|
|
|
|
|
$self->warn; |
|
116
|
0
|
|
|
|
|
|
return undef; |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
# make sure something is specified |
|
121
|
0
|
0
|
|
|
|
|
if ( ! defined( $item ) ){ |
|
122
|
0
|
|
|
|
|
|
$self->{error}=3; |
|
123
|
0
|
|
|
|
|
|
$self->{errorString}='No item that should be removed defined'; |
|
124
|
0
|
|
|
|
|
|
$self->warn; |
|
125
|
0
|
|
|
|
|
|
return undef; |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# make sure it starts with a / or contain \n |
|
129
|
0
|
0
|
0
|
|
|
|
if ( |
|
130
|
|
|
|
|
|
|
( $item !~ /^\// ) || |
|
131
|
|
|
|
|
|
|
( $item =~ /\n/ ) |
|
132
|
|
|
|
|
|
|
){ |
|
133
|
0
|
|
|
|
|
|
$self->{error}=4; |
|
134
|
0
|
|
|
|
|
|
$self->{errorString}='The path,"'.$item.'", does not appear to be a valid path'; |
|
135
|
0
|
|
|
|
|
|
$self->warn; |
|
136
|
0
|
|
|
|
|
|
return undef; |
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
0
|
|
|
|
|
|
$item=File::Spec->canonpath( $item ); |
|
140
|
|
|
|
|
|
|
|
|
141
|
0
|
|
|
|
|
|
my $exists=$self->exists( $configDir, $item ); |
|
142
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
|
143
|
0
|
|
|
|
|
|
$self->warnString('Failed to check if it already exists'); |
|
144
|
0
|
|
|
|
|
|
return undef; |
|
145
|
|
|
|
|
|
|
} |
|
146
|
0
|
0
|
|
|
|
|
if ( $exists ){ |
|
147
|
0
|
|
|
|
|
|
$self->{error}=10; |
|
148
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$item.'" already exists'; |
|
149
|
0
|
|
|
|
|
|
$self->warn; |
|
150
|
0
|
|
|
|
|
|
return undef; |
|
151
|
|
|
|
|
|
|
} |
|
152
|
|
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
my @list=$self->list( $configDir ); |
|
154
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
|
155
|
0
|
|
|
|
|
|
$self->warnString('Failed to fetch the list for "'.$configDir.'"'); |
|
156
|
0
|
|
|
|
|
|
return undef; |
|
157
|
|
|
|
|
|
|
} |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
#add it to the list |
|
160
|
0
|
|
|
|
|
|
push( @list, $item ); |
|
161
|
0
|
|
|
|
|
|
@list=sort( @list ); |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
#saves it |
|
164
|
0
|
|
|
|
|
|
$self->save( $configDir, \@list ); |
|
165
|
|
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
return 1; |
|
167
|
|
|
|
|
|
|
} |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head2 clean |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
This removes everything in the remove list for a specified |
|
172
|
|
|
|
|
|
|
configuration directory. |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
There is one argument taken and that is the configuration |
|
175
|
|
|
|
|
|
|
directory. If it is not specified, it will be automatically |
|
176
|
|
|
|
|
|
|
choosen. |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
$foo->clean( $configDir ); |
|
179
|
|
|
|
|
|
|
if ( $foo->error ){ |
|
180
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
|
181
|
|
|
|
|
|
|
} |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=cut |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
sub clean{ |
|
186
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
|
187
|
0
|
|
|
|
|
|
my $configDir=$_[1]; |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
#blank any previous errors |
|
190
|
0
|
0
|
|
|
|
|
if (!$self->errorblank) { |
|
191
|
0
|
|
|
|
|
|
return undef; |
|
192
|
|
|
|
|
|
|
} |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
#make sure we have a directory to use |
|
195
|
0
|
0
|
|
|
|
|
if (!defined($configDir)) { |
|
196
|
0
|
|
|
|
|
|
$configDir=$self->{scm}->selectConfigDir; |
|
197
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
198
|
0
|
|
|
|
|
|
$self->{error}=5; |
|
199
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->selectConfigDir errored error="'. |
|
200
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
201
|
0
|
|
|
|
|
|
$self->warn; |
|
202
|
0
|
|
|
|
|
|
return undef; |
|
203
|
|
|
|
|
|
|
} |
|
204
|
|
|
|
|
|
|
} |
|
205
|
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
#gets the list |
|
207
|
0
|
|
|
|
|
|
my @list=$self->list; |
|
208
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
|
209
|
0
|
|
|
|
|
|
$self->warnString('Failed to get the remove list for "'.$configDir.'"'); |
|
210
|
0
|
|
|
|
|
|
return undef; |
|
211
|
|
|
|
|
|
|
} |
|
212
|
|
|
|
|
|
|
|
|
213
|
0
|
|
|
|
|
|
my $int=0; |
|
214
|
0
|
|
|
|
|
|
while( defined( $list[$int] ) ){ |
|
215
|
0
|
0
|
|
|
|
|
if ( -d $list[$int] ){ |
|
216
|
0
|
|
|
|
|
|
remove_tree( $list[$int], { error=>\my $err } ); |
|
217
|
0
|
0
|
|
|
|
|
if (@$err) { |
|
218
|
0
|
|
|
|
|
|
$self->{error}=11; |
|
219
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to remove the file "'.$list[$int].'"'; |
|
220
|
0
|
|
|
|
|
|
$self->warn; |
|
221
|
0
|
|
|
|
|
|
return undef; |
|
222
|
|
|
|
|
|
|
} |
|
223
|
|
|
|
|
|
|
} |
|
224
|
0
|
0
|
|
|
|
|
if ( -f $list[$int] ){ |
|
225
|
0
|
0
|
|
|
|
|
if ( ! unlink( $list[$int] ) ){ |
|
226
|
0
|
|
|
|
|
|
$self->{error}=11; |
|
227
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to remove the file "'.$list[$int].'"'; |
|
228
|
0
|
|
|
|
|
|
$self->warn; |
|
229
|
0
|
|
|
|
|
|
return undef; |
|
230
|
|
|
|
|
|
|
} |
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
|
|
233
|
0
|
|
|
|
|
|
$int++; |
|
234
|
|
|
|
|
|
|
} |
|
235
|
|
|
|
|
|
|
|
|
236
|
0
|
|
|
|
|
|
return 1; |
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=head2 exists |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
This check if a path already exists in the list or not. |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
Two arguments are taken. The first is the configuration |
|
244
|
|
|
|
|
|
|
directory, which is automatically choosen if not specified. |
|
245
|
|
|
|
|
|
|
The second is the path to check for. |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
The returned value is a boolean. |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
my $exists=$foo->exists( $configDir, $path ); |
|
250
|
|
|
|
|
|
|
if ( $foo->error ){ |
|
251
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
|
252
|
|
|
|
|
|
|
} |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=cut |
|
255
|
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
sub exists{ |
|
257
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
|
258
|
0
|
|
|
|
|
|
my $configDir=$_[1]; |
|
259
|
0
|
|
|
|
|
|
my $item=$_[2]; |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
#blank any previous errors |
|
262
|
0
|
0
|
|
|
|
|
if (!$self->errorblank) { |
|
263
|
0
|
|
|
|
|
|
return undef; |
|
264
|
|
|
|
|
|
|
} |
|
265
|
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
# make sure something is specified |
|
267
|
0
|
0
|
|
|
|
|
if ( ! defined( $item ) ){ |
|
268
|
0
|
|
|
|
|
|
$self->{error}=3; |
|
269
|
0
|
|
|
|
|
|
$self->{errorString}='No item that should be removed defined'; |
|
270
|
0
|
|
|
|
|
|
$self->warn; |
|
271
|
0
|
|
|
|
|
|
return undef; |
|
272
|
|
|
|
|
|
|
} |
|
273
|
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
# make sure it starts with a / or contain \n |
|
275
|
0
|
0
|
0
|
|
|
|
if ( |
|
276
|
|
|
|
|
|
|
( $item !~ /^\// ) || |
|
277
|
|
|
|
|
|
|
( $item =~ /\n/ ) |
|
278
|
|
|
|
|
|
|
){ |
|
279
|
0
|
|
|
|
|
|
$self->{error}=4; |
|
280
|
0
|
|
|
|
|
|
$self->{errorString}='The path,"'.$item.'", does not appear to be a valid path'; |
|
281
|
0
|
|
|
|
|
|
$self->warn; |
|
282
|
0
|
|
|
|
|
|
return undef; |
|
283
|
|
|
|
|
|
|
} |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
#make sure we have a directory to use |
|
286
|
0
|
0
|
|
|
|
|
if (!defined($configDir)) { |
|
287
|
0
|
|
|
|
|
|
$configDir=$self->{scm}->selectConfigDir; |
|
288
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
289
|
0
|
|
|
|
|
|
$self->{error}=5; |
|
290
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->selectConfigDir errored error="'. |
|
291
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
292
|
0
|
|
|
|
|
|
$self->warn; |
|
293
|
0
|
|
|
|
|
|
return undef; |
|
294
|
|
|
|
|
|
|
} |
|
295
|
|
|
|
|
|
|
} |
|
296
|
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
#make sure the config directory is valid |
|
298
|
0
|
|
|
|
|
|
my $valid=$self->{scm}->validConfigDirName($configDir); |
|
299
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
300
|
0
|
|
|
|
|
|
$self->{error}=7; |
|
301
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->validConfigDirName errored error="'. |
|
302
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
303
|
0
|
|
|
|
|
|
$self->warn; |
|
304
|
0
|
|
|
|
|
|
return undef; |
|
305
|
|
|
|
|
|
|
} |
|
306
|
0
|
0
|
|
|
|
|
if (defined( $valid )) { |
|
307
|
0
|
|
|
|
|
|
$self->{error}=8; |
|
308
|
0
|
|
|
|
|
|
$self->{errorString}='The configuration directory name '.$valid; |
|
309
|
0
|
|
|
|
|
|
$self->warn; |
|
310
|
0
|
|
|
|
|
|
return undef; |
|
311
|
|
|
|
|
|
|
} |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
#makes sure it exists |
|
314
|
0
|
0
|
|
|
|
|
if ( ! -d $self->{scm}->{baseDir}.'/'.$configDir ) { |
|
315
|
0
|
|
|
|
|
|
$self->{error}=9; |
|
316
|
0
|
|
|
|
|
|
$self->{errorString}='The configuration directory, "'.$self->{baseDir}.'/'.$configDir.'", does not exist'; |
|
317
|
0
|
|
|
|
|
|
$self->warn; |
|
318
|
0
|
|
|
|
|
|
return undef; |
|
319
|
|
|
|
|
|
|
} |
|
320
|
|
|
|
|
|
|
|
|
321
|
0
|
|
|
|
|
|
$item=File::Spec->canonpath( $item ); |
|
322
|
|
|
|
|
|
|
|
|
323
|
0
|
|
|
|
|
|
my @list=$self->list( $configDir ); |
|
324
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
|
325
|
0
|
|
|
|
|
|
$self->warnString('Failed to fetch the list for "'.$configDir.'"'); |
|
326
|
0
|
|
|
|
|
|
return undef; |
|
327
|
|
|
|
|
|
|
} |
|
328
|
|
|
|
|
|
|
|
|
329
|
0
|
|
|
|
|
|
my $int=0; |
|
330
|
0
|
|
|
|
|
|
while( defined( $list[$int] ) ){ |
|
331
|
0
|
0
|
|
|
|
|
if ( $list[$int] eq $item ){ |
|
332
|
0
|
|
|
|
|
|
return 1; |
|
333
|
|
|
|
|
|
|
} |
|
334
|
|
|
|
|
|
|
|
|
335
|
0
|
|
|
|
|
|
$int++; |
|
336
|
|
|
|
|
|
|
} |
|
337
|
|
|
|
|
|
|
|
|
338
|
0
|
|
|
|
|
|
return 0; |
|
339
|
|
|
|
|
|
|
} |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=head2 list |
|
342
|
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
This returns the list of the paths to remove. |
|
344
|
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
One argument is taken and that is the configuration directory to |
|
346
|
|
|
|
|
|
|
us. If not specified, it is automatically selected. |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
my @removePaths=$foo->list( $configDir ); |
|
349
|
|
|
|
|
|
|
if ( $foo->error ){ |
|
350
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
|
351
|
|
|
|
|
|
|
} |
|
352
|
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
=cut |
|
354
|
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
sub list{ |
|
356
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
|
357
|
0
|
|
|
|
|
|
my $configDir=$_[1]; |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
#blank any previous errors |
|
360
|
0
|
0
|
|
|
|
|
if (!$self->errorblank) { |
|
361
|
0
|
|
|
|
|
|
return undef; |
|
362
|
|
|
|
|
|
|
} |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
#make sure we have a directory to use |
|
365
|
0
|
0
|
|
|
|
|
if (!defined($configDir)) { |
|
366
|
0
|
|
|
|
|
|
$configDir=$self->{scm}->selectConfigDir; |
|
367
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
368
|
0
|
|
|
|
|
|
$self->{error}=5; |
|
369
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->selectConfigDir errored error="'. |
|
370
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
371
|
0
|
|
|
|
|
|
$self->warn; |
|
372
|
0
|
|
|
|
|
|
return undef; |
|
373
|
|
|
|
|
|
|
} |
|
374
|
|
|
|
|
|
|
} |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
#make sure the config directory is valid |
|
377
|
0
|
|
|
|
|
|
my $valid=$self->{scm}->validConfigDirName($configDir); |
|
378
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
379
|
0
|
|
|
|
|
|
$self->{error}=7; |
|
380
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->validConfigDirName errored error="'. |
|
381
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
382
|
0
|
|
|
|
|
|
$self->warn; |
|
383
|
0
|
|
|
|
|
|
return undef; |
|
384
|
|
|
|
|
|
|
} |
|
385
|
0
|
0
|
|
|
|
|
if (defined( $valid )) { |
|
386
|
0
|
|
|
|
|
|
$self->{error}=8; |
|
387
|
0
|
|
|
|
|
|
$self->{errorString}='The configuration directory name '.$valid; |
|
388
|
0
|
|
|
|
|
|
$self->warn; |
|
389
|
0
|
|
|
|
|
|
return undef; |
|
390
|
|
|
|
|
|
|
} |
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
#makes sure it exists |
|
393
|
0
|
0
|
|
|
|
|
if ( ! -d $self->{scm}->{baseDir}.'/'.$configDir ) { |
|
394
|
0
|
|
|
|
|
|
$self->{error}=9; |
|
395
|
0
|
|
|
|
|
|
$self->{errorString}='The configuration directory, "'.$self->{baseDir}.'/'.$configDir.'", does not exist'; |
|
396
|
0
|
|
|
|
|
|
$self->warn; |
|
397
|
0
|
|
|
|
|
|
return undef; |
|
398
|
|
|
|
|
|
|
} |
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
#reads it |
|
401
|
0
|
|
|
|
|
|
my @removelines; |
|
402
|
0
|
|
|
|
|
|
my $removefile=$self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/Remove/list'; |
|
403
|
0
|
0
|
|
|
|
|
if ( ! -f $removefile ){ |
|
404
|
0
|
|
|
|
|
|
return @removelines; |
|
405
|
|
|
|
|
|
|
} |
|
406
|
0
|
|
|
|
|
|
my $fh; |
|
407
|
0
|
0
|
|
|
|
|
if ( ! open( $fh, '<', $removefile ) ){ |
|
408
|
0
|
|
|
|
|
|
$self->{error}=6; |
|
409
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to open the remove file, "'.$removefile.'"'; |
|
410
|
0
|
|
|
|
|
|
$self->warn; |
|
411
|
0
|
|
|
|
|
|
return undef; |
|
412
|
|
|
|
|
|
|
} |
|
413
|
0
|
|
|
|
|
|
@removelines=<$fh>; |
|
414
|
0
|
|
|
|
|
|
close( $fh ); |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
#chomp each line |
|
417
|
0
|
|
|
|
|
|
my $int=0; |
|
418
|
0
|
|
|
|
|
|
while ( defined( $removelines[$int] ) ){ |
|
419
|
0
|
|
|
|
|
|
chomp( $removelines[$int] ); |
|
420
|
|
|
|
|
|
|
|
|
421
|
0
|
|
|
|
|
|
$int++; |
|
422
|
|
|
|
|
|
|
} |
|
423
|
|
|
|
|
|
|
|
|
424
|
0
|
|
|
|
|
|
return @removelines; |
|
425
|
|
|
|
|
|
|
} |
|
426
|
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=head2 remove |
|
428
|
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
This removes the specified path from the remove list. |
|
430
|
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
Two arguments are taken. The first is the configuration |
|
432
|
|
|
|
|
|
|
directory, which if not specified is automatically choosen. |
|
433
|
|
|
|
|
|
|
The second is the path to remove. |
|
434
|
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
$foo->remove( $configDir, $path ); |
|
436
|
|
|
|
|
|
|
if ( $foo->error ){ |
|
437
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
|
438
|
|
|
|
|
|
|
} |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
=cut |
|
441
|
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
sub remove{ |
|
443
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
|
444
|
0
|
|
|
|
|
|
my $configDir=$_[1]; |
|
445
|
0
|
|
|
|
|
|
my $item=$_[2]; |
|
446
|
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
#blank any previous errors |
|
448
|
0
|
0
|
|
|
|
|
if (!$self->errorblank) { |
|
449
|
0
|
|
|
|
|
|
return undef; |
|
450
|
|
|
|
|
|
|
} |
|
451
|
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
#make sure we have a directory to use |
|
453
|
0
|
0
|
|
|
|
|
if (!defined($configDir)) { |
|
454
|
0
|
|
|
|
|
|
$configDir=$self->{scm}->selectConfigDir; |
|
455
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
456
|
0
|
|
|
|
|
|
$self->{error}=5; |
|
457
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->selectConfigDir errored error="'. |
|
458
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
459
|
0
|
|
|
|
|
|
$self->warn; |
|
460
|
0
|
|
|
|
|
|
return undef; |
|
461
|
|
|
|
|
|
|
} |
|
462
|
|
|
|
|
|
|
} |
|
463
|
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
# make sure something is specified |
|
465
|
0
|
0
|
|
|
|
|
if ( ! defined( $item ) ){ |
|
466
|
0
|
|
|
|
|
|
$self->{error}=3; |
|
467
|
0
|
|
|
|
|
|
$self->{errorString}='No item that should be removed defined'; |
|
468
|
0
|
|
|
|
|
|
$self->warn; |
|
469
|
0
|
|
|
|
|
|
return undef; |
|
470
|
|
|
|
|
|
|
} |
|
471
|
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
# make sure it starts with a / or contain \n |
|
473
|
0
|
0
|
0
|
|
|
|
if ( |
|
474
|
|
|
|
|
|
|
( $item !~ /^\// ) || |
|
475
|
|
|
|
|
|
|
( $item =~ /\n/ ) |
|
476
|
|
|
|
|
|
|
){ |
|
477
|
0
|
|
|
|
|
|
$self->{error}=4; |
|
478
|
0
|
|
|
|
|
|
$self->{errorString}='The path,"'.$item.'", does not appear to be a valid path'; |
|
479
|
0
|
|
|
|
|
|
$self->warn; |
|
480
|
0
|
|
|
|
|
|
return undef; |
|
481
|
|
|
|
|
|
|
} |
|
482
|
|
|
|
|
|
|
|
|
483
|
0
|
|
|
|
|
|
$item=File::Spec->canonpath( $item ); |
|
484
|
|
|
|
|
|
|
|
|
485
|
0
|
|
|
|
|
|
my $exists=$self->exists( $configDir, $item ); |
|
486
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
|
487
|
0
|
|
|
|
|
|
$self->warnString('Failed to check if it already exists'); |
|
488
|
0
|
|
|
|
|
|
return undef; |
|
489
|
|
|
|
|
|
|
} |
|
490
|
0
|
0
|
|
|
|
|
if ( ! $exists ){ |
|
491
|
0
|
|
|
|
|
|
$self->{error}=13; |
|
492
|
0
|
|
|
|
|
|
$self->{errorString}='"'.$item.'" the path does not exist'; |
|
493
|
0
|
|
|
|
|
|
$self->warn; |
|
494
|
0
|
|
|
|
|
|
return undef; |
|
495
|
|
|
|
|
|
|
} |
|
496
|
|
|
|
|
|
|
|
|
497
|
0
|
|
|
|
|
|
my @list=$self->list( $configDir ); |
|
498
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
|
499
|
0
|
|
|
|
|
|
$self->warnString('Failed to fetch the list for "'.$configDir.'"'); |
|
500
|
0
|
|
|
|
|
|
return undef; |
|
501
|
|
|
|
|
|
|
} |
|
502
|
|
|
|
|
|
|
|
|
503
|
0
|
|
|
|
|
|
my @newlist; |
|
504
|
|
|
|
|
|
|
|
|
505
|
0
|
|
|
|
|
|
my $int=0; |
|
506
|
0
|
|
|
|
|
|
while ( defined( $list[$int] ) ){ |
|
507
|
0
|
0
|
|
|
|
|
if ( $list[$int] ne $item ){ |
|
508
|
0
|
|
|
|
|
|
push( @newlist, $list[$int] ); |
|
509
|
|
|
|
|
|
|
} |
|
510
|
|
|
|
|
|
|
|
|
511
|
0
|
|
|
|
|
|
$int++; |
|
512
|
|
|
|
|
|
|
} |
|
513
|
|
|
|
|
|
|
|
|
514
|
0
|
|
|
|
|
|
$self->save( $configDir, \@newlist ); |
|
515
|
0
|
0
|
|
|
|
|
if ( $self->error ){ |
|
516
|
0
|
|
|
|
|
|
$self->warnString( 'Failed to save the list' ); |
|
517
|
0
|
|
|
|
|
|
return undef; |
|
518
|
|
|
|
|
|
|
} |
|
519
|
|
|
|
|
|
|
|
|
520
|
0
|
|
|
|
|
|
return 1; |
|
521
|
|
|
|
|
|
|
} |
|
522
|
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
=head2 save |
|
524
|
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
This replaces the current remove list with another. |
|
526
|
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
Two arguments are taken. The first is the configuration |
|
528
|
|
|
|
|
|
|
directory, which is automatically selected if not specified. |
|
529
|
|
|
|
|
|
|
The second is the list to replace it with. |
|
530
|
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
$foo->save( $configDir, \@removeList ); |
|
532
|
|
|
|
|
|
|
if ( $foo->error ){ |
|
533
|
|
|
|
|
|
|
warn('Error:'.$foo->error.': '.$foo->errorString); |
|
534
|
|
|
|
|
|
|
} |
|
535
|
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
=cut |
|
537
|
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
sub save{ |
|
539
|
0
|
|
|
0
|
1
|
|
my $self=$_[0]; |
|
540
|
0
|
|
|
|
|
|
my $configDir=$_[1]; |
|
541
|
0
|
|
|
|
|
|
my @list; |
|
542
|
0
|
0
|
|
|
|
|
if(defined($_[2])){ |
|
543
|
0
|
|
|
|
|
|
@list= @{$_[2]}; |
|
|
0
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
} |
|
545
|
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
#blank any previous errors |
|
547
|
0
|
0
|
|
|
|
|
if (!$self->errorblank) { |
|
548
|
0
|
|
|
|
|
|
return undef; |
|
549
|
|
|
|
|
|
|
} |
|
550
|
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
#make sure we have a directory to use |
|
552
|
0
|
0
|
|
|
|
|
if (!defined($configDir)) { |
|
553
|
0
|
|
|
|
|
|
$configDir=$self->{scm}->selectConfigDir; |
|
554
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
555
|
0
|
|
|
|
|
|
$self->{error}=5; |
|
556
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->selectConfigDir errored error="'. |
|
557
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
558
|
0
|
|
|
|
|
|
$self->warn; |
|
559
|
0
|
|
|
|
|
|
return undef; |
|
560
|
|
|
|
|
|
|
} |
|
561
|
|
|
|
|
|
|
} |
|
562
|
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
#make sure the config directory is valid |
|
564
|
0
|
|
|
|
|
|
my $valid=$self->{scm}->validConfigDirName($configDir); |
|
565
|
0
|
0
|
|
|
|
|
if ($self->{scm}->error) { |
|
566
|
0
|
|
|
|
|
|
$self->{error}=7; |
|
567
|
0
|
|
|
|
|
|
$self->{errorString}='Sys::Config::Manage->validConfigDirName errored error="'. |
|
568
|
|
|
|
|
|
|
$self->{scm}->error.'" errorString="'.$self->{scm}->errorString.'"'; |
|
569
|
0
|
|
|
|
|
|
$self->warn; |
|
570
|
0
|
|
|
|
|
|
return undef; |
|
571
|
|
|
|
|
|
|
} |
|
572
|
0
|
0
|
|
|
|
|
if (defined( $valid )) { |
|
573
|
0
|
|
|
|
|
|
$self->{error}=8; |
|
574
|
0
|
|
|
|
|
|
$self->{errorString}='The configuration directory name '.$valid; |
|
575
|
0
|
|
|
|
|
|
$self->warn; |
|
576
|
0
|
|
|
|
|
|
return undef; |
|
577
|
|
|
|
|
|
|
} |
|
578
|
|
|
|
|
|
|
|
|
579
|
0
|
|
|
|
|
|
my $towrite=''; |
|
580
|
0
|
|
|
|
|
|
my $int=0; |
|
581
|
0
|
|
|
|
|
|
while( defined( $list[$int] ) ){ |
|
582
|
|
|
|
|
|
|
|
|
583
|
0
|
0
|
0
|
|
|
|
if ( |
|
584
|
|
|
|
|
|
|
($list[$int] !~ /^\// ) || |
|
585
|
|
|
|
|
|
|
( $list[$int] =~ /\n/ ) |
|
586
|
|
|
|
|
|
|
){ |
|
587
|
0
|
|
|
|
|
|
$self->{error}=4; |
|
588
|
0
|
|
|
|
|
|
$self->{errorString}='The path, "'.$list[$int].'", does appear to be valid'; |
|
589
|
0
|
|
|
|
|
|
$self->warn; |
|
590
|
0
|
|
|
|
|
|
return undef; |
|
591
|
|
|
|
|
|
|
} |
|
592
|
0
|
|
|
|
|
|
chomp($list[$int]); |
|
593
|
0
|
|
|
|
|
|
$towrite=$towrite.$list[$int]."\n"; |
|
594
|
|
|
|
|
|
|
|
|
595
|
0
|
|
|
|
|
|
$int++; |
|
596
|
|
|
|
|
|
|
} |
|
597
|
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
#makes sure the directory exists |
|
599
|
0
|
0
|
|
|
|
|
if ( ! -d $self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/' ){ |
|
600
|
0
|
0
|
|
|
|
|
if ( ! mkdir( $self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/' ) ){ |
|
601
|
0
|
|
|
|
|
|
$self->{error}=12; |
|
602
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to create "'.$self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/"'; |
|
603
|
0
|
|
|
|
|
|
$self->warn; |
|
604
|
0
|
|
|
|
|
|
return undef; |
|
605
|
|
|
|
|
|
|
} |
|
606
|
|
|
|
|
|
|
} |
|
607
|
0
|
0
|
|
|
|
|
if ( ! -d $self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/Remove' ){ |
|
608
|
0
|
0
|
|
|
|
|
if ( ! mkdir( $self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/Remove/' ) ){ |
|
609
|
0
|
|
|
|
|
|
$self->{error}=12; |
|
610
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to create "'.$self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/Remove/"'; |
|
611
|
0
|
|
|
|
|
|
$self->warn; |
|
612
|
0
|
|
|
|
|
|
return undef; |
|
613
|
|
|
|
|
|
|
} |
|
614
|
|
|
|
|
|
|
} |
|
615
|
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
#saves it |
|
617
|
0
|
|
|
|
|
|
my $exists=0; |
|
618
|
0
|
|
|
|
|
|
my $removefile=$self->{scm}->{baseDir}.'/'.$configDir.'/.SysConfigManage/Remove/list'; |
|
619
|
0
|
0
|
|
|
|
|
if ( -f $removefile ){ |
|
620
|
0
|
|
|
|
|
|
$exists=1; |
|
621
|
|
|
|
|
|
|
} |
|
622
|
0
|
|
|
|
|
|
my $fh; |
|
623
|
0
|
0
|
|
|
|
|
if ( ! open( $fh, '>', $removefile ) ){ |
|
624
|
0
|
|
|
|
|
|
$self->{error}=6; |
|
625
|
0
|
|
|
|
|
|
$self->{errorString}='Failed to open the remove file, "'.$removefile.'"'; |
|
626
|
0
|
|
|
|
|
|
$self->warn; |
|
627
|
0
|
|
|
|
|
|
return undef; |
|
628
|
|
|
|
|
|
|
} |
|
629
|
0
|
|
|
|
|
|
print $fh $towrite; |
|
630
|
0
|
|
|
|
|
|
close( $fh ); |
|
631
|
|
|
|
|
|
|
|
|
632
|
0
|
0
|
|
|
|
|
if ( ! $exists ){ |
|
633
|
0
|
|
|
|
|
|
my $command=$self->{scm}->getAddCommand; |
|
634
|
|
|
|
|
|
|
|
|
635
|
0
|
0
|
|
|
|
|
if ( defined( $command ) ){ |
|
636
|
0
|
|
|
|
|
|
$removefile=shell_quote($removefile); |
|
637
|
|
|
|
|
|
|
|
|
638
|
0
|
|
|
|
|
|
$command=~s/\%\%\%file\%\%\%/$removefile/g; |
|
639
|
0
|
|
|
|
|
|
system($command); |
|
640
|
0
|
|
|
|
|
|
my $exit = $?<<8; |
|
641
|
0
|
0
|
|
|
|
|
if ($exit ne '0') { |
|
642
|
0
|
|
|
|
|
|
$self->{error}=12; |
|
643
|
0
|
|
|
|
|
|
$self->{errorString}='The add command failed. command="'.$command.'" exit="'.$exit.'"'; |
|
644
|
0
|
|
|
|
|
|
$self->warn; |
|
645
|
0
|
|
|
|
|
|
return undef; |
|
646
|
|
|
|
|
|
|
} |
|
647
|
|
|
|
|
|
|
} |
|
648
|
|
|
|
|
|
|
} |
|
649
|
|
|
|
|
|
|
|
|
650
|
0
|
|
|
|
|
|
return 1; |
|
651
|
|
|
|
|
|
|
} |
|
652
|
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
=head1 ERROR CODES |
|
654
|
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
=head2 1 |
|
656
|
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
Nothing passed for the Sys::Config::Manage object. |
|
658
|
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
=head2 2 |
|
660
|
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
$args{scm} is not a Sys::Config::Manage object. |
|
662
|
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
=head2 3 |
|
664
|
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
No item that should be removed defined. |
|
666
|
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
=head2 4 |
|
668
|
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
The path does not appear to be a valid path. This means it |
|
670
|
|
|
|
|
|
|
does not start with a "/" or contains a newline. |
|
671
|
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
=head2 5 |
|
673
|
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
Sys::Config::Manage->selectConfigDir errored. |
|
675
|
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
=head2 6 |
|
677
|
|
|
|
|
|
|
|
|
678
|
|
|
|
|
|
|
Failed to open the remove file. |
|
679
|
|
|
|
|
|
|
|
|
680
|
|
|
|
|
|
|
=head2 7 |
|
681
|
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
Sys::Config::Manage->validConfigDirName errored. |
|
683
|
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
=head2 8 |
|
685
|
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
Invalid configuration directory name. |
|
687
|
|
|
|
|
|
|
|
|
688
|
|
|
|
|
|
|
=head2 9 |
|
689
|
|
|
|
|
|
|
|
|
690
|
|
|
|
|
|
|
The configuration directory does not exist. |
|
691
|
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
=head2 10 |
|
693
|
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
It already exists. |
|
695
|
|
|
|
|
|
|
|
|
696
|
|
|
|
|
|
|
=head2 11 |
|
697
|
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
Failed to remove a file or path. |
|
699
|
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
=head2 12 |
|
701
|
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
Failed to add the new file. |
|
703
|
|
|
|
|
|
|
|
|
704
|
|
|
|
|
|
|
=head2 13 |
|
705
|
|
|
|
|
|
|
|
|
706
|
|
|
|
|
|
|
The path does not exist. |
|
707
|
|
|
|
|
|
|
|
|
708
|
|
|
|
|
|
|
=head1 AUTHOR |
|
709
|
|
|
|
|
|
|
|
|
710
|
|
|
|
|
|
|
Zane C. Bowers-Hadley, C<< >> |
|
711
|
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
=head1 BUGS |
|
713
|
|
|
|
|
|
|
|
|
714
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
|
715
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
|
716
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
|
717
|
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
=head1 SUPPORT |
|
719
|
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
721
|
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
perldoc Sys::Config::Manage::Perms |
|
723
|
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
|
|
725
|
|
|
|
|
|
|
You can also look for information at: |
|
726
|
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
=over 4 |
|
728
|
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
730
|
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
L |
|
732
|
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
734
|
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
L |
|
736
|
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
738
|
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
L |
|
740
|
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
=item * Search CPAN |
|
742
|
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
L |
|
744
|
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
=back |
|
746
|
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
|
|
748
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
749
|
|
|
|
|
|
|
|
|
750
|
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
752
|
|
|
|
|
|
|
|
|
753
|
|
|
|
|
|
|
Copyright 2011 Zane C. Bowers-Hadley. |
|
754
|
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
756
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
|
757
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
|
758
|
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
|
760
|
|
|
|
|
|
|
|
|
761
|
|
|
|
|
|
|
|
|
762
|
|
|
|
|
|
|
=cut |
|
763
|
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
1; # End of Sys::Config::Manage::Remove |