Last change
on this file since 29546 was 29546, checked in by Jeremy Symon, 9 years ago |
Arch package now automatically sets the owner of the web directory to the tomcat user. The functionality is also implemented for the other package managers, but not yet tested.
|
File size:
981 bytes
|
Line | |
---|
1 | package Greenstone::Package::_apt;
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 | use warnings;
|
---|
5 | use utf8;
|
---|
6 | use parent 'Greenstone::Package';
|
---|
7 |
|
---|
8 | sub replacement_array {
|
---|
9 | my $self = shift;
|
---|
10 | my $array = shift;
|
---|
11 | return join ", ", @{$array};
|
---|
12 | }
|
---|
13 |
|
---|
14 | sub write_function {
|
---|
15 | my ($self, $name, @lines) = @_;
|
---|
16 | open OUT, '>', "/tmp/$name";
|
---|
17 | for my $line (@lines) {
|
---|
18 | print OUT $line, "\n";
|
---|
19 | }
|
---|
20 | close OUT;
|
---|
21 | $self->add ("/tmp/$name", "$self->{output}/$name");
|
---|
22 | }
|
---|
23 |
|
---|
24 | sub add_install {
|
---|
25 | my $self = shift;
|
---|
26 | exists $self->{config}->{PRE_INSTALL} and
|
---|
27 | $self->write_function ("preinst", @{$self->{config}->{PRE_INSTALL}});
|
---|
28 | exists $self->{config}->{POST_INSTALL} and
|
---|
29 | $self->write_function ("postinst", @{$self->{config}->{POST_INSTALL}});
|
---|
30 | exists $self->{config}->{PRE_REMOVE} and
|
---|
31 | $self->write_function ("prerm", @{$self->{config}->{PRE_REMOVE}});
|
---|
32 | exists $self->{config}->{POST_REMOVE} and
|
---|
33 | $self->write_function ("postrm", @{$self->{config}->{POST_REMOVE}});
|
---|
34 | }
|
---|
35 |
|
---|
36 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.