Without some awk or cut foo (such as: `FEATURES="-news" emerge -pqeO @selected | cut -d ']' -f 2`) it is not presently possible to produce a concise, machine readable list of packages _within_ a set (or superset - a set of sets - such as the @selected or @world sets) from Portage using a command included within Portage itself. Portage does include a way to list available sets via `emerge --list-sets`. I believe the closest possible output from Portage is using the following emerge command: `FEATURES="-news" emerge -pqeO @<set>` or `FEATURES="-news" emerge --pretend --quiet --emptytree --nodeps @<set>` This will exclude the leading "These are the packages that would be merged, in order:" and prevent the footer display of any GLEP 42 news items to provide a list of packages included (to be rebuilt) within the set, but still includes the leading "[ebuild R ]" part. It would be a useful and handy feature to teach emerge a --list @<set> option so that something like the following command would be possible: `emerge --list @system' Expected output would be something like other tools display, I've tried to document various ways of listing sets in this wiki article[1]. Bonus points if the query could also show a deduplicated list of atoms for *currently installed* packages within the set (equivalent of pquery --installed --pkgset system), and not every package atom that meet the qualification to fulfill the requirements of the set (equivalent of pquery --pkgset system). Ideally Portage would be able to show both static[2] and dynamic[3] sets - terms that may not exist within the Portage sources, but conceptually are a thing. It would seem even pkgcore's pquery cannot presently list sets other than installed, system, or world. [1] https://wiki.gentoo.org/index.php?title=Package_sets&oldid=1248664#Packages_within_a_set [2] https://wiki.gentoo.org/index.php?title=Package_sets&oldid=1248664#Static_sets [3] https://wiki.gentoo.org/index.php?title=Package_sets&oldid=1248664#Dynamic_sets Reproducible: Always
I usually just use app-portage/gentoolkit for that sort of thing. # equery list @system * Searching for @system ... [IP-] [ ] app-admin/eselect-1.4.25:0 [IP-] [ ] app-alternatives/awk-4:0 [IP-] [ ] app-alternatives/bzip2-1:0 [IP-] [ ] app-alternatives/gzip-0:0 [IP-] [ ] app-alternatives/sh-0:0 [IP-] [ ] app-alternatives/tar-0:0 [IP-] [ ] app-arch/bzip2-1.0.8-r4:0/1 [IP-] [ ] app-arch/gzip-1.12-r4:0 [IP-] [ ] app-arch/tar-1.34-r3:0 [IP-] [ ] app-arch/xz-utils-5.4.3:0 [IP-] [ ] app-shells/bash-5.2_p15-r6:0 [IP-] [ ] net-misc/iputils-20221126-r1:0 [IP-] [ ] net-misc/rsync-3.2.7-r2:0 [IP-] [ ] net-misc/wget-1.21.4:0 [IP-] [ ] sys-apps/baselayout-2.13-r1:0 [IP-] [ ] sys-apps/coreutils-9.3-r3:0 [IP-] [ ] sys-apps/diffutils-3.10:0 [IP-] [ ] sys-apps/file-5.44-r3:0 [IP-] [ ] sys-apps/findutils-4.9.0-r2:0 [IP-] [ ] sys-apps/gawk-5.2.2:0 [IP-] [ ] sys-apps/grep-3.11:0 [IP-] [ ] sys-apps/iproute2-6.4.0:0 [IP-] [ ] sys-apps/kbd-2.6.1:0 [IP-] [ ] sys-apps/kmod-30-r1:0 [IP-] [ ] sys-apps/less-633-r1:0 [IP-] [ ] sys-apps/man-pages-6.04:0 [IP-] [ ] sys-apps/net-tools-2.10:0 [IP-] [ ] sys-apps/sed-4.9:0 [IP-] [ ] sys-apps/shadow-4.13-r4:0/4 [IP-] [ ] sys-apps/util-linux-2.39.1:0 [IP-] [ ] sys-apps/which-2.21:0 [IP-] [ ] sys-devel/binutils-2.40-r5:2.40 [IP-] [ ] sys-devel/gcc-13.1.1_p20230624:13 [IP-] [ ] sys-devel/gnuconfig-20230121:0 [IP-] [ ] sys-devel/make-4.4.1-r1:0 [IP-] [ ] sys-devel/patch-2.7.6-r5:0 [IP-] [ ] sys-fs/e2fsprogs-1.47.0-r2:0 [IP-] [ ] sys-process/procps-3.3.17-r1:0/8 [IP-] [ ] sys-process/psmisc-23.6:0 [IP-] [ ] virtual/dev-manager-0-r2:0 [IP-] [ ] virtual/editor-0-r5:0 [IP-] [ ] virtual/libc-1-r1:0 [IP-] [ ] virtual/man-0-r4:0 [IP-] [ ] virtual/os-headers-0-r2:0 [IP-] [ ] virtual/package-manager-1:0 [IP-] [ ] virtual/pager-0-r1:0 [IP-] [ ] virtual/service-manager-1-r1:0 [IP-] [ ] virtual/ssh-0-r2:0
(In reply to cyrillic from comment #1) > I usually just use app-portage/gentoolkit for that sort of thing. > > # equery list @system > * Searching for @system ... > [IP-] [ ] app-admin/eselect-1.4.25:0 > [IP-] [ ] app-alternatives/awk-4:0 > [IP-] [ ] app-alternatives/bzip2-1:0 > [IP-] [ ] app-alternatives/gzip-0:0 > [IP-] [ ] app-alternatives/sh-0:0 > [IP-] [ ] app-alternatives/tar-0:0 > [IP-] [ ] app-arch/bzip2-1.0.8-r4:0/1 > [IP-] [ ] app-arch/gzip-1.12-r4:0 > [IP-] [ ] app-arch/tar-1.34-r3:0 > [IP-] [ ] app-arch/xz-utils-5.4.3:0 > [IP-] [ ] app-shells/bash-5.2_p15-r6:0 > [IP-] [ ] net-misc/iputils-20221126-r1:0 > [IP-] [ ] net-misc/rsync-3.2.7-r2:0 > [IP-] [ ] net-misc/wget-1.21.4:0 > [IP-] [ ] sys-apps/baselayout-2.13-r1:0 > [IP-] [ ] sys-apps/coreutils-9.3-r3:0 > [IP-] [ ] sys-apps/diffutils-3.10:0 > [IP-] [ ] sys-apps/file-5.44-r3:0 > [IP-] [ ] sys-apps/findutils-4.9.0-r2:0 > [IP-] [ ] sys-apps/gawk-5.2.2:0 > [IP-] [ ] sys-apps/grep-3.11:0 > [IP-] [ ] sys-apps/iproute2-6.4.0:0 > [IP-] [ ] sys-apps/kbd-2.6.1:0 > [IP-] [ ] sys-apps/kmod-30-r1:0 > [IP-] [ ] sys-apps/less-633-r1:0 > [IP-] [ ] sys-apps/man-pages-6.04:0 > [IP-] [ ] sys-apps/net-tools-2.10:0 > [IP-] [ ] sys-apps/sed-4.9:0 > [IP-] [ ] sys-apps/shadow-4.13-r4:0/4 > [IP-] [ ] sys-apps/util-linux-2.39.1:0 > [IP-] [ ] sys-apps/which-2.21:0 > [IP-] [ ] sys-devel/binutils-2.40-r5:2.40 > [IP-] [ ] sys-devel/gcc-13.1.1_p20230624:13 > [IP-] [ ] sys-devel/gnuconfig-20230121:0 > [IP-] [ ] sys-devel/make-4.4.1-r1:0 > [IP-] [ ] sys-devel/patch-2.7.6-r5:0 > [IP-] [ ] sys-fs/e2fsprogs-1.47.0-r2:0 > [IP-] [ ] sys-process/procps-3.3.17-r1:0/8 > [IP-] [ ] sys-process/psmisc-23.6:0 > [IP-] [ ] virtual/dev-manager-0-r2:0 > [IP-] [ ] virtual/editor-0-r5:0 > [IP-] [ ] virtual/libc-1-r1:0 > [IP-] [ ] virtual/man-0-r4:0 > [IP-] [ ] virtual/os-headers-0-r2:0 > [IP-] [ ] virtual/package-manager-1:0 > [IP-] [ ] virtual/pager-0-r1:0 > [IP-] [ ] virtual/service-manager-1-r1:0 > [IP-] [ ] virtual/ssh-0-r2:0 Yes. I have recently built out the following article with ways to list packages within a set, however I would still like to see Portage get a built-in way to list packages within sets... https://wiki.gentoo.org/wiki/Package_sets#Packages_within_a_set It should be possible within a fresh stage 3 environment to see which packages are pulled in by which set without emerging a new tool.