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

Ignore comments in checksum files #350

Merged
merged 3 commits into from Feb 1, 2022
Merged

Conversation

azr
Copy link
Contributor

@azr azr commented Jan 11, 2022

This is a tiny simple step towards #217 and hashicorp/packer#10423

set noninteractive mode to installation
pin to go 1.15, because it worked//works there; I suspect this is a "debian changed something" issue.
Copy link
Member

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I was curious on what would happen if the test file looked like the example in the packer issue. More specifically containing lines that are not checksums or comments but it looks like parseChecksumLine would return an error and the caller would continue. So this looks good.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Copy link
Member

@sylviamoss sylviamoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

case '#', '/', '-':
return nil, nil // skip
}
//TODO: this function will fail if we pass a checksum for a path with spaces
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I understood this one 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings.Fields splits on spacing characters, so if a file being checksummed is "my file.iso" or "my\ file.iso", then the count of the switch will be all messed up

@azr
Copy link
Contributor Author

azr commented Feb 1, 2022

Thx !

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

Successfully merging this pull request may close these issues.

None yet

3 participants