kimono-koans / httm

Interactive, file-level Time Machine-like tool for ZFS/btrfs/nilfs2 (and even Time Machine and Restic backups!)
https://crates.io/crates/httm
Mozilla Public License 2.0
1.36k stars 29 forks source link

Unable to install provided rpm packages #51

Closed 3lswear closed 2 years ago

3lswear commented 2 years ago

Hello, I am unable to install any of recent rpm packages on Fedora due to conflicts. Here's the message dnf gives me:

Error: Transaction test error:
  file /usr/bin from install of httm-0.14.10-2.x86_64 conflicts with file from package filesystem-3.18-2.fc36.x86_64

I noticed that recently package creation process has been changed so that rpms are created using alien. As far as I've researched, the problem with alien is known and the gist of it is that alien can include unnecessary paths to the package spec that conflict with system packages. One way it can be solved is by rebuilding the package with a fixed spec, like demonstrated here.

Maybe it is possible to add some steps to rpm creation to remove conflicting paths, something like the method in the linked article?

kimono-koans commented 2 years ago

Thanks for filing a bug report. Sorry the tagged package isn't working for you.

Yes, removing the offending lines from the rpm spec might be possible. My issue is I can't tell exactly where the error might occur. See the rpm spec for 0.14.10:

Buildroot: /srv/program/httm/target/debian/httm-0.14.10
Name: httm
Version: 0.14.10
Release: 2
Summary: A CLI tool for viewing snapshot file versions on ZFS and btrfs datasets
License: see /usr/share/doc/httm/copyright
Distribution: Debian
Group: Converted/utility

%define _rpmdir ../
%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%define _unpackaged_files_terminate_build 0

%description
httm prints the size, date and corresponding locations of available unique
versions of files
residing on snapshots.  May also be used interactively to select and restore
from such
versions, and even to snapshot datasets which contain certain files.

(Converted from a deb package by alien version 8.95.5.)

%files
%dir "/usr/share/doc/httm/"
"/usr/share/doc/httm/copyright"
"/usr/bin/httm"
"/usr/share/doc/httm/README"
"/usr/share/man/man1/httm.1.gz"

Can you get a more verbose error that could show you the conflict, because the install files (see %files) don't appear as if they would conflict with any system packages?

kimono-koans commented 2 years ago

It turns out the alien generated spec doesn't include /usr/bin, but one of the rpm build tools alien invokes will add /usr/bin later in the process, after the spec is generated.

However, you can add --replacefiles when you use rpm to install, like so: rpm -i --replacefiles httm*.rpm and it will install. This is putatively safe from my testing, that is, rpm -e won't remove /usr/bin unless the directory is empty.

I don't use RHEL/Fedora, therefore, this issue (but really all packaging generally) is a low priority for me to personally fix, and, especially since, as I described, there is a mitigation --replacefiles. However, PRs are welcome from you and other RHEL/Fedora users in the form of a GH action yaml. Preferably something, like alien, that can be invoked from an Ubuntu container.

I will, of course, add a note to the documentation with a link to this issue so others will know the situation.

Again thanks for reporting!