Skip to content
Snippets Groups Projects
Commit ebd67c0f authored by Alexander König's avatar Alexander König
Browse files

removed adapt_tos.pl. It belongs into the proper CLARIN DSpace repo

parent bd2f05e6
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl
use Modern::Perl '2015';
my $tosfile = '/opt/repository/sources/dspace/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/terms-of-service.html';
my $outfile = '/opt/repository/sources/dspace/dspace-xmlui/src/main/webapp/themes/UFAL/lib/html/terms-of-service.html.new';
my $locpropfile = '/opt/repository/sources/dspace/local.properties';
my ($repo_name,$centre_legal_entity,$full_address,$country,$city);
open (my $tos, '<', $tosfile);
open (my $out, '>', $outfile);
open (my $lp, '<', $locpropfile);
while (my $in = <$lp>)
{
if ($in =~ /^dspace\.name/)
{
(undef,$repo_name) = split /=/, $in;
chomp $repo_name;
$repo_name =~ s/^\s//;
}
elsif ($in =~ /^lr.description.institution /)
{
(undef,$centre_legal_entity) = split /=/, $in;
chomp $centre_legal_entity;
$centre_legal_entity =~ s/^\s//;
}
elsif ($in =~ /^lr.description.location/)
{
(undef,$full_address) = split /=/, $in;
chomp $full_address;
$full_address =~ s/^\s//;
}
elsif ($in =~ /^lr.description.shortLocation/)
{
(undef,my $location) = split /=/, $in;
chomp $location;
($city,$country) = split /,/, $location;
$city =~ s/^\s//;
$country =~ s/^\s//;
}
}
while (my $line = <$tos>)
{
if ($line =~ /REPOSITORY_NAME/)
{
$line =~ s/\$REPOSITORY_NAME/$repo_name/;
}
if ($line =~ /A_CENTRE_OR_UNIT_WITH_LEGAL_PERSONALITY/)
{
$line =~ s/\$A_CENTRE_OR_UNIT_WITH_LEGAL_PERSONALITY/$centre_legal_entity/;
}
if ($line =~ /FULL_ADDRESS/)
{
$line =~ s/\$FULL_ADDRESS/$full_address/;
}
if ($line =~ /COUNTRY/)
{
$line =~ s/\$COUNTRY/$country/;
}
if ($line =~ /CITY/)
{
$line =~ s/\$CITY/$city/;
}
print $out $line;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment