Ignore:
Timestamp:
2014-12-08T12:19:58+13:00 (9 years ago)
Author:
Jeremy Symon
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/package-kits/linux/perllib/Greenstone/Config.pm

    r29536 r29546  
    44use warnings;
    55use utf8;
     6use Greenstone::Helpers;
    67
    78# Formats an array
     
    3132}
    3233
     34# Reads a config file into the config hashmap
     35sub readconf {
     36    my ($self, $conf) = @_;
     37    $self->{config} = {} unless exists $self->{config};
     38    open CONF, '<', $conf
     39        or die "Failed to open '$conf' for reading: $!";
     40    my $var;
     41    while (my $line = <CONF>) {
     42        if (empty $line or comment $line) {
     43            $var = undef;
     44        } elsif (defined $var and $line =~ /^\s/) {
     45            trim $line;
     46            $self->subst ($line);
     47            escape $line;
     48            push @{$self->{config}->{$var}}, $line;
     49        } else {
     50            ($var, my $val) = trim (split ":", $line, 2);
     51            defined $var and defined $val or die "Invalid variable assignment: '$line'";
     52            if (empty $val) {
     53                $self->{config}->{$var} = [];
     54            } else {
     55                $self->subst ($val);
     56                escape $val;
     57                $self->{config}->{$var} = $val;
     58            }
     59        }
     60    }
     61    close CONF;
     62}
     63
    33641;
Note: See TracChangeset for help on using the changeset viewer.