[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libreoffice-language-pack: install manually #52893

Merged
merged 4 commits into from
Oct 9, 2018
Merged

libreoffice-language-pack: install manually #52893

merged 4 commits into from
Oct 9, 2018

Conversation

amyspark
Copy link
Contributor
@amyspark amyspark commented Oct 5, 2018

After making all changes to the cask:

  • brew cask audit --download {{cask_file}} is error-free.
  • brew cask style --fix {{cask_file}} reports no offenses.
  • The commit message includes the cask’s name and version.
  • The submission is for a stable version or documented exception.

Additionally, if adding a new cask:

--

LibreOffice Language Pack, when manually executed, runs LibreOffice at least once (using AppleScript) before inserting the language files. This is to trigger Gatekeeper and thus cheat the code signature assessment.

This pull request adds this step to the preflight block. changes this Cask to manual installation.

Fixes #52758 , fixes #52883 .

(source for the fix: Contents/osx_install.applescript inside the Cask's DMG)

Copy link
Member
@vitorgalvao vitorgalvao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets just add the caveat. Adding the AppleScript is too much, and HBC should never trigger GUIs, especially one as taxing as LibreOffice.

@amyspark
Copy link
Contributor Author
amyspark commented Oct 5, 2018

I understand @vitorgalvao. But since this step is essential for LibreOffice to work out of the box (TDF even adds it in their own executable), I'd like to get a consensus on this.
Pinging @Homebrew/cask.

@amyspark amyspark added the awaiting maintainer feedback Issue needs response from a maintainer. label Oct 5, 2018
@vitorgalvao
Copy link
Member

I’d rather remove the auto-installation (which is a non-standard hacky method anyway) and change the cask to installer :manual.

@commitay
Copy link
Contributor
commitay commented Oct 5, 2018

Adding the AppleScript is too much

👍

and HBC should never trigger GUIs

👍

I’d rather remove the auto-installation (which is a non-standard hacky method anyway) and change the cask to installer :manual.

👍

@tiiiecherle
Copy link
Contributor

I know you guys come across a lot of issues and have standards to solve them, but just from a user and automation point of view adding the applescript seems the best way to implement. As using the homebrew-cask install one of the most things I love about it is the automation. And if there is a way to do the install automatically without breaking downsides I (and I guess other users) would love to see a most effortless install as possible. For me as an example I would have to explain to everyone in the office what to do and why instead of just installing the cask.

Would be nice to have see the most automated version possible. Thanks a lot for all your work. I really do like this project. Have a nice weekend together ;)

@vitorgalvao
Copy link
Member

but just from a user and automation point of view adding the applescript seems the best way to implement.

Unfortunately, that doesn’t consider the users who don’t want a GUI to spring up when installing, especially one that’s slow like LibreOffice.

@tiiiecherle
Copy link
Contributor

I am pretty sure there is no "real" popup of a window when install the language pack manually. I will try and report back in a few minutes...

@tiiiecherle
Copy link
Contributor

I just downloaded the latest libreoffice and language pack from the offical website. Then I dragged the LibreOffice.app to /Applications/LibreOffice.app and unmounted the .dmg.
Afterwards I mounted the Language Pack installer and double clicked it. You are right, LibreOffice opens, but only for a very short time, not really noticable and is quit really fast before showing the startup gui. Then then langpack installs and reports success.

The only thing is that libreoffice asks for permission to open on first launch due to gatekeeper. This could be avoided by exporting the quarantine data, deleting the xattr, open Libreoffice and reimport the quarantine afterwards like this:

xattr -p com.apple.quarantine "/Applications/LibreOffice.app" > /tmp/quarantine_libreoffice.xattr
xattr -d com.apple.quarantine "/Applications/LibreOffice.app"
INSTALL LANGUAGE PACK HERE
xattr -w com.apple.quarantine `cat "/tmp/quarantine_libreoffice.xattr"` "/Applications/LibreOffice.app"

@tiiiecherle
Copy link
Contributor
tiiiecherle commented Oct 6, 2018

I tried that, unfortunately restoring the com.apple.quarantine xattr does seem to break libreoffice again after the process completes. So it would still be possible with the applescriop, the only thing a user would have to do is hit one button to allow libreoffice to be opened, the rest could be automated without long waiting and without seeing any libreoffice gui.

@amyspark
Copy link
Contributor Author
amyspark commented Oct 6, 2018

I tried that, unfortunately restoring the com.apple.quarantine xattr does seem to break libreoffice again after the process completes. So it would still be possible with the applescriop, the only thing a user would have to do is hit one button to allow libreoffice to be opened, the rest could be automated without long waiting and without seeing any libreoffice gui.

What you actually want is to toggle the "opened" bit in com.apple.quarantine - but doing that without updating the security policy database is... prone to errors 😉

@amyspark
Copy link
Contributor Author
amyspark commented Oct 6, 2018

@vitorgalvao - just in case, please remember that the AppleScript automatically closes the app, it doesn't leave it open. I also shortened its timeout -15 sec- to ensure that this step doesn't delay unreasonably the rest of the process.

If there's no further comment, I'll proceed with installer: manual.

Gatekeeper requires LibreOffice to be run at least once before injecting
the language resources; otherwise, it will trip the digital signature
checks and reject the app.
@amyspark amyspark changed the title libreoffice-language-pack: open LibreOffice once libreoffice-language-pack: install manually Oct 7, 2018
@commitay
Copy link
Contributor
commitay commented Oct 7, 2018
audit for libreoffice-language-pack: warning
 - installer and pkg stanzas require an uninstall stanza

Need to add a fake uninstall to make audit happy.

uninstall delete: "#{staged_path}/#{token}" # Not actually necessary, since it would be deleted anyway. It is present to make clear an uninstall was not forgotten and that for this cask it is indeed this simple.

@vitorgalvao vitorgalvao merged commit df53dbe into Homebrew:master Oct 9, 2018
@amyspark amyspark deleted the libreoffice-preflight branch October 10, 2018 00:49
@amyspark amyspark removed the awaiting maintainer feedback Issue needs response from a maintainer. label Oct 10, 2018
@lock lock bot locked and limited conversation to collaborators Nov 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libreoffice can not be opened after install
4 participants