Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 440754

Summary: app-portage/portage-utils-0.20 / qfile doesn't find package for a symlink
Product: Portage Development Reporter: Helmut Jarausch <jarausch>
Component: ToolsAssignee: Portage Utils Team <portage-utils>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Helmut Jarausch 2012-11-01 15:26:08 UTC

    
Comment 1 Helmut Jarausch 2012-11-01 15:28:58 UTC
It looks as if qfile doesn't find packages containing a given file if this is a symlink, e.g.

ls -l /usr/bin/pg_config
gives  /usr/lib64/postgresql-9.2/bin/pg_config

qfile /usr/bin/pg_config
doesn't show anything, but
equery belongs /usr/bin/pg_config  works

and

qfile /usr/lib64/postgresql-9.2/bin/pg_config 
works, as well.
Comment 2 SpanKY gentoo-dev 2012-11-01 17:23:43 UTC
the package doesn't own that symlink.  it was created outside of the ebuild install (by what mechanism, i don't know exactly ... i'd have to read the code).

equery dereferences the symlink first, but portage-utils does not.  hence technically, the file is orphaned.

you could do the same thing:
$ cd ~/
$ ln -s /usr/bin/pg_config
$ qfile $PWD/pg_config
$ equery belongs $PWD/pg_config

i'd say clearly equery is lying
Comment 3 Helmut Jarausch 2012-11-01 17:45:21 UTC
(In reply to comment #2)
> the package doesn't own that symlink.  it was created outside of the ebuild
> install (by what mechanism, i don't know exactly ... i'd have to read the
> code).
> 
> equery dereferences the symlink first, but portage-utils does not.  hence
> technically, the file is orphaned.
> 
> you could do the same thing:
> $ cd ~/
> $ ln -s /usr/bin/pg_config
> $ qfile $PWD/pg_config
> $ equery belongs $PWD/pg_config
> 
> i'd say clearly equery is lying

Sorry, but I don't understand your arguments:

Here my experience:  (re-)emerging dev-db/glom failed.
It was clear that /usr/bin/pg_config reported an older version of
dev-db/postgresql-base (there 2 different versions installed).
I tried to find out what package had installed /usr/bin/pg_config
and emerge did show the package which installed the file /usr/bin/pg_config is symlinked to. This was very helpful contrary to qfile.
I've found out several times that qfile doesn't know the package of a file.
I definitely didn't create that symlink myself.
And since it points to /usr/lib64/postgresql-9.2/bin/pg_config is very likely that it is installed by dev-db/postgresql-base itself.

In summary: equery depends is helpful, qfile is not (in this case)
Helmut.
Comment 4 Paul Varner (RETIRED) gentoo-dev 2012-11-01 18:56:15 UTC
Technically, qfile is correct.  There is not a package that owns the symlink.  

What equery is doing is noticing that the file is a symlink and also searching for the file that is referenced. The output from equery is reporting that the referenced file belongs to package <blah>. 

This was added to equery due to multiple complaints about files and libraries not being found when they were symlinks.

That being said, Mike is correct in his assessment and it is up to him if he wants qfile to try to dereference a symlink to find a package.