forked from KohaSuomi/Koha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkoha_debian_packages.pl
executable file
·48 lines (35 loc) · 1.12 KB
/
koha_debian_packages.pl
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
#!/usr/bin/perl
use Modern::Perl;
use open qw( :std :encoding(UTF-8) );
binmode( STDOUT, ":encoding(UTF-8)" );
use Getopt::Long;
use C4::KohaSuomi::DebianPackages;
my $help;
my $install;
GetOptions(
'h|help' => \$help,
'i|install' => \$install
);
my $usage = << 'ENDUSAGE';
SYNOPSIS:
This script returns all the debian packages Koha needs in a nice list.
All packages which are not core-Koha are excluded.
Such as apache2, idzebra2, mysql-*, memcached.
These are intended to be installed in separate servers or by using specific Ansible roles
or script can be used to install them to current server with sudo and option -i or -install.
ENDUSAGE
if ($help) {
print $usage;
exit;
}
my $packageNames = C4::KohaSuomi::DebianPackages::getKohaSuomiDebianPackageNames();
if ($install) {
foreach my $package (@$packageNames) {
my $cmd = "/usr/bin/apt-get install $package";
my $output = system($cmd);
print "$output\n";
print "--------------------------------------------------------------------------------------------------------\n";
}
} else {
print join("\n", @$packageNames);
}