On Fri, 11 Jan 2013 13:36:13 -0800
walt <w41...@gmail.com> wrote:

> On 01/11/2013 12:18 PM, Alan McKinnon wrote:
> > On Fri, 11 Jan 2013 11:52:14 -0800
> > walt <w41...@gmail.com> wrote:
> > 
> >> On 01/11/2013 07:14 AM, Nikos Chantziaras wrote:
> >>> emerge -p1 $(for p in $(qfile -Cvq $(find /usr/lib/udev/) | sort
> >>> -u); do echo "=$p"; done)
> >>
> >> qfile stopped working for me many weeks ago and I wish I could get
> >> it working again. All the other portage utils work normally,
> >> though. Any idea how to fix it?
> >>
> >>
> > 
> > Error messages please
> 
> #qfile bash
> #echo $?
> 1
> #qfile /bin/bash
> app-shells/bash (/bin/bash)
> #echo $?
> 0
> 
> That's not the behavior I saw a few months back.  Do you see
> something different?
> 

alanm@khamul ~ $ qfile bash
alanm@khamul ~ $ echo $?
1
alanm@khamul ~ $ qfile /bin/bash
app-shells/bash (/bin/bash)
alanm@khamul ~ $ echo $?
0
alanm@khamul ~ $ 

I get the same as you, and Nikos' one-liner works as intended for me.

I don't use qfile much so I can't honestly say if it changed recently,
but it's behaviour is odd to say the least:

alanm@khamul ~ $ pwd
/home/alanm
alanm@khamul ~ $ qfile media
sys-fs/udisks (/media)
alanm@khamul ~ $ 
alanm@khamul ~ $ 
alanm@khamul ~ $ qfile bash
alanm@khamul ~ $ cd /bin/
alanm@khamul /bin $ qfile bash
app-shells/bash (/bin/bash)
alanm@khamul /bin $ 

This is the documented behaviour, explained by the "ROOT VARIABLE"
section in the man page, but it just feels weird. The purpose of qfile
is to tell you what installed a file system object (the argument to the
command). The argument looks exactly like a path/filename and a
reasonable man would treat it as such, but the command is
prepending a hidden[1] string of ROOT VARIABLE when it doesn't get a
hit on the first try.

This might make sense to the dev, but it's
certain to confuse everyone else. I would say that's not a bug, but
it's an odd feature that probably needs to be thought through some more.



[1] It's not really hidden as such. But it does do something very
unexpected by default, and you have to read the man page first to
find it. Feels to me like it violates the Law of Unexpected Behaviour


-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to