diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-03-19 20:04:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-03-19 20:04:40 +0100 |
commit | fbcdca2becb4eee0825697efffba14b5796ade6d (patch) | |
tree | 88a0299380c9c72589e0990f1020930b50f40637 /solenv/bin | |
parent | 6aa9d41a0d0c45346cfe84cf903057d812815c20 (diff) |
tdf#87075: Filter out unused directories from FILELISTs
...so that on macOS dictionary extensions don't pollute LibreOffice.app's
Contents/Resources/extensions/ with empty directories (that would then show up
as phantom extenions in the Extension Manager).
Change-Id: Iacff73e931885cde0fe507e384de80e9bd38d475
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/modules/installer.pm | 1 | ||||
-rw-r--r-- | solenv/bin/modules/installer/scriptitems.pm | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index 1acac03e43c6..a29beb09efb2 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -790,6 +790,7 @@ sub run { $modulesinproductlanguageresolvedarrayref = installer::scriptitems::remove_not_required_spellcheckerlanguage_modules($modulesinproductlanguageresolvedarrayref); $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_not_required_spellcheckerlanguage_files($filesinproductlanguageresolvedarrayref); + $directoriesforepmarrayref = installer::scriptitems::remove_not_required_spellcheckerlanguage_files($directoriesforepmarrayref); } installer::scriptitems::changing_name_of_language_dependent_keys($modulesinproductlanguageresolvedarrayref); diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm index 5f8dfd698d5f..1b8922dfa21c 100644 --- a/solenv/bin/modules/installer/scriptitems.pm +++ b/solenv/bin/modules/installer/scriptitems.pm @@ -1595,6 +1595,7 @@ sub collect_directories_from_filesarray $directoryhash{'specificlanguage'} = $onefile->{'specificlanguage'}; $directoryhash{'Dir'} = $onefile->{'Dir'}; $directoryhash{'modules'} = $onefile->{'modules'}; # NEW, saving modules + $directoryhash{'gid'} = $onefile->{'gid'}; $predefinedprogdir_added ||= $onefile->{'Dir'} eq "PREDEFINED_PROGDIR"; @@ -1604,6 +1605,15 @@ sub collect_directories_from_filesarray { # Adding the modules to the module list! $alldirectoryhash{$destinationpath}->{'modules'} .= "," . $onefile->{'modules'}; + # Save file's gid iff this directory appears in only a single + # file's FILELIST (so that unused directories will be filtered + # out in remove_not_required_spellcheckerlanguage_files, based + # on gid): + if ($alldirectoryhash{$destinationpath}->{'gid'} + ne $onefile->{'gid'}) + { + $alldirectoryhash{$destinationpath}->{'gid'} = ''; + } } } while ($destinationpath =~ s/(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/$1/); # as long as the path contains slashes } |