Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
location of files and what does portage know
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1392
Location: Germany

PostPosted: Sat Mar 23, 2024 11:40 am    Post subject: location of files and what does portage know Reply with quote

With the following issue https://github.com/portagefilelist/client/issues/55 a maybe problem came up and now I want to know how to handle it.

If the user runs which ip it will return /usr/bin/ip. A e-file /usr/bin/ip does return northing. Why, because portage records only /bin/ip and not /usr/bin/ip.?

Is this the corret behavior, or does this come from installing the ip command before the usr-merge?
Would any new installation of the ip command will place it into /usr/bin and have not this issue?
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sat Mar 23, 2024 1:13 pm    Post subject: Reply with quote

Banana,

On my [49] default/linux/amd64/23.0/split-usr/no-multilib (stable) * install I get a different answer to you.

Code:
neddy_static ~ # which ip
/bin/ip
neddy_static ~ # e-file /bin/ip
[I]  sys-apps/iproute2
   Seen Versions:       5.4.0 6.3.0 6.4.0 6.5.0 6.6.0 6.6.0-r1 6.6.0-r2 6.6.0-r3 9999
   Portage Versions:    6.6.06.6.0-r16.6.0-r39999
   Repository:          gentoo
   Installed Versions:  6.6.0-r3(Sat Mar 16 16:36:18 2024)
   Homepage:            https://wiki.linuxfoundation.org/networking/iproute2
   Description:         kernel routing and traffic control utilities
   Matched Files:       /bin/ip


I'm not sure if that helps, is just makes the question more complex.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 23, 2024 5:44 pm    Post subject: Re: location of files and what does portage know Reply with quote

Banana wrote:
Would any new installation of the ip command will place it into /usr/bin and have not this issue?

