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

Update bankid cask to use latest #6002

Merged
merged 1 commit into from
Sep 8, 2014

Conversation

andreineculau
Copy link
Contributor

Do not merge!

The intent is to use the latest bankid version, but I don't master brew/cask so I'm filing a placeholder PR.
I didn't quite understand what would be the argument for install, given that the pkg filename is unknown.

@rolandwalker rolandwalker changed the title Update bankid cask to use latest WIP Update bankid cask to use latest Sep 4, 2014
@rolandwalker
Copy link
Contributor

Hi! Try running brew cask fetch --debug bankid to see the filename it gets downloaded to.

For very tricky cases, we use a before_install hack to rename the file, as in git-annex.rb, though there needs to be a better way.

I had added a :target directive as a simple way to force the download name in the url stanza, but unfortunately it is tangled up in a more complex PR that was never merged (#3043).

@andreineculau
Copy link
Contributor Author

fetch doesn't say much

==> Downloading https://install.bankid.com/FileDownloader?fileId=Mac
Already downloaded: /Library/Caches/Homebrew/bankid-latest

and install goes like

==> Downloading https://install.bankid.com/FileDownloader?fileId=Mac
Already downloaded: /Library/Caches/Homebrew/bankid-latest
==> Downloaded to -> /Library/Caches/Homebrew/bankid-latest
==> Extracting primary container
==> Determining which containers to use based on filetype
==> Checking container class Cask::Container::Pkg
==> Checking container class Cask::Container::Ttf
==> Checking container class Cask::Container::Otf
==> Checking container class Cask::Container::Air
==> Checking container class Cask::Container::Cab
==> Executing: ["/usr/bin/file", "-Izb", "--", "#<Pathname:/Library/Caches/Homebrew/bankid-latest>"]
==> Checking container class Cask::Container::Dmg
==> Executing: ["/usr/bin/hdiutil", "imageinfo", "#<Pathname:/Library/Caches/Homebrew/bankid-latest>"]
==> Checking container class Cask::Container::SevenZip
==> Checking container class Cask::Container::Sit
==> Checking container class Cask::Container::Tar
==> Checking container class Cask::Container::Rar
==> Executing: ["#<Pathname:/usr/local/bin/lsar>", "-l", "-t", "--", "#<Pathname:/Library/Caches/Homebrew/bankid-latest>"]
==> Checking container class Cask::Container::Zip
==> Checking container class Cask::Container::Bzip2
==> Checking container class Cask::Container::Gzip
==> Checking container class Cask::Container::Xar
==> Using container class Cask::Container::Xar for /Library/Caches/Homebrew/bankid-latest
==> Executing: ["/usr/bin/xar", "-xf", "#<Pathname:/Library/Caches/Homebrew/bankid-latest>", "-C", "/var/folders/fw/pd06ct6129vf_77_l345198m0000gn/T/d20140905-50901-1czjz0x"]
==> Executing: ["/usr/bin/ditto", "--", "/var/folders/fw/pd06ct6129vf_77_l345198m0000gn/T/d20140905-50901-1czjz0x", "#<Pathname:/opt/homebrew-cask/Caskroom/bankid/latest>"]
==> Installing artifacts
==> Determining which artifacts are present in Cask bankid
==> Checking for artifact class Cask::Artifact::BeforeBlock
==> Checking for artifact class Cask::Artifact::NestedContainer
==> Checking for artifact class Cask::Artifact::InstallScript
==> Checking for artifact class Cask::Artifact::App
==> Checking for artifact class Cask::Artifact::Colorpicker
==> Checking for artifact class Cask::Artifact::Pkg
==> Checking for artifact class Cask::Artifact::Prefpane
==> Checking for artifact class Cask::Artifact::Qlplugin
==> Checking for artifact class Cask::Artifact::Font
==> Checking for artifact class Cask::Artifact::Widget
==> Checking for artifact class Cask::Artifact::Service
==> Checking for artifact class Cask::Artifact::CaskroomOnly
==> Checking for artifact class Cask::Artifact::Binary
==> Checking for artifact class Cask::Artifact::InputMethod
==> Checking for artifact class Cask::Artifact::ScreenSaver
==> Checking for artifact class Cask::Artifact::Uninstall
==> Checking for artifact class Cask::Artifact::AfterBlock
==> Checking for artifact class Cask::Artifact::Zap
==> 3 artifact/s defined
Cask::Artifact::BeforeBlock
Cask::Artifact::Pkg
Cask::Artifact::Uninstall
==> Installing artifact of class Cask::Artifact::BeforeBlock
Application.pkg Distribution    Plugin.pkg      Resources ########## this is the output from a ls /opt/homebrew-cask/Caskroom/bankid/latest

it looks like the pkg is expanded automatically...


current cask

class Bankid < Cask
  version 'latest'
  sha256 :no_check

  url 'https://install.bankid.com/FileDownloader?fileId=Mac'
  homepage 'http://www.bankid.com/'

  before_install do
    system '/bin/ls', '--', destination_path
    #system '/bin/cp', '--', destination_path.join('bankid-latest'), destination_path.join('bankid-latest.pkg')
  end

  install 'bankid-latest.pkg'
  uninstall :pkgutil => 'com.bankid.bankid.BankID.pkg'
end

@rolandwalker
Copy link
Contributor

Thanks!

fetch is saying that the file downloads to /Library/Caches/Homebrew/bankid-latest. So as, in git-annex.rb, the current hacky solution is to rename that file, adding the needed missing file extension:

before_install do
  system '/bin/mv', '--', destination_path.join('bankid-latest'), destination_path.join('bankid-latest.pkg')
end
install 'bankid-latest.pkg'

(It does at least get unpacked by the current code, because it is recognized as a generic xar archive. But that's not what you want.)

@andreineculau
Copy link
Contributor Author

AFK now but the destination path is not homebrew's cache path
Any way to reference that?

On 05 Sep 2014, at 18:39, Roland Walker [email protected] wrote:

Thanks!

fetch is saying that the file downloads to /Library/Caches/Homebrew/bankid-latest. So as, in git-annex.rb, the current hacky solution is to rename that file, adding the needed missing file extension:

before_install do
system '/bin/mv', '--', destination_path.join('bankid-latest'), destination_path.join('bankid-latest.pkg')
end
install 'bankid-latest.pkg'
(It does at least get unpacked by the current code, because it is recognized as a generic xar archive. But that's not what you want.)


Reply to this email directly or view it on GitHub.

@rolandwalker
Copy link
Contributor

Referencing the destination path is fine. But we also need to say container_type :naked, perhaps because of a bug introduced in #5614. I also changed the source name in the mv command. This seems to work:

  container_type :naked
  before_install do
    system '/bin/mv', '--', destination_path.join('FileDownloader'), destination_path.join('bankid-latest.pkg')
  end

@andreineculau
Copy link
Contributor Author

Tested your changes, and they work!
Thanks a lot for sticking with this. Nice effort

@rolandwalker rolandwalker changed the title WIP Update bankid cask to use latest Update bankid cask to use latest Sep 8, 2014
@rolandwalker
Copy link
Contributor

Thanks for the contribution!

rolandwalker added a commit that referenced this pull request Sep 8, 2014
@rolandwalker rolandwalker merged commit b16ce64 into Homebrew:master Sep 8, 2014
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 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.

2 participants