scriptitems.pm (dba1a2e4) scriptitems.pm (1ba1fd99)
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

--- 2603 unchanged lines hidden (view full) ---

2612sub build_modulegids_table ($$)
2613{
2614 my ($modulesref, $itemname) = @_;
2615
2616 my %module_lookup_table = ();
2617
2618 # build map of item names to list of respective module gids
2619 # containing these items
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

--- 2603 unchanged lines hidden (view full) ---

2612sub build_modulegids_table ($$)
2613{
2614 my ($modulesref, $itemname) = @_;
2615
2616 my %module_lookup_table = ();
2617
2618 # build map of item names to list of respective module gids
2619 # containing these items
2620 foreach my $onemodule (@{$modulesref})
2620 foreach my $onemodule (@$modulesref)
2621 {
2622 next if ! defined $onemodule->{$itemname};
2621 {
2622 next if ! defined $onemodule->{$itemname};
2623
2623 # these are the items contained in this module
2624 # eg. Files = (gid_a_b_c,gid_d_e_f)
2625 my $module_gids = $onemodule->{$itemname};
2626
2627 # prune outer brackets
2628 $module_gids =~ s|^\s*\(||g;
2629 $module_gids =~ s|\)\s*$||g;
2630 for my $id (split (/,/, $module_gids))

--- 13 unchanged lines hidden (view full) ---

2644
2645sub get_string_of_modulegids_for_itemgid ($$)
2646{
2647 my ($module_lookup_table, $itemgid) = @_;
2648
2649 my $haslanguagemodule = 0;
2650 my %foundmodules = ();
2651
2624 # these are the items contained in this module
2625 # eg. Files = (gid_a_b_c,gid_d_e_f)
2626 my $module_gids = $onemodule->{$itemname};
2627
2628 # prune outer brackets
2629 $module_gids =~ s|^\s*\(||g;
2630 $module_gids =~ s|\)\s*$||g;
2631 for my $id (split (/,/, $module_gids))

--- 13 unchanged lines hidden (view full) ---

2645
2646sub get_string_of_modulegids_for_itemgid ($$)
2647{
2648 my ($module_lookup_table, $itemgid) = @_;
2649
2650 my $haslanguagemodule = 0;
2651 my %foundmodules = ();
2652
2652 # print STDERR "lookup '" . lc($itemgid) . "'\n";
2653 my $gid_list = $module_lookup_table->{lc($itemgid)};
2654
2653 my $gid_list = $module_lookup_table->{lc($itemgid)};
2654
2655 foreach my $gid (@{$gid_list})
2655 foreach my $gid (@$gid_list)
2656 {
2657 $foundmodules{$gid} = 1;
2658 # Is this module a language module? This info should be stored at the file.
2659 if ( exists($installer::globals::alllangmodules{$gid}) )
2660 {
2661 $haslanguagemodule = 1;
2662 }
2663 }

--- 5 unchanged lines hidden (view full) ---

2669 {
2670 my $isreallylanguagemodule = installer::worker::key_in_a_is_also_key_in_b(
2671 \%foundmodules,
2672 \%installer::globals::alllangmodules);
2673 if ( ! $isreallylanguagemodule )
2674 {
2675 installer::exiter::exit_program(
2676 sprintf(
2656 {
2657 $foundmodules{$gid} = 1;
2658 # Is this module a language module? This info should be stored at the file.
2659 if ( exists($installer::globals::alllangmodules{$gid}) )
2660 {
2661 $haslanguagemodule = 1;
2662 }
2663 }

--- 5 unchanged lines hidden (view full) ---

2669 {
2670 my $isreallylanguagemodule = installer::worker::key_in_a_is_also_key_in_b(
2671 \%foundmodules,
2672 \%installer::globals::alllangmodules);
2673 if ( ! $isreallylanguagemodule )
2674 {
2675 installer::exiter::exit_program(
2676 sprintf(
2677 "ERROR: \"\" is assigned to modules with flag "
2678 . "\"LANGUAGEMODULE\" and also to modules without this flag! Modules: %s",
2677 "ERROR: \"%s\" is assigned to modules with flag "
2678 ."\"LANGUAGEMODULE\" and also to modules without this flag! Modules: %s",
2679 $itemgid,
2680 $allmodules),
2681 "get_string_of_modulegids_for_itemgid");
2682 }
2683 }
2684
2685 return ($allmodules, $haslanguagemodule);
2686}

--- 423 unchanged lines hidden ---
2679 $itemgid,
2680 $allmodules),
2681 "get_string_of_modulegids_for_itemgid");
2682 }
2683 }
2684
2685 return ($allmodules, $haslanguagemodule);
2686}

--- 423 unchanged lines hidden ---