sstadick / cargo-bundle-licenses

Generate a THIRDPARTY file with all licenses in a cargo project.
Apache License 2.0
90 stars 6 forks source link

MIT license treated as Apache-2.0, and seems to ignore `-p`; manually exclude known incorrect license text? #40

Open BatmanAoD opened 1 week ago

BatmanAoD commented 1 week ago

The ident_case package is dual-licensed for MIT and Apache-2.0. However, only the MIT license is included in the package source.

For some reason, bundle-licenses uses the MIT license file as the license text for both Apache-2.0 and MIT. This seems like a bug, because for other packages, such as wide, the license file is correctly identified, and the missing texts are emitted as NOT FOUND.

If I simply remove the Apache-2.0 entry, or explicitly change the text to NOT FOUND, then run again with -c --previous, then the MIT file is, again, used as the license text in the newly-generated file. This seems odd, because it appears to be the opposite behavior described in #21.

Is there a way to work around this, by forcing bundle-licenses to respect the existing license data for a specific package?

BatmanAoD commented 1 week ago

...in fact, even copying real Apache-2.0 text into the entry for ident_case doesn't prevent it from being replaced with the MIT text. I do not understand this behavior.