kornelski / cargo-deb

A cargo subcommand that generates Debian packages from information in Cargo.toml
https://lib.rs/cargo-deb
MIT License
404 stars 48 forks source link

`conf-files` generates a `conffiles` file with a trailing empty line #110

Closed jszwedko closed 10 months ago

jszwedko commented 11 months ago

First reported here: https://github.com/vectordotdev/vector/issues/18439 . Apparently the extra newline causes issues with Uyuni/SUSE Manager.

To make sure it wasn't something we are doing, I reproduced the behavior with a stand-alone project:

  1. cargo init
  2. Edited Cargo.toml to include:
    
    [package]
    name = "example"
    version = "0.1.0"
    edition = "2021"
    authors = ["Jesse Szwedko"]

[package.metadata.deb] name = "example" conf-files = ["/usr/local/Cargo.toml"] assets = [ ["Cargo.toml", "/usr/local/Cargo.toml", "644"] ]

See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

3. Ran `cargo-deb`
4. `cd target/debian`
5. `ar x example_0.1.0_amd64.deb`
6. `tar xvf control.tar.xz`
7. `cat conffiles` gives

/usr/local/Cargo.toml



Let me know if you need any more details! Thanks for this project! We rely on it heavily to build Vector Debian packages.
jszwedko commented 10 months ago

Thanks @kornelski !