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

wrong tar command #143

Open
jmickle opened this issue Aug 9, 2014 · 17 comments
Open

wrong tar command #143

jmickle opened this issue Aug 9, 2014 · 17 comments

Comments

@jmickle
Copy link
Contributor

jmickle commented Aug 9, 2014

when /gz|tgz|tar|bz2|tbz/
  execute "extract_artifact!" do
    command "tar xf #{cached_tar_path} -C #{release_path}"

this is surprising this works, assuming you are using a .tar file explicitly. This is the wrong subset of commands for file types and extraction.

@awillis
Copy link
Contributor

awillis commented Aug 10, 2014

Yes I agree, this looks wrong.

@capoferro
Copy link
Contributor

What specifically is wrong? Are you able to provide a fix?

Is it that it's missing the z for gzipped files?

@awillis
Copy link
Contributor

awillis commented Aug 11, 2014

The x and f options say extract and specify the file. There are no options here for the specific type of compression used. The tar format itself does not do compression.

@awillis
Copy link
Contributor

awillis commented Aug 11, 2014

The j option is needed for bzip2 and the z option for zlib compression.

@capoferro
Copy link
Contributor

Cool, we'd definitely accept a PR fixing this.

@jmickle
Copy link
Contributor Author

jmickle commented Aug 11, 2014

yeah i can break this out and PR it i suppose

@awillis
Copy link
Contributor

awillis commented Aug 11, 2014

Yah I was going to submit a PR sometime this week.

@jmickle
Copy link
Contributor Author

jmickle commented Aug 11, 2014

Awesome @awillis you on this one? I can focus on 142 if you are

@awillis
Copy link
Contributor

awillis commented Aug 11, 2014

Yup, I've got it

@jmickle
Copy link
Contributor Author

jmickle commented Aug 11, 2014

great i will focus on 142 then and get that in the next couple of days :-)

@jmickle
Copy link
Contributor Author

jmickle commented Aug 18, 2014

@awillis any update on this?

@awillis
Copy link
Contributor

awillis commented Aug 20, 2014

#148

Sorry for the delay, been busy with work stuff. I don't have any test artifacts to test it with, perhaps you do?

@jmickle
Copy link
Contributor Author

jmickle commented Aug 20, 2014

all ive got from nexus are tar.gz's etc, maybe this would be a good use case for the unit tests?

@awillis
Copy link
Contributor

awillis commented Aug 22, 2014

A test with a tar.gz only is fine. We're not resting the tar programs ability to decompress archives, just the providers ability to pass the right options. You might also rename the tar.gz as tgz and test that, and decompress it using gzip and test with the resultant tar.

@florentdupont
Copy link
Contributor

Tested using tar.gz => failed
For tgz extension => I confirm it's working.

Concerning the tar.gzfailure. The problem is not the tar command but the previous test with the extension. I provided a correction in PR #156.

@glenjamin
Copy link

It's worth noting that (at least) GNU tar detects the compression type based on filename, so this will only fail when using older versions of tar.

@BarthV
Copy link
Contributor

BarthV commented May 21, 2015

-1 !
Tar command auto detect archive format for ages !
Providing -z or -j is not a good recommandation anymore ...

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

No branches or pull requests

6 participants