Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 8832
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Aron Griffis (RETIRED) <agriffis@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Bill Gjestvang <bill@uncultured.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
epm.qf.patch Make "epm -qf relname" work patch Wayne Davison 2002-12-27 12:40 0000 791 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8832 depends on: Show dependency tree
Bug 8832 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2002-10-06 22:56 0000
"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

------- Comment #1 From Karl Trygve Kalleberg (RETIRED) 2002-10-18 16:48:50 0000 -------
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.

------- Comment #2 From Bill Gjestvang 2002-10-31 20:23:54 0000 -------
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

------- Comment #3 From Karl Trygve Kalleberg (RETIRED) 2002-11-02 16:13:52 0000 -------
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 ?

------- Comment #4 From Thomas Raschbacher 2002-12-01 17:57:16 0000 -------
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;

------- Comment #5 From Wayne Davison 2002-12-27 12:40:29 0000 -------
Created an attachment (id=6782) [details]
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).

------- Comment #6 From Aron Griffis (RETIRED) 2003-04-30 22:53:54 0000 -------
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.

------- Comment #7 From Bill Gjestvang 2003-04-30 23:43:34 0000 -------
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.)

------- Comment #8 From Aron Griffis (RETIRED) 2003-05-01 22:04:04 0000 -------
Thanks Bill for the nit pick. ;-)  All fixed in 0.8.3

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug