This repository was archived by the owner on Apr 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDidbsPatcher.pm
More file actions
53 lines (42 loc) · 1.27 KB
/
DidbsPatcher.pm
File metadata and controls
53 lines (42 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package DidbsPatcher;
use DidbsUtils;
use File::Copy qw/cp/;
sub new
{
my $self = bless {}, shift;
my $scriptLocation = shift;
my $packageDefsDir = shift;
my $packageId = shift;
my $packageDir = shift;
my $buildDir = shift;
my $didbsPackage = shift;
my $didbsExtractor = shift;
$self->{scriptLocation} = $scriptLocation;
$self->{packageDefsDir} = $packageDefsDir;
$self->{packageId} = $packageId;
$self->{packageDir} = $packageDir;
$self->{buildDir} = $buildDir;
$self->{didbsPackage} = $didbsPackage;
$self->{didbsExtractor} = $didbsExtractor;
return $self;
}
sub patchit
{
my $self = shift;
my $sl = $self->{scriptLocation};
my $patchfn = $self->{didbsPackage}->{packagePatch};
my $fullpathpatch = "$self->{packageDefsDir}/$self->{packageId}/$patchfn";
my $patchdest = "$self->{buildDir}/$self->{packageId}";
didbsprint "Copying patch file $fullpathpatch to $patchdest\n";
cp($fullpathpatch,$patchdest) || die $!;
my $patchcmd = "$sl/scripts/patchhelper.sh $patchdest $patchfn";
didbsprint "patch command is $patchcmd\n";
system($patchcmd) == 0 || die $!;
return 1;
}
sub debug
{
my $self = shift;
didbsprint "DidbsPatcher constructed for $self->{packageId}\n";
}
1;