gravitl / homebrew-netclient

Apache License 2.0
0 stars 6 forks source link

[Bug]: Uninstalling netclient from homebrew results in error #23

Open lukvacek opened 1 year ago

lukvacek commented 1 year ago

Contact Details

No response

What happened?

Attempting to uninstall netclient using brew returns an error:

~ % brew uninstall netclient ==> Uninstalling Cask netclient ==> Running uninstall script Error: Cask 'netclient' definition is invalid: uninstall :script without :executable.

Version

v0.16.3

What OS are you using?

Mac

Relevant log output

~ % brew uninstall netclient
==> Uninstalling Cask netclient
==> Running uninstall script 
Error: Cask 'netclient' definition is invalid: uninstall :script without :executable.

Contributing guidelines

gi8 commented 1 year ago

I have a same problem with macos 13

tobiasquinn commented 1 year ago

This also prevents upgrade from gravitl/netclient/netclient 0.16.1 -> 0.16.3

mattkasun commented 1 year ago

22 fixes

kristvanbesien commented 1 year ago

If this is fixed, why can I still not upgrade netclient?

krist@MacBook-Pro ~ % brew upgrade netclient
==> Upgrading 1 outdated package:
gravitl/netclient/netclient 0.16.1 -> 0.16.3
==> Upgrading netclient
==> Downloading https://fileserver.netmaker.org/v0.16.3/darwin/netclient-arm64.tgz
Already downloaded: /Users/krist/Library/Caches/Homebrew/downloads/c034189c3c328d401d14b3e3ab1c5e67564ffde972803dc29a4d82bac8da48be--netclient-arm64.tgz
All formula dependencies satisfied.
==> Running uninstall script
==> Purging files for version 0.16.3 of Cask netclient
Error: Cask 'netclient' definition is invalid: uninstall :script without :executable.
breagan-acs commented 1 year ago

Adding the uninstall.sh script to the uninstall stanza seems to resolve it; not a homebrew dev so I'm not sure if that's the right way to go about it.

24

hseshadr commented 1 year ago

This is still a problem in MacOS:

harish@harishs-mbp-2 ~ % brew uninstall netclient --force --ignore-dependencies ==> Uninstalling Cask netclient ==> Running uninstall script Error: Cask 'netclient' definition is invalid: uninstall :script without :executable. harish@harishs-mbp-2 ~ % brew uninstall netclient
==> Uninstalling Cask netclient ==> Running uninstall script Error: Cask 'netclient' definition is invalid: uninstall :script without :executable. harish@harishs-mbp-2 ~ %

infused-kim commented 1 year ago

@hseshadr to fix this problem, I had to edit /opt/homebrew/Caskroom/netclient/.metadata/0.16.0/20221008210119.360/Casks/netclient.rb to add the changes from PR https://github.com/gravitl/homebrew-netclient/pull/24 ...

  uninstall script: {
  }

to...

  uninstall script: {
    executable: "#{staged_path}/uninstall.sh",
    sudo: true,
  }

After that I was able to uninstall netclient with brew uninstall netclient.

Your path to the netclient.rb will probably be slightly different though.

b4good commented 1 year ago

Also in Version 0.17.1. it is still a bug. The solution from @infused-kim helped! :)

Spacebjorn commented 1 year ago

Still an issue in 0.20 @infused-kim solution works