tdf#133511 adjust langpack script for removal of CFBundleGetInfoString

3a02841819 removed the string from
Info.plist, but the languagepack install script tried to use that to
make sure whatever the user selects/is found is from the dame type (dev
vs release and codeline/version). Instead of doing multiple
greps/multiline ones (there are multiple version strings in that file,
only one being from LO itself…) use mdls instead to pick the interesting
properties to build a "PRODUCTNAME FULLVERSION" string again we can
match against. --raw switch is nul separated, so add additional xargs -0
in there instead of trying to match a nul with grep
(without --raw it is a nice human readable multiline string)

Change-Id: I049a8425709a0c41b61aa09452490b481d39e4d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96439
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Christian Lohmaier 2020-06-16 11:02:39 +02:00
parent 408f2a1c09
commit 7708b3f2d6

View file

@ -126,7 +126,7 @@ end if
-- now only check whether the path is really from [PRODUCTNAME]
try
do shell script "grep '<string>[PRODUCTNAME] [PRODUCTVERSION]' " & quoted form of (choice as string) & "/Contents/Info.plist"
do shell script "mdls --raw --name kMDItemDisplayName --name kMDItemVersion " & quoted form of (choice as string) & " | xargs -0 | fgrep '[PRODUCTNAME] [PRODUCTVERSION]'"
on error
display dialog (choice as string) & appInvalid buttons {InstallLabel} default button 1 with icon 0
return 3 --wrong target-directory