Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi Alexander, *,

On Thu, Aug 29, 2013 at 12:30 PM, Alexander Thurgood
<alex.thurgood@gmail.com> wrote:
Hi all,

Is it intended that for 4.1 the applescript installer now scans every
file on the whole disk looking for the strings equal to 'LibreOffice*'
and not equal to 'LibreOffice Language Pack.app' ?

No - and it doesn't do that.

set the found_ooos_all to (do shell script "mdfind \"kMDItemContentType
== 'com.apple.application-bundle' && kMDItemDisplayName ==
'LibreOffice*' && kMDItemDisplayName != 'LibreOffice Language
Pack.app'\"") & "
" & chooseMyOwn

mdfind is the commandline tool for spotlight, that should use the
spotlight db only, not do a full manual scan, just as the "locate"
command on linux would do.

whereas the 4.0.5 langpack contains :

set found_ooos_all to ""
-- command might return an error if spotlight is disabled completely
try
        set found_ooos_all to (do shell script "mdfind \"kMDItemContentType ==
'com.apple.application-bundle' && kMDItemDisplayName == 'LibreOffice*'
&& kMDItemDisplayName != 'LibreOffice Language Pack.app'\"")
end try
set found_ooos_all to found_ooos_all & "
" & chooseMyOwn

That is just an additional "try .. end try" around that call to not
abort the whole installation script just because the mdfind command
cannot be executed, for example when spotlight is disabled.
Without that try, the script would just terminate, and not allow the
user to install the langaugepack.

If I run, from the terminal :

mdfind kMDItemContentType == 'com.apple.application-bundle' && mdfind
kMDItemDisplayName == 'LibreOffice*' && mdfind kMDItemDisplayName !=
'LibreOffice Language Pack.app'

it takes about 30 mins to finish.

Well - as the command has been the same for years, then something in
your spotlight configuration did change. Maybe there is a setting to
always have it do a full scan instead of using the cache.

But your command also is not equivalent to the command used by the
script. You run mdfind multiple times with different search strings,
while the script runs mdfind once with multiple search strings.

mdfind "kMDItemContentType == 'com.apple.application-bundle' &&
kMDItemDisplayName == 'LibreOffice*' && kMDItemDisplayName !=
'LibreOffice Language Pack.app'"

is what the script runs. And that should be pretty fast.

ciao
Christian

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.