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

Instead of hardcoding license text in "metadata.go", would we consider using the License text obtained from GitHub API using github.com/google/go-github? #242

Open
wlyu2 opened this issue Jan 16, 2025 · 0 comments

Comments

@wlyu2
Copy link

wlyu2 commented Jan 16, 2025

rr, _, err := gitHub.Repositories.Get(context.TODO(), owner, repo)

On this line, variable "rr" points to a "github.Repository" object with a "License" field in which the there is a GitHub URL pointing to the License text.

License:github.License{Key:"bsd-2-clause", Name:"BSD 2-Clause "Simplified" License", URL:"https://api.github.com/licenses/bsd-2-clause", SPDXID:"BSD-2-Clause"}

Would you think that it is better for dh-make-golang to obtain the license text from this URL rather than getting the license text from the hard-coded dictionary in metadata.go?

var debianLicenseText = map[string]string{

P.S. For the license example above, the hard-coded dictionary does not even have a bsd-2-clause as its key. As a result, the generated debian/copyright only has a "TODO" under the generated License stanza:

Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://github.com/go-warnings/warnings
Upstream-Name: warnings.v0
Upstream-Contact: TODO

Files: *
Copyright: 2016 
License: BSD-2-clause

Files: debian/*
Copyright: 2025 TODO <TODO>
License: BSD-2-clause
Comment: Debian packaging is licensed under the same terms as upstream

License: BSD-2-clause
 TODO
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

No branches or pull requests

1 participant