"epm -qf" doesn't work unless you prepend the path to the filename. This can lead people to assume that a file is not owned by any package, when in fact it is. Example: $ cd /etc $ epm -qf man.conf file man.conf is not owned by any package $ epm -qf /etc/man.conf man-1.5k Expected behavior: $ cd /etc $ epm -qf man.conf man-1.5k
This is a deliberate design feature that is contestable. I guess we should at least add a flag to have it do more lenient searches.
It's definitely different behavior than rpm. Here's how rpm-4.0.4-7x.18 works on RedHat 7.3: $ cd /etc $ rpm -qf man.config man-1.5j-6 $ cd / $ rpm -qf man.config error: file man.config: No such file or directory $ rpm -qf /etc/man.config man-1.5j-6
Another fairly tiny issue. I think epm -qf should do whatever rpm -qf does. Do you have time to check out how rpm -qf works, and try to imitate it ?
hi! this was no python code... ;) but cuz of it my perl-skill got an 'upgrade' *G* greetings, LordVan here's a diff: 280,282c280,281 < # TODO: If it's a relative pathname, then figure out < # the full pathname < if ($a !~ m#^/#) { } --- > ## if no '/' in file-name add one at the beginning to match the regex later correct > if ($a !~ m|/|) { $a="/$a" } 298c297 < next unless $f eq $a; --- > next unless $f =~ / \Q$a\E $ /x;
Created attachment 6782 [details, diff] Make "epm -qf relname" work This patch uses the "Cwd" perl module to figure out the absolute path of a relative argument (including collapsing ".." elements).
Thanks Wayne for the patch. It's in the tree now as 0.8.2 along with your other patches. I'm sorry these didn't get in for so long; I never saw them in bugzilla. If you have further patches I'll get them in as quick as I can.
epm should first check whether the file exists. "epm -qf nonexistentfile" returns "file $PWD/nonexistentfile is not owned by any package" (e.g. in /usr/bin, returns "file /usr/bin/nonexistentfile is not...") rpm, for a similar request, returns "error: file nonexistentfile: No such file or directory" (But the behavior is much improved from before.)
Thanks Bill for the nit pick. ;-) All fixed in 0.8.3