1 |
joko |
1.1 |
package ConfigPatcher::Main; |
2 |
|
|
|
3 |
|
|
require Exporter; |
4 |
|
|
@ISA = qw(Exporter); |
5 |
|
|
|
6 |
|
|
@EXPORT = qw(applyPatches); |
7 |
|
|
|
8 |
|
|
use strict; |
9 |
|
|
use warnings; |
10 |
|
|
|
11 |
|
|
use ConfigPatcher::Config; |
12 |
|
|
#use ConfigPatcher::Handlers; |
13 |
|
|
our %cfg_patcher; |
14 |
|
|
|
15 |
|
|
sub applyPatches { |
16 |
|
|
my $patchfile = shift; |
17 |
|
|
my $patchTarget = shift; |
18 |
|
|
ConfigPatcher::Config::readConfig($patchfile); |
19 |
|
|
|
20 |
|
|
my @files = keys %cfg_patcher; |
21 |
|
|
foreach my $file (@files) { |
22 |
|
|
my $handler = $cfg_patcher{$file}; |
23 |
|
|
print "patching file \"$file\"", "\n"; |
24 |
|
|
|
25 |
|
|
#$eval = "ConfigPatcher::Handlers::handler($file);"; |
26 |
|
|
#eval { $eval; } |
27 |
|
|
|
28 |
|
|
$eval = "ConfigPatcher::Handlers::handler($file);"; |
29 |
|
|
eval { $eval; } |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
} |
33 |
|
|
|
34 |
|
|
1; |
35 |
|
|
|