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

lulu.rb: backup and restore settings #56218

Closed
wants to merge 6 commits into from
Closed

Conversation

vitorgalvao
Copy link
Member

Mitigate #53078.

@reitermarkus
Copy link
Member

Has this been reported upstream?

@vitorgalvao
Copy link
Member Author

Has this been reported upstream?

Good point. Have you done it, @KizzyCode?

@reitermarkus reitermarkus added the awaiting user reply Issue needs response from a user. label Dec 29, 2018
@KizzyCode
Copy link

Sorry; I didn't have the time to setup a test setup until now. I'll check it in the next days.

@vitorgalvao
Copy link
Member Author

I didn't have the time to setup a test setup until now.

But have you reported the initial issue upstream, to see if they’re willing to offer an official solution as suggested?

@KizzyCode
Copy link

If you mean working auto-update functionality in LuLu , then yes; there’s already a pull request for it (not by me) which should be merged in the next version.

@vitorgalvao
Copy link
Member Author

If you mean working auto-update functionality in LuLu

That’s not what I meant, I meant an option to uninstall without deleting settings.

@KizzyCode
Copy link

@vitorgalvao Ah, ok – sorry that i misunderstood you there. I've now reported the issue upstream.

Your patch sadly does not work as intended; if I run brew cask upgrade --verbose kc-lulu (this is your version in my repo so I could rerun an upgrade) it fails:

==> Upgrading 1 outdated package:
kizzycode/formulas/kc-lulu 1.1.1 -> 1.1.2
==> Caveats
To install and/or use kc-lulu you may need to enable their kernel extension in

  System Preferences → Security & Privacy → General

For more information refer to vendor documentation or the Apple Technical Note:

  https://developer.apple.com/library/content/technotes/tn2459/_index.html

==> Satisfying dependencies
==> Downloading https://bitbucket.org/objective-see/deploy/downloads/LuLu_1.1.2.zip
==> Downloading from https://bbuseruploads.s3.amazonaws.com/c237a8d2-0423-4819-8ddf-492e6852c6f7/downloads/b7eb8820-246a-4eaf-aafd-9f7d4cc73baf/LuLu_1.1.2.zip?Signature=cb1Kv%2F0DSbj8VOynJJ01MyLC1yQ%3D&Expires=1546476387&AWSAccessKeyId=AKIAIQWXW6WLXMB5QZAQ&versionId=GiRT5xl1FHYNfbGXbEVRcxKQugK8PhKN&response-content-disposition=attachment%3B%20filename%3D%22LuLu_1.1.2.zip%22
/usr/bin/curl -q --show-error --user-agent Homebrew/1.8.6-88-g62448eb\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.14.2\)\ curl/7.54.0 --fail --location --remote-time --continue-at 0 --output /Users/keziah/Library/Caches/Homebrew/downloads/5711f5f4745a63d6820bcec6679465e3c19a65847ef3560e9f67da01640f3079--LuLu_1.1.2.zip.incomplete https://bbuseruploads.s3.amazonaws.com/c237a8d2-0423-4819-8ddf-492e6852c6f7/downloads/b7eb8820-246a-4eaf-aafd-9f7d4cc73baf/LuLu_1.1.2.zip\?Signature=cb1Kv\%2F0DSbj8VOynJJ01MyLC1yQ\%3D\&Expires=1546476387\&AWSAccessKeyId=AKIAIQWXW6WLXMB5QZAQ\&versionId=GiRT5xl1FHYNfbGXbEVRcxKQugK8PhKN\&response-content-disposition=attachment\%3B\%20filename\%3D\%22LuLu_1.1.2.zip\%22
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4588k  100 4588k    0     0   810k      0  0:00:05  0:00:05 --:--:--  957k
==> Verifying SHA-256 checksum for Cask 'kc-lulu'.
==> Starting upgrade for Cask kc-lulu
==> Running uninstall process for kc-lulu; your password may be necessary
==> Running uninstall script /usr/local/Caskroom/kc-lulu/1.1.1/Lulu Installer.app/Contents/MacOS/LuLu Installer
Password:
2019-01-03 01:20:16.575 LuLu Installer[2402:24914] Sentry Started -- Version: 3.12.0
INFO : KSCrash.m (339): -[KSCrash sendAllReportsWithCompletion:]: Sending 0 crash reports
LULU: waiting for 'kextcache' to complete
LULU: uninstall ok!
...reboot to complete

