kornelski / cargo-deb

Make Debian packages directly from Rust/Cargo projects
https://lib.rs/cargo-deb
MIT License
431 stars 52 forks source link

[Feature-Request] Advanced Usage, "append" option for assets #114

Closed juliusl closed 1 year ago

juliusl commented 1 year ago

It would be useful if there was an option to append the assets array for variants. For example, if I had a Cargo.toml like this,

[package]
name = "test-deb"
authors = ["foo"]
version = "0.1.0"
edition = "2021"
description = "example deb"
license = "MIT"

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

[dependencies]

[package.metadata.deb]
name = "test-deb"
assets = [
    [
    "lib/hello-world.txt",
    "hello-world.txt",
    "755"
    ]
]

[package.metadata.deb.variants.test]
assets=[
    [
    "lib/hello-world-2.txt",
    "hello-world-2.txt",
    "755"
    ]
]

Variant "test" would end up w/ both hello-world-2.txt, and hello-world.txt.

"Merging" would be cool too but, I think appending would probably be easier to implement.

I am willing to contribute a PR.

I'm thinking it would be an option like this,

[package.metadata.deb.variants.test]
append_assets=[
...
]
kornelski commented 1 year ago

Yes that makes sense. Perhaps it should be a merge, so that you can also replace destination paths of existing assets?

juliusl commented 1 year ago

@kornelski merge would be even better, would you be open to a PR for this?

kornelski commented 1 year ago

Yes please.