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
Add portage support for Gentoo Linux #1076
Conversation
Signed-off-by: Zac Medico <zachary.medico@sony.com>
👋 Thanks @zmedico for the PR here. I'm looking at this now. Do you mind if I add some commits to the branch to get the different CI checks passing? I really appreciate you updating the branch recently. Apologies for merging in other PR which might have broken yours. |
Yes, please do.
No problem. |
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and approved! Just looking if you have any documentation or cross-reference for the regular expression you included for the cpvRe
Any path or code reference to the Gentoo Portage db specification will help here for future developers.
) | ||
|
||
var ( | ||
cpvRe = regexp.MustCompile(`/([^/]*/[\w+][\w+-]*)-((\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)(-r\d+)?)/CONTENTS$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a source in the DB specification for regex or is it used anywhere else in the Gentoo source? If so, having a comment that points future users to the layout or database file listing would be awesome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's derived from the _cpv
regular expression found in this file:
https://github.com/gentoo/portage/blob/master/lib/portage/versions.py
MetadataType: pkg.PortageMetadataType, | ||
Metadata: entry, | ||
} | ||
addLicenses(resolver, dbLocation, &p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the license parser for this
I'll update the CLI tests here too |
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com> tmp
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
Closes: #998
Signed-off-by: Zac Medico zachary.medico@sony.com