unzip /Users/keziah/Library/Caches/Homebrew/downloads/5711f5f4745a63d6820bcec6679465e3c19a65847ef3560e9f67da01640f3079--LuLu_1.1.2.zip -d /var/folders/1j/0w30v2jx4xgfn8xdhbwr7xxw0000gn/T/d20190103-1892-100f5tn
cp -pR /var/folders/1j/0w30v2jx4xgfn8xdhbwr7xxw0000gn/T/d20190103-1892-100f5tn/LuLu\ Installer.app/. /usr/local/Caskroom/kc-lulu/1.1.2/LuLu\ Installer.app
chmod -Rf +w /var/folders/1j/0w30v2jx4xgfn8xdhbwr7xxw0000gn/T/d20190103-1892-100f5tn
==> Running installer script '/usr/local/Caskroom/kc-lulu/1.1.2/Lulu Installer.app/Contents/MacOS/LuLu Installer'
2019-01-03 01:23:45.828 LuLu Installer[2468:28702] Sentry Started -- Version: 3.12.0
INFO : KSCrash.m (339): -[KSCrash sendAllReportsWithCompletion:]: Sending 0 crash reports
LULU: waiting for 'system_profiler' to complete
LULU: waiting for 'kextcache' to complete
LULU: install ok!
...reboot to complete

Warning: Unexpected method 'backup_setting_dir' called during postflight on Cask kc-lulu.
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
==> Purging files for version 1.1.2 of Cask kc-lulu
Error: no implicit conversion of nil into String
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1584:in `path'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1584:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1570:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:518:in `mv'
/usr/local/Homebrew/Library/Taps/kizzycode/homebrew-formulas/Casks/kc-lulu.rb:28:in `block (2 levels) in load'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:39:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:39:in `abstract_phase'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:22:in `install_phase'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:209:in `block in install_artifacts'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:200:in `install_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:83:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:41:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:41:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'

@vitorgalvao
Copy link
Member Author

@KizzyCode There was a typo (missing s). Care to try again?

@KizzyCode
Copy link

KizzyCode commented Jan 3, 2019

Ok, now the upgrade fails with

==> Upgrading 1 outdated package:
kizzycode/formulas/kc-lulu 1.1.1 -> 1.1.2
==> Caveats
To install and/or use kc-lulu you may need to enable their kernel extension in

  System Preferences → Security & Privacy → General

For more information refer to vendor documentation or the Apple Technical Note:

  https://developer.apple.com/library/content/technotes/tn2459/_index.html

==> Satisfying dependencies
==> Downloading https://bitbucket.org/objective-see/deploy/downloads/LuLu_1.1.2.zip
==> Downloading from https://bbuseruploads.s3.amazonaws.com/c237a8d2-0423-4819-8ddf-492e6852c6f7/downloads/b7eb8820-246a-4eaf-aafd-9f7d4cc73baf/LuLu_1.1.2.zip?Signature=0I9D2Sw8OHj3qvQ1YV15PjxJfMg%3D&Expires=1546480148&AWSAccessKeyId=AKIAIQWXW6WLXMB5QZAQ&versionId=GiRT5xl1FHYNfbGXbEVRcxKQugK8PhKN&response-content-disposition=attachment%3B%20filename%3D%22LuLu_1.1.2.zip%22
/usr/bin/curl -q --show-error --user-agent Homebrew/1.8.6-88-g62448eb\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.14.2\)\ curl/7.54.0 --fail --location --remote-time --continue-at 0 --output /Users/keziah/Library/Caches/Homebrew/downloads/5711f5f4745a63d6820bcec6679465e3c19a65847ef3560e9f67da01640f3079--LuLu_1.1.2.zip.incomplete https://bbuseruploads.s3.amazonaws.com/c237a8d2-0423-4819-8ddf-492e6852c6f7/downloads/b7eb8820-246a-4eaf-aafd-9f7d4cc73baf/LuLu_1.1.2.zip\?Signature=0I9D2Sw8OHj3qvQ1YV15PjxJfMg\%3D\&Expires=1546480148\&AWSAccessKeyId=AKIAIQWXW6WLXMB5QZAQ\&versionId=GiRT5xl1FHYNfbGXbEVRcxKQugK8PhKN\&response-content-disposition=attachment\%3B\%20filename\%3D\%22LuLu_1.1.2.zip\%22
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4588k  100 4588k    0     0  1987k      0  0:00:02  0:00:02 --:--:-- 1988k
==> Verifying SHA-256 checksum for Cask 'kc-lulu'.
==> Starting upgrade for Cask kc-lulu
==> Running uninstall process for kc-lulu; your password may be necessary
==> Running uninstall script /usr/local/Caskroom/kc-lulu/1.1.1/Lulu Installer.app/Contents/MacOS/LuLu Installer
Password:
2019-01-03 02:32:07.198 LuLu Installer[1872:10572] Sentry Started -- Version: 3.12.0
INFO : KSCrash.m (339): -[KSCrash sendAllReportsWithCompletion:]: Sending 0 crash reports
LULU: waiting for 'kextcache' to complete
LULU: uninstall ok!
...reboot to complete

