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

using tar/unzip util to handle archive instead of golang lib #22

Merged
merged 1 commit into from
Jan 4, 2019
Merged

using tar/unzip util to handle archive instead of golang lib #22

merged 1 commit into from
Jan 4, 2019

Conversation

fredwangwang
Copy link

The original implementation does not handle symlink & hardlink, make the inflated file corrupted.
Using native tar/unzip utility for the best result without the trouble to implement a full-featured archiver.

Specific command copied directly from concourse/s3-resource

Note: before I copied the command from S3-resource, I also tried https://github.com/mholt/archiver as a replacement. But turns out it only works partially. The file I tested with is a Docker container archive, which is a rather complicated target. mholt/archiver was not able to handle some of the contents (links, especially, seems like links redirect several times is a nightmare to handle) in the archive. So I went with tar & unzip utilities, works perfectly. (Why Reinvent the wheel when there is a perfect one last decades? 😄)

The original implementation does not handle symlink & hardlink, make the inflated file corrupted.
Using native tar/unzip utility for the best result without the trouble to implement a full featured archiver.
@fredwangwang
Copy link
Author

This pr solves #18 #16

@frodenas frodenas merged commit 3c8aeeb into frodenas:master Jan 4, 2019
@frodenas
Copy link
Owner

frodenas commented Jan 4, 2019

Thanks @fredwangwang

@frodenas
Copy link
Owner

frodenas commented Jan 4, 2019

@fredwangwang FYI, after merging this PR, I realized the integration tests were failing (see Job #33.2), because the archive files were deleted after uncompressing them.

I've restored the previous gunzip logic (1523853) in order to preserve the original file (gunzip does not preserve the file name) and also removed the os.Remove calls (b518cc2). This should not affect the symlink & hardlink, as it's still using untar/unzip.

@fredwangwang
Copy link
Author

fredwangwang commented Jan 4, 2019 via email

jtarchie referenced this pull request in pivotal-cf/azure-blobstore-resource Dec 4, 2019
- don't rely on shelling out to packages because they no longer exist on
cf-tiny

(fixes #32)
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

Successfully merging this pull request may close these issues.

2 participants