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

Support (.tar).bz2 archives #81

Merged
merged 1 commit into from
Mar 21, 2021
Merged

Conversation

sirlatrom
Copy link
Collaborator

E.g. https://github.com/xo/usql/releases/tag/v0.8.2.

Signed-off-by: Sune Keller <sune.keller+gitlab.com@gmail.com>
@sirlatrom sirlatrom added the enhancement New feature or request label Mar 21, 2021
@sirlatrom sirlatrom requested review from marcosnils and breml March 21, 2021 19:09
@sirlatrom sirlatrom self-assigned this Mar 21, 2021
@marcosnils marcosnils merged commit dd4755f into marcosnils:master Mar 21, 2021
@korpa
Copy link
Collaborator

korpa commented Dec 4, 2021

I tried to install restic (https://github.com/restic/restic/releases/tag/v0.12.1) which is a bzip2ed binary. But I get following error:

$ bin install github.com/restic/restic 
   • Getting latest release for restic/restic
   • Starting download of https://github.com/restic/restic/releases/download/v0.12.1/restic_0.12.1_linux_amd64.bz2
5.92 MiB / 5.92 MiB [------------------------------------------------------------------------------------------------------] 100.00% 102.02 MiB p/s 0s
   ⨯ command failed            error=Error installing binary: open /home/user/bin: file exists

So I wonder if bzip2ed binaries are not supported at the moment?

$ bin --version
bin version 0.10.0
commit: 9aa08f233b1233d649d515a3c147ef6f238003ed
built at: 2021-11-30T18:06:27Z
built by: goreleaser

@marcosnils
Copy link
Owner

marcosnils commented Dec 4, 2021

hey @korpa seems like the error that you're getting is because restic already exists. Have you tried doing bin update restic?

You can alternatively use bin install -f to force replace your curreny binary.

@korpa
Copy link
Collaborator

korpa commented Dec 4, 2021

Hej @marcosnils,

No, it doesn't exist. Furthermore then the error would not be
⨯ command failed error=Error installing binary: open /home/user/bin: file exists
but
⨯ command failed error=Error installing binary: open /home/user/bin/restic: file exists

But I double checked it again:

$ cd ~/bin
$ ./restic
zsh: command not found: ./restic
$ ls ./restic
"./restic": No such file or directory (os error 2)
$  bin install github.com/restic/restic
   • Getting latest release for restic/restic
   • Starting download of https://github.com/restic/restic/releases/download/v0.12.1/restic_0.12.1_linux_amd64.bz2
5.92 MiB / 5.92 MiB [-------------------------------------------------------------------------------------------------------] 100.00% 23.83 MiB p/s 0s
   ⨯ command failed            error=Error installing binary: open /home/pauli/bin: file exists

But if you say it bzip2ed binaries like restic should work, the issue may be my bin "directory". Because it is not a directory but a symlink to ~/Workspace/dotfiles/bin.

@marcosnils
Copy link
Owner

But if you say it bzip2ed binaries like restic should work

I thought it was supported, but seems like it's not indeed. Also, we need to fix the error message as well.

Would you mind opening an issue to track it? If you want to give it a shot with a PR, we'd appreciate the contribution!

@marcosnils
Copy link
Owner

Just found what's happening. bin has support for .tar.bz2 files, but not just .bz2 files.

Definitely an "feature" we need to address. Mind adding that please?

@korpa
Copy link
Collaborator

korpa commented Dec 4, 2021

I did a test in the meanwhile as well regarding the symlinked bin dir.

$ mv bin bin_bak
$ mkdir bin
$ install github.com/restic/restic
   • Getting latest release for restic/restic
   • Starting download of https://github.com/restic/restic/releases/download/v0.12.1/restic_0.12.1_linux_amd64.bz2
5.92 MiB / 5.92 MiB [--------------------------------------------------------------------------------------------------------] 100.00% 8.38 MiB p/s 1s
   ⨯ command failed            error=Error installing binary: open /home/user/bin: file exists

Same issue. So it is not the symlink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Support bzip2 / bz2 archives
3 participants