unzip /Users/keziah/Library/Caches/Homebrew/downloads/5711f5f4745a63d6820bcec6679465e3c19a65847ef3560e9f67da01640f3079--LuLu_1.1.2.zip -d /var/folders/1j/0w30v2jx4xgfn8xdhbwr7xxw0000gn/T/d20190103-1362-xwxoup
cp -pR /var/folders/1j/0w30v2jx4xgfn8xdhbwr7xxw0000gn/T/d20190103-1362-xwxoup/LuLu\ Installer.app/. /usr/local/Caskroom/kc-lulu/1.1.2/LuLu\ Installer.app
chmod -Rf +w /var/folders/1j/0w30v2jx4xgfn8xdhbwr7xxw0000gn/T/d20190103-1362-xwxoup
==> Running installer script '/usr/local/Caskroom/kc-lulu/1.1.2/Lulu Installer.app/Contents/MacOS/LuLu Installer'
2019-01-03 02:34:19.982 LuLu Installer[1945:12685] Sentry Started -- Version: 3.12.0
INFO : KSCrash.m (339): -[KSCrash sendAllReportsWithCompletion:]: Sending 0 crash reports
LULU: waiting for 'system_profiler' to complete
LULU: waiting for 'kextcache' to complete
LULU: install ok!
...reboot to complete

==> Purging files for version 1.1.2 of Cask kc-lulu
Error: Permission denied @ rb_file_s_rename - (/tmp/Homebrew_tmp_LuLu_settings, /Library/Objective-See/LuLu/Homebrew_tmp_LuLu_settings)
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:529:in `rename'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:529:in `block in mv'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1572:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1586:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1570:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:518:in `mv'
/usr/local/Homebrew/Library/Taps/kizzycode/homebrew-formulas/Casks/kc-lulu.rb:28:in `block (2 levels) in load'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:39:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:39:in `abstract_phase'
/usr/local/Homebrew/Library/Homebrew/cask/artifact/abstract_flight_block.rb:22:in `install_phase'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:209:in `block in install_artifacts'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:200:in `install_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:83:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:41:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/upgrade.rb:41:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'

As far as I can see there are three errors:

  1. the missing permissions (is the move-command also executed as root?)
  2. the tmp-folder itself is copied into /Library/Objective-See/LuLu/
  3. the script fails to run the preflight-block if the tmp-folder already exists (Error: File exists @ syserr_fail2_in - /tmp/Homebrew_tmp_LuLu_settings/LuLu/LuLu.bundle/Contents/Frameworks/Sentry.framework/Resources) – maybe use sth. like mktemp?

And last of all – is it a good idea implementing all this logic in the formula instead of waiting for an upstream fix/auto-updates?

@vitorgalvao vitorgalvao removed the awaiting user reply Issue needs response from a user. label Jan 21, 2019
@vitorgalvao vitorgalvao deleted the lulu-settings branch January 21, 2019 01:28
@lock lock bot added the outdated label Feb 20, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 20, 2019
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.

3 participants