-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
WIP: Extract EULAs from a .dmg file #8231
Conversation
It does not. Tried it with both mentioned casks on a mostly clean Yosemite VM, right after pulling the latest version of homebrew-cask, followed by a pull of this PR.
The reason that doesn’t strike me as a good idea in practice is
|
@vitorgalvao Thanks a lot! Would you mind doing When you look for something like this: ==> Checking container class Cask::Container::Dmg
==> Executing: ["/usr/bin/hdiutil", "imageinfo", "#<Pathname:/Library/Caches/Homebrew/no-ip-duc-3.2.1.dmg>"]
==> Using container class Cask::Container::Dmg for /Library/Caches/Homebrew/no-ip-duc-3.2.1.dmg What does the output say immediately after those lines? Thanks a lot for your help! |
Sure. I should’ve done it right away, completely forgot about the option; apologies. With ==> Checking container class Cask::Container::Dmg
==> Executing: ["/usr/bin/hdiutil", "imageinfo", "#<Pathname:/Library/Caches/Homebrew/no-ip-duc-3.2.1.dmg>"]
==> Using container class Cask::Container::Dmg for /Library/Caches/Homebrew/no-ip-duc-3.2.1.dmg
==> Executing: ["/bin/launchctl", "bsexec", "/", "/usr/bin/hdiutil", "mount", "-plist", "-nobrowse", "-readonly", "-noidme", "-mountrandom", "/tmp", "#<Pathname:/Library/Caches/Homebrew/no-ip-duc-3.2.1.dmg>"]
Warning: Non-XML stdout from launchctl:
{{Full EULA shows here}} |
Thanks a lot @vitorgalvao!
This is really strange. There should be a lot of output before that line but your log doesn’t show any. I would really love to learn why yours doesn’t. I really need to be more generous with my debug statements :)
Thanks a lot. The EULA dump you’re encountering is unrelated to the PR at hand. It is pre-existing behavior and happens at mount time. What the PR at hand is trying to accomplish is to work with any DMG, mounted or not. |
Like I said I’m doing the tests in a VM, so feel free to ask for any special settings, with complete disregard for what they could break. |
Any progress, @claui? |
Closed in favour of #13593. |
This is a first draft for extracting EULAs from a DMG.
I just wanted to try out the suggestions @phinze proposed and @MattiSG further elaborated in #720.
Please try this out
@federicobond @ndr-qef @phinze @rolandwalker @vitorgalvao
Despite this PR being little more than a proof-of-concept, I’d still love some feedback early on:
Testing
The following Casks are known to have their DMGs carry an EULA.
To help testing, please feel free to add more such Casks to this list.
sketchup
(DMG, 115 MB)no-ip-duc
(DMG, 7 MB)To do
This is just a proof of concept so some more work is needed until this is ready to be reviewed/merged.
The main to-dos are:
Find out whether we can rely on users havingderez
installed; alternatively, rewrite thederez
part in RubyUpdate: Switched to
hdiutil udifderez
which comes with OS X.less
instead of just dumping the EULA; need to figure out how to persuade less that we are in a terminaly
orn
instead ofq
; figure out how to make a custom.lesskey
fileKnown issue: To extract the EULA, I unflatten the DMG but this causes the SHA2 of the DMG to change. Example where this causes subsequent installs to break:Update: Fixed.no-ip-duc
odebug
statementsImplementation notes (WIP)
The implementation introduces two concepts:
eula?
predicate, anddisplay_eula
.This is what
display_eula
does:AppleLocale
setting.