Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
packages number returned by emerge not the same as eix?
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
guyuming
Apprentice
Apprentice


Joined: 19 Nov 2020
Posts: 253

PostPosted: Wed Nov 16, 2022 5:21 am    Post subject: packages number returned by emerge not the same as eix? Reply with quote

Code:
root@localhost /home/guyuming # eix-update
Reading Portage settings...
Building database (/var/cache/eix/portage.eix)...
[0] "gentoo" /var/db/repos/gentoo (cache: metadata-md5-or-flat)
     Reading category 184|184 (100) Finished             
[1] "ace" /var/db/repos/ace (cache: parse|ebuild*3.0.24#metadata-md5#metadata-flat#assign)
     Reading category 184|184 (100) Finished           
[2] "gentoo-zh" /var/db/repos/gentoo-zh (cache: parse|ebuild*3.0.24#metadata-md5#metadata-flat#assign)
     Reading category 184|184 (100) Finished           
[3] "guru" /var/db/repos/guru (cache: parse|ebuild*3.0.24#metadata-md5#metadata-flat#assign)
     Reading category 184|184 (100) Finished             
[4] "gym_repo" /var/db/repos/gym_repo (cache: parse|ebuild*3.0.24#metadata-md5#metadata-flat#assign)
     Reading category 184|184 (100) Finished       
Applying masks...
Calculating hash tables...
Writing database file /var/cache/eix/portage.eix...
Database contains 21586 packages in 184 categories
root@localhost /home/guyuming # emerge --depclean
/usr/lib/python3.10/site-packages/portage/package/ebuild/_config/KeywordsManager.py:86: UserWarning: /etc/portage/package.keywords is deprecated, use /etc/portage/package.accept_keywords instead
  warnings.warn(

 * Always study the list of packages to be cleaned for any obvious
 * mistakes. Packages that are part of the world set will always
 * be kept.  They can be manually added to this set with
 * `emerge --noreplace <atom>`.  Packages that are listed in
 * package.provided (see portage(5)) will be removed by
 * depclean, even if they are part of the world set.
 *
 * As a safety measure, depclean will not remove any packages
 * unless *all* required dependencies have been resolved.  As a
 * consequence of this, it often becomes necessary to run
 * `emerge --update --newuse --deep @world` prior to depclean.

Calculating dependencies... done!
>>> No packages selected for removal by depclean
>>> To see reverse dependencies, use --verbose
Packages installed:   1031
Packages in world:    967
Packages in system:   43
Required packages:    1031
Number removed:       0
root@localhost /home/guyuming # EIX_LIMIT=0 eix -I#|wc -l
1017
root@localhost /home/guyuming # EIX_LIMIT=0 eix -I# --world|wc -l
999


Packages installed: 1031
Packages in world: 967

vs

root@localhost /home/guyuming # EIX_LIMIT=0 eix -I#|wc -l
1017
root@localhost /home/guyuming # EIX_LIMIT=0 eix -I# --world|wc -l
999


Last edited by guyuming on Wed Nov 16, 2022 9:39 am; edited 1 time in total
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Wed Nov 16, 2022 9:06 am    Post subject: Reply with quote

Code:
<snip>
>>> No packages selected for removal by depclean
Packages installed:   1946
Packages in world:    445
Packages in system:   43
Required packages:    1946
Number removed:       0
# cd /var/db/pkg; ls -1d */*|wc -l
1946
# eix -I#|wc -l
1855
#


...it seems eix is omitting some things. This invocation:
Code:
# eix '-I*' --format '<installedversions:NAMEVERSION>' |wc -l
1945
#
copied from 'man eix' gives me the same form of output and almost entirely the same results as the 'ls' command. Dumping both into files and diffing them reveals the one package that is no longer in portage, but isn't unmerged either, and eix decided not to show it.
_________________
quasi-religious systemic wrongism pessimizes indiscriminately


Last edited by dbtx on Wed Nov 16, 2022 9:45 am; edited 1 time in total
Back to top
View user's profile Send private message
guyuming
Apprentice
Apprentice


Joined: 19 Nov 2020
Posts: 253

PostPosted: Wed Nov 16, 2022 9:37 am    Post subject: Reply with quote

@dbtx

my result:
Code:
root@localhost /home/guyuming # EIX_LIMIT=0 eix '-I*' --format '<installedversions:NAMEVERSION>'|wc -l
1031
root@localhost /home/guyuming # EIX_LIMIT=0 eix '-I*' --world --format '<installedversions:NAMEVERSION>'|wc -l
1013
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9629
Location: beyond the rim

PostPosted: Wed Nov 16, 2022 2:40 pm    Post subject: Reply with quote

The problem is almost certainly your usage of the '#' option. That tells eix to only report package names, so packages with multiple installed slots are only reported once.
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Thu Nov 17, 2022 12:39 am    Post subject: Reply with quote

By trimming off package versions with
Code:
/var/db/pkg $ ls -1d */* | sed -e 's/\([^.]*\).*/\1/' -e 's/\(.*\)-.*/\1/' > /tmp/pkgs-ls
and using 'uniq', I can almost reproduce the shorter list but it gives 1857 instead of 1855. I'm not sure about that; the sed line is definitely slightly wrong because things like 'acct-group/locate-0' get through. But with 'uniq -d' I see there are only 16 such repeated package names, and the first one, app-doc/phrack, has 70 slots installed. Neat.
_________________
quasi-religious systemic wrongism pessimizes indiscriminately
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