solenv/bin/modules/installer.pm             |    1 +
 solenv/bin/modules/installer/scriptitems.pm |   10 ++++++++++
 2 files changed, 11 insertions(+)

New commits:
commit fbcdca2becb4eee0825697efffba14b5796ade6d
Author: Stephan Bergmann <[email protected]>
Date:   Sun Mar 19 20:04:40 2017 +0100

    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

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
     }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to