Kaydet (Commit) fbcdca2b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 6aa9d41a
......@@ -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);
......
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment