ExtensionsLst.pm (c0bb9ecc) | ExtensionsLst.pm (764319a5) |
---|---|
1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance --- 53 unchanged lines hidden (view full) --- 62 The content of the extensions.lst file is ignored when the --with-extensions option is given to configure. 63 64=cut 65 66 67# Number of the line in extensions.lst that is currently being processed. 68my $LineNo = 0; 69 | 1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance --- 53 unchanged lines hidden (view full) --- 62 The content of the extensions.lst file is ignored when the --with-extensions option is given to configure. 63 64=cut 65 66 67# Number of the line in extensions.lst that is currently being processed. 68my $LineNo = 0; 69 |
70# Set to 1 to get a more verbose output, the default is 0. 71my $Debug = 0; |
|
70 | 72 |
73 |
|
71=head3 Prepare 72 Check that some environment variables are properly set and then return the file name 73 of the 'extensions.lst' file, typically located in main/ beside 'ooo.lst'. 74=cut 75sub Prepare () 76{ 77 die "can not access environment varianle SRC_ROOT" if ! defined $ENV{'SRC_ROOT'}; 78 die "can not determine the platform: INPATH is not set" if ! defined $ENV{'INPATH'}; --- 409 unchanged lines hidden (view full) --- 488 { 489 my $file_md5 = $md5->hexdigest(); 490 if ($md5sum eq $file_md5) 491 { 492 print "md5 is OK\n"; 493 } 494 else 495 { | 74=head3 Prepare 75 Check that some environment variables are properly set and then return the file name 76 of the 'extensions.lst' file, typically located in main/ beside 'ooo.lst'. 77=cut 78sub Prepare () 79{ 80 die "can not access environment varianle SRC_ROOT" if ! defined $ENV{'SRC_ROOT'}; 81 die "can not determine the platform: INPATH is not set" if ! defined $ENV{'INPATH'}; --- 409 unchanged lines hidden (view full) --- 491 { 492 my $file_md5 = $md5->hexdigest(); 493 if ($md5sum eq $file_md5) 494 { 495 print "md5 is OK\n"; 496 } 497 else 498 { |
496 unlink($temporary_filename); | 499 unlink($temporary_filename) if ! $Debug; |
497 die "downloaded file has the wrong md5 checksum: $file_md5 instead of $md5sum"; 498 } 499 } 500 else 501 { 502 print "md5 is not present\n"; 503 printf " is %s, length is %d\n", $md5sum, length(md5sum); 504 } --- 11 unchanged lines hidden (view full) --- 516 517 518=head3 DownloadExtensions 519 This function is intended to be called during bootstrapping. It extracts the set of extensions 520 that will be used later, when the installation sets are built. 521=cut 522sub DownloadExtensions () 523{ | 500 die "downloaded file has the wrong md5 checksum: $file_md5 instead of $md5sum"; 501 } 502 } 503 else 504 { 505 print "md5 is not present\n"; 506 printf " is %s, length is %d\n", $md5sum, length(md5sum); 507 } --- 11 unchanged lines hidden (view full) --- 519 520 521=head3 DownloadExtensions 522 This function is intended to be called during bootstrapping. It extracts the set of extensions 523 that will be used later, when the installation sets are built. 524=cut 525sub DownloadExtensions () 526{ |
524 my $full_file_name = Prepare(); 525 my @urls = ParseExtensionsLst($full_file_name, []); 526 Download(@urls); | 527 if (defined $ENV{'ENABLE_BUNDLED_DICTIONARIES'} 528 && $ENV{'ENABLE_BUNDLED_DICTIONARIES'} eq "YES") 529 { 530 my $full_file_name = Prepare(); 531 my @urls = ParseExtensionsLst($full_file_name, []); 532 Download(@urls); 533 } 534 else 535 { 536 print "bundling of dictionaries is disabled.\n"; 537 } |
527} 528 529 530 531 532=head3 GetExtensionList 533 This function is intended to be called when installation sets are built. 534 It expects two arguments: --- 8 unchanged lines hidden (view full) --- 543 - A set of languages. This set determines which extensions 544 are returned and then included in an installation set. 545=cut 546sub GetExtensionList ($@) 547{ 548 my $protocol_selector = shift; 549 my @language_list = @_; 550 | 538} 539 540 541 542 543=head3 GetExtensionList 544 This function is intended to be called when installation sets are built. 545 It expects two arguments: --- 8 unchanged lines hidden (view full) --- 554 - A set of languages. This set determines which extensions 555 are returned and then included in an installation set. 556=cut 557sub GetExtensionList ($@) 558{ 559 my $protocol_selector = shift; 560 my @language_list = @_; 561 |
551 my $full_file_name = Prepare(); 552 my @urls = ParseExtensionsLst($full_file_name, \@language_list); 553 554 my @result = (); 555 for my $entry (@urls) | 562 if (defined $ENV{'ENABLE_BUNDLED_DICTIONARIES'} 563 && $ENV{'ENABLE_BUNDLED_DICTIONARIES'} eq "YES") |
556 { | 564 { |
557 my ($protocol, $name, $URL, $md5sum) = @{$entry}; 558 if ($protocol =~ /^$protocol_selector$/) | 565 my $full_file_name = Prepare(); 566 my @urls = ParseExtensionsLst($full_file_name, \@language_list); 567 568 my @result = (); 569 for my $entry (@urls) |
559 { | 570 { |
560 push @result, $name; | 571 my ($protocol, $name, $URL, $md5sum) = @{$entry}; 572 if ($protocol =~ /^$protocol_selector$/) 573 { 574 push @result, $name; 575 } |
561 } | 576 } |
562 } | |
563 | 577 |
564 return @result; | 578 return @result; 579 } 580 else 581 { 582 # Bundling of dictionaires is disabled. 583 } |
565} 566 567 5681; | 584} 585 586 5871; |