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

Files in /etc are overwritten #121

Closed
datapythonista opened this issue Jan 26, 2024 · 6 comments
Closed

Files in /etc are overwritten #121

datapythonista opened this issue Jan 26, 2024 · 6 comments

Comments

@datapythonista
Copy link

My understanding when reading this doc linked in cargo-deb documentation for conf-files is that anything under /etc will automatically not be overwritten when a package is upgraded.

But given this Cargo.toml section:

[package.metadata.deb]
assets = [
    ["target/release/doc-previewer", "usr/bin/", "755"],
    ["config.toml", "etc/doc-previewer/", "644"],
]

And installing a new version of my package with sudo dpkg -i doc-previewer_0.1.1-1_amd64.deb, the config.toml configuration file is indeed overwritten by the new version one.

Also, after using the conf-files option like this:

conf-files = ["config.toml"]

or this:

conf-files = ["/etc/doc-previewer/config.toml"]

It will also overwrite the file.

Am I doing something wrong? Or is this not working as expected? I'm happy to open a PR to clarify the docs if it's something I'm doing wrong.

Thanks for the amazing work with this btw, I build .deb packages in the past, and I couldn't be happier that this tool exist. :)

@kornelski
Copy link
Owner

Files listed in assets are always overwriting.

@datapythonista
Copy link
Author

Files listed in assets are always overwriting.

Thanks for the information. I tried removing the config file from assets and to add this but doesn't seem to work:

conf-files = [
    ["config.toml", "etc/doc-previewer/", "644"],
]

I don't understand how a configuration file that is not overwritten needs to be specified then.

@kornelski
Copy link
Owner

kornelski commented Jan 28, 2024

Sorry, I was mistaken. The file needs to be listed in assets, since conf-files won't imply inclusion. Unfortunately, I don't know why it's not behaving as expected.

@datapythonista
Copy link
Author

Thank you for clarifying and for your help. Knowing that it is expected to preserve the config file when updating I'll have a look and try to understand where is the problem. I'll post here any finding. Thanks!

@JakkuSakura
Copy link

JakkuSakura commented May 17, 2024

Please document conf-files properly.
Which string should I put into conf-files???

Edit: figured out it should be target file path

@kornelski
Copy link
Owner

Now the conffiles is generated automatically for all assets in etc/

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

3 participants