Skip to content

Inject copyright file into slices - #18

Merged
niemeyer merged 1 commit into
canonical:mainfrom
woky:copyright-slices
Oct 10, 2022
Merged

niemeyer merged 1 commit into
canonical:mainfrom
woky:copyright-slices

Conversation

@woky

@woky woky commented Jul 25, 2022

Copy link
Copy Markdown
Contributor

Add /usr/share/doc//copyright file entry to every slice to make
sure copyright files are always included in the final tree. The entry is
added with new Optional flag that's not exposed in public YAML interface,
but is passed down to ExtractInfo.Optional flag. Note that we allow same
entries in multiple slices as long as they have same properties (kind,
mode, etc.).

Stripped out base-files package that is embedded in pkgdata.go is modified
to include the copyright file in and slicer_test.go is modified to inject
copyright filesystem entries in expected test result map.

@woky
woky requested a review from niemeyer July 25, 2022 19:25
@woky
woky force-pushed the copyright-slices branch from 2ba3279 to b4069d0 Compare July 25, 2022 19:26
@woky
woky requested a review from cjdcordeiro August 11, 2022 08:57

@cjdcordeiro cjdcordeiro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm.

tested with multiple slices, both with and without copyright files.

One question though: what about common-licenses? Some packages might refer to a common license instead of having it explicit within their content...should base-files /usr/share/common-licenses always be installed by default? I think there are still a lot of packages where the copyright files are not machine readable, so it's not like we could infer their connection to a common-license...any thoughts on this?

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR, this is looking quite nice.

A few minor points:

Comment thread internal/deb/extract_test.go Resolved
Comment thread internal/fsutil/create_test.go Resolved
Comment thread internal/testutil/pkgdata.go Resolved
Comment thread internal/slicer/slicer.go Resolved
Add /usr/share/doc/<package>/copyright file entry to every slice to make
sure copyright files are always included in the final tree.

Stripped out base-files package that is embedded in pkgdata.go is
modified to include the copyright file and slicer_test.go is modified to
inject copyright filesystem entries in expected test result map.
@woky
woky force-pushed the copyright-slices branch from b4069d0 to cd96154 Compare October 2, 2022 11:50
@woky

woky commented Oct 2, 2022 •

Copy link
Copy Markdown
Contributor Author

@niemeyer I've addressed all your comments. Can you please look again?

One question though: what about common-licenses? Some packages might refer to a common license instead of having it explicit within their content...should base-files /usr/share/common-licenses always be installed by default? I think there are still a lot of packages where the copyright files are not machine readable, so it's not like we could infer their connection to a common-license...any thoughts on this?

The package copyright files seems to include complete verbatim licenses already for various parts of source code, so /usr/share/common-licenses feels unnecessary to me. But IANAL. 🤷‍♂️

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The testing approach means it's assuming every test is base-files and has that exact copyright, which is not great. That said, this PR has waited enough and the actual implementation here is now small and sweet, so let's move on with it and we can address the test later when the time comes.

Thanks for the change and patience.

@niemeyer
niemeyer merged commit bf2a16e into canonical:main Oct 10, 2022
woky added a commit to woky/chisel that referenced this pull request Oct 20, 2022
Add /usr/share/doc/<package>/copyright file entry to every slice to make
sure copyright files are always included in the final tree.

Stripped out base-files package that is embedded in pkgdata.go is
modified to include the copyright file and slicer_test.go is modified to
inject copyright filesystem entries in expected test result map.
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.

3 participants