kornelski / cargo-deb

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

`unattended-upgrade` with locally edited conffile causes "Not found in archive" tar error #47

Open ximon18 opened 2 years ago

ximon18 commented 2 years ago

See: https://github.com/NLnetLabs/routinator/issues/783

In short:

# unattended-upgrade
...
tar: ./etc/routinator/routinator.conf: Not found in archive
tar: Exiting with failure status due to previous errors

The routinator.conf file is in the archive, but stored as etc/routinator/routinator.conf - note without the leading ./.

In the linked issue I came up with a work around but unpacking the data tarball from inside the DEB archive and re-tarballing the same files but so that they end up with ./ in the path seems a bit ridiculous.

Apparently the code in unattended-upgrade has been requiring this leading . in the path of items in the data tarball for 10 years at least looking at the blame history, so this isn't a new issue, so I'm surprised it hasn't come up here before.

Does anyone have a way to configure cargo-deb assets that results in . leading paths in the data tarball? I suspect not because of this from the tar crate for fn set_path():

"Will strip out any “.” path component, which signifies the current directory."

Thoughts anyone?

kornelski commented 2 years ago

I guess that's a feature request for the tar crate.

ximon18 commented 2 years ago

Ok. I just wanted to be sure I wasn't missing something really obvious 😀.