This seems to not be the case (ip is put in /usr/bin because of /bin symlink - I see this during emerge, but equery doesn't know what owns it - I did merge-usr yesterday,
Code:
--- replaced dir /lib64/tc
--- cfgpro   dir /lib64
--- replaced obj /bin/ss
--- replaced obj /bin/ip
--- cfgpro   dir /bin



ns ~ # which ip
/usr/bin/ip
ns ~ # equery b /usr/bin/ip
 * Searching for /usr/bin/ip ...
Both before and after an
Code:
emerge -va1 iproute2
And I'm running [31] default/linux/amd64/23.0/no-multilib/hardened (stable) * now

Seems te be an merge-usr issue - so question is, how do we now identify what ebuild/package a file belongs to? (I guess this would affect all ebuilds installing into /lib, /lib64, /bin and /sbin which are now symlinks?)
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4157
Location: Bavaria

PostPosted: Sat Mar 23, 2024 6:33 pm    Post subject: Reply with quote

This has nothing to do with merged-usr. "which" always had the "problem" ... try parameter "-a" ... which of them is only a softlink you have to find out yourself :lol: :
Code:
$ which mail
/usr/bin/mail
$
$ which -a mail
/usr/bin/mail
/bin/mail

_________________
https://wiki.gentoo.org/wiki/User:Pietinger


Last edited by pietinger on Sat Mar 23, 2024 6:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 23, 2024 6:35 pm    Post subject: Reply with quote

pietinger wrote:
This has nothing to do with merged-usr. "which" always had the "problem" ... try parameter "-a":
Code:
$ which mail
/usr/bin/mail
$
$ which -a mail
/usr/bin/mail
/bin/mail
And that would still leave the user to go through each hit with e-file/equery to find out which is the right one to use for searching for owner - anyways for me which -a only returns the /usr/bin/ location
Code:
ns ~ # which -a mail
/usr/bin/mail
ns ~ # which -a ip
/usr/bin/ip

/bin and /sbin isn't in $PATH


Last edited by freke on Sat Mar 23, 2024 6:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4157
Location: Bavaria

PostPosted: Sat Mar 23, 2024 6:40 pm    Post subject: Reply with quote

Strange ... I get always an answer:
Code:
$ equery b /usr/bin/mail
 * Searching for /usr/bin/mail ...
net-mail/mailutils-3.15 (/usr/bin/mail)
 /bin $
 /bin $ equery b /bin/mail
 * Searching for /bin/mail ...
net-mail/mailutils-3.15 (/usr/bin/mail)
net-mail/mailutils-3.15 (/bin/mail -> ../usr/bin/mail)

_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 23, 2024 6:48 pm    Post subject: Reply with quote

pietinger wrote:
Strange ... I get always an answer:
Code:
$ equery b /usr/bin/mail
 * Searching for /usr/bin/mail ...
net-mail/mailutils-3.15 (/usr/bin/mail)
 /bin $
 /bin $ equery b /bin/mail
 * Searching for /bin/mail ...
net-mail/mailutils-3.15 (/usr/bin/mail)
net-mail/mailutils-3.15 (/bin/mail -> ../usr/bin/mail)
I can force - more or less - the same behaviour by manually adding /bin and /sbin to $PATH
Code:
ns /etc/env.d # env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...
-bash: TMOUT: readonly variable
ns /etc/env.d # echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin:/bin:/sbin
ns /etc/env.d # which -a mail
/usr/bin/mail
/bin/mail
/sbin/mail
ns /etc/env.d # equery b /sbin/mail
 * Searching for /sbin/mail ...
mail-client/mailx-8.1.2.20180807-r1 (/usr/bin/mail)

ns /etc/env.d # equery b /bin/mail
 * Searching for /bin/mail ...
mail-client/mailx-8.1.2.20180807-r1 (/usr/bin/mail)
Notice my equery output doesn't show the linked line like yours do?
Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1392
Location: Germany

PostPosted: Sat Mar 23, 2024 9:45 pm    Post subject: Reply with quote

@Neddy
This is what I also can observe and asume that sys-apps/iproute2 installs ip in /bin/ip and thus pfl collects it. It uses portage.db[eroot]['vartree'].dbapi from the portage python package. https://dev.gentoo.org/~zmedico/portage/doc/api/

@freke
Thanks for the validation. Since I'm on a usr-merged a long time, I could not verify this.

So the portage api knows the initial paths from the install, but nothing more and in a usr-merged enviroment it does not know the symlinks. Is there a way to detect the symlinks, or would this mess things up?
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
freke
l33t
l33t


Joined: 23 Jan 2003
Posts: 977
Location: Somewhere in Denmark

PostPosted: Sat Mar 23, 2024 9:49 pm    Post subject: Reply with quote

Banana wrote:
@Neddy
This is what I also can observe and asume that sys-apps/iproute2 installs ip in /bin/ip and thus pfl collects it. It uses portage.db[eroot]['vartree'].dbapi from the portage python package. https://dev.gentoo.org/~zmedico/portage/doc/api/

@freke
Thanks for the validation. Since I'm on a usr-merged a long time, I could not verify this.

So the portage api knows the initial paths from the install, but nothing more and in a usr-merged enviroment it does not know the symlinks. Is there a way to detect the symlinks, or would this mess things up?


Don't know - I've created this after my first reply in this thread - https://bugs.gentoo.org/927640
Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1392
Location: Germany

PostPosted: Sat Mar 23, 2024 9:51 pm    Post subject: Reply with quote

Just did this:

Code:
❯ which -a ip
/usr/bin/ip

❯ equery b /usr/bin/ip
 * Searching for /usr/bin/ip ...

❯ equery b /bin/ip
 * Searching for /bin/ip ...
sys-apps/iproute2-6.6.0-r3 (/bin/ip)


Kind of different than pietinger got but matches what pfl records and stores for e-file (I do not have mail installed so I use another command)
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1392
Location: Germany

PostPosted: Fri Mar 29, 2024 12:35 pm    Post subject: Reply with quote

As mentioned already in https://bugs.gentoo.org/927640 I've implement some alias logic in the search for e-file and the webclient

The https://wiki.gentoo.org/wiki/Merge-usr topic should be covered now.
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum