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

Add portage support for Gentoo Linux #1076

Merged
merged 5 commits into from Jul 6, 2022
Merged

Add portage support for Gentoo Linux #1076

merged 5 commits into from Jul 6, 2022

Conversation

zmedico
Copy link
Contributor

@zmedico zmedico commented Jun 29, 2022

Closes: #998

Signed-off-by: Zac Medico zachary.medico@sony.com

Signed-off-by: Zac Medico <zachary.medico@sony.com>
@spiffcs
Copy link
Contributor

spiffcs commented Jul 5, 2022

👋 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.

@zmedico
Copy link
Contributor Author

zmedico commented Jul 5, 2022

wave 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?

Yes, please do.

I really appreciate you updating the branch recently. Apologies for merging in other PR which might have broken yours.

No problem.

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Copy link
Contributor

@spiffcs spiffcs 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 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$`)
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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

@spiffcs spiffcs added the enhancement New feature or request label Jul 6, 2022
@spiffcs
Copy link
Contributor

spiffcs commented Jul 6, 2022

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>
@spiffcs spiffcs merged commit 4c55c62 into anchore:main Jul 6, 2022
aiwantaozi pushed a commit to aiwantaozi/syft that referenced this pull request Oct 20, 2022
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>

tmp
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
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
Archived in project
Development

Successfully merging this pull request may close these issues.

Add Gentoo Linux support
3 participants