This repository has been 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
/
Copy pathDidbsPackageShell.pm
91 lines (78 loc) · 2.52 KB
/
DidbsPackageShell.pm
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package DidbsPackageShell;
use DidbsUtils;
sub new
{
my $self = bless {}, shift;
my $scriptLocation = shift;
my $packageDefsDir = shift;
my $packageId = shift;
my $packageDir = shift;
my $buildDir = shift;
my $installDir = shift;
my $didbsPackage = shift;
$self->{scriptLocation} = $scriptLocation;
$self->{packageDefsDir} = $packageDefsDir;
$self->{packageId} = $packageId;
$self->{packageDir} = $packageDir;
$self->{buildDir} = $buildDir;
$self->{installDir} = $installDir;
$self->{didbsPackage} = $didbsPackage;
return $self;
}
sub debug
{
my $self = shift;
didbsprint "DidbsPackageShell constructed for $self->{packageId}\n";
didbsprint "scriptLocation $self->{scriptLocation}\n";
didbsprint "packageDefsDir $self->{packageDefsDir}\n";
didbsprint "packageId $self->{packageId}\n";
didbsprint "packageDir $self->{packageDir}\n";
didbsprint "buildDir $self->{buildDir}\n";
didbsprint "installDir $self->{installDir}\n";
didbsprint "didbsPackage $self->{didbsPackage}\n";
}
sub startshell
{
my $self = shift;
my $packageId = $self->{packageId};
didbsprint "Package shell for $packageId\n";
my $scriptLocation = $self->{scriptLocation};
my $packageId = $self->{packageId};
my $packageDirRoot = $self->{packageDir};
my $didbsPackageDir = ${$self->{didbsPackage}}->{packageDir};
my $packageDefsDir = $self->{packageDefsDir};
my $packageDir = $packageDefsDir . "/" . $packageId;
my $builddir = $self->{buildDir};
my $packageBuildDir =
$builddir .
"/" .
$packageId .
"/" .
$didbsPackageDir;
my $installdir = $self->{installDir};
my $envmodifs = $packageDir . "/" .
${$self->{didbsPackage}}->{envModifs};
didbsprint "scriptLocation is $scriptLocation\n";
didbsprint "packageId is $packageId\n";
didbsprint "packageDir is $packageDir\n";
didbsprint "packageBuildDir is $packageBuildDir\n";
didbsprint "didbsPackageDir is $didbsPackageDir\n";
didbsprint "builddir is $builddir\n";
didbsprint "installdir is $installdir\n";
# Need
# script path
# root of didbs (scriptLocation)
# packageID
# path to dibs package config
# path to root of package build
# install path
my $cmd = "$scriptLocation/scripts/buildshell.sh $scriptLocation $packageId $packageDir $packageBuildDir $installdir $envmodifs";
# didbsprint "About to execute $cmd\n";
if( system($cmd) != 0 )
{
didbsprint "Failed during shell invocation: $!\n";
die $!;
}
return 1;
}
1;