Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Use a custom copyright/license file without adding auto-generated lines #187

Open
filips123 opened this issue Jul 5, 2021 · 3 comments
Open

Comments

@filips123
Copy link
Contributor

I created a custom copyright file that complies with debian/copyright file specification and I would like to package it into a DEB archive.

If I just add license-file = ["debian/copyright", "0"] to Cargo.toml, the file will be packed into an archive, but cargo-deb will add auto-generated lines at the start of file, causing duplicated or possibly incorrect data.

Maybe there could be an additional option in license-file to prevent adding auto-generated lines to the copyright/license file?

@kornelski
Copy link
Collaborator

The assumption for license-file is that it's a plain file used for Cargo.

I suppose cargo-deb could try being smart about this and see if the file already uses Debian's syntax, and not add its fields if it does.

@filips123
Copy link
Contributor Author

Considering that license-file inside [package.metadata.deb] section already uses a different format (array with filename and numbers of lines to skip) than package-level license-file (just string filename), could there be another array element to tell cargo-deb to now add any fields?

For example:

# Standard Cargo.toml stuff
# ...

[package.metadata.deb]
license-file = ["debian/copyright", "0", true]
# So this means debian/copyright filename, skip zero lines, and it is already Debian-formatted file so don't add any new fields

@kornelski
Copy link
Collaborator

kornelski commented Jul 6, 2021

There could be (although arrays need all elements to be strings, so ["path", "0", "true"]), but the downside is that this requires us documenting it and users knowing to set it. I much prefer "just works" approach.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants