* [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" @ 2006-11-20 6:37 Daevid Vincent 2006-11-20 8:27 ` Mark M 2006-11-20 8:36 ` Bo Ørsted Andresen 0 siblings, 2 replies; 13+ messages in thread From: Daevid Vincent @ 2006-11-20 6:37 UTC (permalink / raw To: gentoo-user Wondering if someone has a script or shell 'one liner' that can take the output of "emerge -avu world" and make a list of the packages (I assume all on one line). Then I could pump that back into "emerge -av" again (I don't mind if it's a simple manual highlight and copy/append). I didn't see anything here: http://forums.gentoo.org/viewtopic.php?t=67849 http://gentoo-wiki.com/TIP_Portage_utilities_not_in_portage There is that 'pfilter' that looks interesting, but it's 2 years old, and I can't get it to work :-\ For example: daevid ~ # emerge -avu world | grep x11- [ebuild U ] x11-misc/util-macros-1.1.2 [1.1.0] USE="-debug" 45 kB [ebuild U ] x11-proto/inputproto-1.4 [1.3.2] USE="-debug" 47 kB [ebuild U ] x11-proto/xproto-7.0.9 [7.0.7] USE="-debug" 138 kB [ebuild U ] x11-libs/xtrans-1.0.2 [1.0.1] USE="-debug" 97 kB [ebuild U ] x11-libs/libX11-1.0.3-r1 [1.0.3] USE="ipv6 -debug" 1,415 kB ... I want to run some command that will give me a list like: x11-misc/util-macros x11-proto/inputproto x11-proto/xproto ... Then I could just select and copy that "string" and append it to "emerge -av " -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 6:37 [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" Daevid Vincent @ 2006-11-20 8:27 ` Mark M 2006-11-20 20:59 ` Richard Fish 2006-11-20 8:36 ` Bo Ørsted Andresen 1 sibling, 1 reply; 13+ messages in thread From: Mark M @ 2006-11-20 8:27 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 400 bytes --] Hi there, I think this topic might help you: http://forums.gentoo.org/viewtopic-t-497125-highlight-updateworld.html when you run it with --prepare option it produces a nice emergelist file under .updateworld folder which you can easily edit, and when you run it with --install option it will autoskip and resume failed packages and as a bonus will provide you with the list of failed packages also. [-- Attachment #2: Type: text/html, Size: 565 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 8:27 ` Mark M @ 2006-11-20 20:59 ` Richard Fish 2006-11-20 22:18 ` Daevid Vincent 2006-11-21 9:13 ` Mark M 0 siblings, 2 replies; 13+ messages in thread From: Richard Fish @ 2006-11-20 20:59 UTC (permalink / raw To: gentoo-user On 11/20/06, Mark M <makalsky@gmail.com> wrote: > Hi there, > I think this topic might help you: > http://forums.gentoo.org/viewtopic-t-497125-highlight-updateworld.html > > when you run it with --prepare option it produces a nice emergelist file > under .updateworld folder which you can easily edit, and when you run it > with --install option it will autoskip and resume failed packages and as a > bonus will provide you with the list of failed packages also. > This script doesn't use the --oneshot option when merging, so it will add all updating packages to your world file. I hope you haven't used this... :-( -Richard -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 20:59 ` Richard Fish @ 2006-11-20 22:18 ` Daevid Vincent 2006-11-20 22:36 ` Boris Fersing 2006-11-20 22:50 ` Hans-Werner Hilse 2006-11-21 9:13 ` Mark M 1 sibling, 2 replies; 13+ messages in thread From: Daevid Vincent @ 2006-11-20 22:18 UTC (permalink / raw To: gentoo-user > -----Original Message----- > From: richard.j.fish@gmail.com > [mailto:richard.j.fish@gmail.com] On Behalf Of Richard Fish > Sent: Monday, November 20, 2006 1:00 PM > To: gentoo-user@lists.gentoo.org > Subject: Re: [gentoo-user] In need of script/command that > will parse out all the packages from "emerge -avu world" > > On 11/20/06, Mark M <makalsky@gmail.com> wrote: > > Hi there, > > I think this topic might help you: > > > http://forums.gentoo.org/viewtopic-t-497125-highlight-updateworld.html > > > > when you run it with --prepare option it produces a nice > emergelist file > > under .updateworld folder which you can easily edit, and > when you run it > > with --install option it will autoskip and resume failed > packages and as a > > bonus will provide you with the list of failed packages also. > > > > This script doesn't use the --oneshot option when merging, so it will > add all updating packages to your world file. I hope you haven't used > this... :-( I dont understand this --oneshot option? I've never used it in all my gentoo years. Why wouldn't I want packages in my world file? Isn't that how they get updated when new ones come out? Anything in my 'emerge -avu world', I would not have a --oneshot for, so why would I do it any different if I manually did 'emerge -av pkg1 pkg2 pkg3 ...'? DÆVID -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 22:18 ` Daevid Vincent @ 2006-11-20 22:36 ` Boris Fersing 2006-11-21 0:15 ` b.n. 2006-11-20 22:50 ` Hans-Werner Hilse 1 sibling, 1 reply; 13+ messages in thread From: Boris Fersing @ 2006-11-20 22:36 UTC (permalink / raw To: gentoo-user 2006/11/20, Daevid Vincent <daevid@daevid.com>: > > -----Original Message----- > > From: richard.j.fish@gmail.com > > [mailto:richard.j.fish@gmail.com] On Behalf Of Richard Fish > > Sent: Monday, November 20, 2006 1:00 PM > > To: gentoo-user@lists.gentoo.org > > Subject: Re: [gentoo-user] In need of script/command that > > will parse out all the packages from "emerge -avu world" > > > > On 11/20/06, Mark M <makalsky@gmail.com> wrote: > > > Hi there, > > > I think this topic might help you: > > > > > http://forums.gentoo.org/viewtopic-t-497125-highlight-updateworld.html > > > > > > when you run it with --prepare option it produces a nice > > emergelist file > > > under .updateworld folder which you can easily edit, and > > when you run it > > > with --install option it will autoskip and resume failed > > packages and as a > > > bonus will provide you with the list of failed packages also. > > > > > > > This script doesn't use the --oneshot option when merging, so it will > > add all updating packages to your world file. I hope you haven't used > > this... :-( > > I don't understand this --oneshot option? I've never used it in all my > gentoo years. Why wouldn't I want packages in my world file? Isn't that how > they get updated when new ones come out? Anything in my 'emerge -avu world', > I would not have a --oneshot for, so why would I do it any different if I > manually did 'emerge -av pkg1 pkg2 pkg3 ...'? let's say you want to install a package "A" which depends on "B" and "C", if you emerge these 3 packages with emerge -av A B C, the package B and C won't be removed when you'll uninstall A and you'll have unneeded dependencies installed on your system ! If you install only A with emerge -av A and let portage manage the dependencies for you, your system will still "clean" ! Regards, Boris. > > DÆVID > > > -- > gentoo-user@gentoo.org mailing list > > -- $ ruby -e'puts " .:@BFegiklnorst".unpack("x4ax7aaX6ax5aX15ax4aax6aaX7ax2 \ aX5aX8axaX3ax8aX4ax6aX3aX6ax3ax3aX9ax4ax2aX9axaX6ax3aX2ax4 \ ax3aX4aXaX12ax10aaX7a").join' -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 22:36 ` Boris Fersing @ 2006-11-21 0:15 ` b.n. 2006-11-21 1:41 ` Richard Fish 0 siblings, 1 reply; 13+ messages in thread From: b.n. @ 2006-11-21 0:15 UTC (permalink / raw To: gentoo-user Boris Fersing ha scritto: > let's say you want to install a package "A" which depends on "B" and > "C", if you emerge these 3 packages with emerge -av A B C, the package > B and C won't be removed when you'll uninstall A and you'll have > unneeded dependencies installed on your system ! > > If you install only A with emerge -av A and let portage manage the > dependencies for you, your system will still "clean" ! I always understood that "emerge -C" NEVER deleted dependencies (and i fact, I've never seen it happening). Isn't it why the dreaded "emerge depclean" exists? By the way, I've never used --oneshot too... m. -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-21 0:15 ` b.n. @ 2006-11-21 1:41 ` Richard Fish 2006-11-21 22:59 ` b.n. 0 siblings, 1 reply; 13+ messages in thread From: Richard Fish @ 2006-11-21 1:41 UTC (permalink / raw To: gentoo-user On 11/20/06, b.n. <brullonulla@gmail.com> wrote: > Boris Fersing ha scritto: > > let's say you want to install a package "A" which depends on "B" and > > "C", if you emerge these 3 packages with emerge -av A B C, the package > > B and C won't be removed when you'll uninstall A and you'll have > > unneeded dependencies installed on your system ! > > > > If you install only A with emerge -av A and let portage manage the > > dependencies for you, your system will still "clean" ! > > I always understood that "emerge -C" NEVER deleted dependencies (and i > fact, I've never seen it happening). > Isn't it why the dreaded "emerge depclean" exists? Boris has the right answer, but skipped a step or two in his explanation. You are correct that "emerge -C" will not remove dependant packages. But emerge --depclean never removes anything that is in your world file. So let's say you decide to play around with xfce4, so you do "emerge xfce4". This merges all packages that xfce4 depends on, but adds *only* xfce4 to the world file. And then you forget about it, a few months elapse, and a new version comes out. You decide to update using the script (or some other command) that ends up merging each single package without the --oneshot option. Now all of those xfce4 packages are in your world file, not just xfce4. Some more time passes, you realize you have a lot of crap you are not using installed, and decide to cleanup a bit, starting with "emerge -C xfce4". xfce4 is a metabuild that has no files, so that goes really quick, and doesn't really get rid of anything. Now you do "emerge --depclean world", figuring that will clean out dependancies. But because you have all of those xfce4 packages in your world file, depclean doesn't want to remove any of them. > By the way, I've never used --oneshot too... It is almost always a good idea when doing "some_command_to_create_pkg_list | xargs emerge". -Richard -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-21 1:41 ` Richard Fish @ 2006-11-21 22:59 ` b.n. 0 siblings, 0 replies; 13+ messages in thread From: b.n. @ 2006-11-21 22:59 UTC (permalink / raw To: gentoo-user > Boris has the right answer, but skipped a step or two in his > explanation. You are correct that "emerge -C" will not remove > dependant packages. But emerge --depclean never removes anything that > is in your world file. >[snip] > Some more time passes, you realize you have a lot of crap you are not > using installed, and decide to cleanup a bit, starting with "emerge -C > xfce4". xfce4 is a metabuild that has no files, so that goes really > quick, and doesn't really get rid of anything. Now you do "emerge > --depclean world", figuring that will clean out dependancies. But > because you have all of those xfce4 > packages in your world file, depclean doesn't want to remove any of them. OK, now I understand. Thanks a lot. I always thought that world was just "the set of all packages installed in my system" and that --oneshot was just a way to override updates. Probably I didn't read the gentoo manual very well :) m. -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 22:18 ` Daevid Vincent 2006-11-20 22:36 ` Boris Fersing @ 2006-11-20 22:50 ` Hans-Werner Hilse 1 sibling, 0 replies; 13+ messages in thread From: Hans-Werner Hilse @ 2006-11-20 22:50 UTC (permalink / raw To: gentoo-user Hi, On Mon, 20 Nov 2006 14:18:39 -0800 "Daevid Vincent" <daevid@daevid.com> wrote: > > This script doesn't use the --oneshot option when merging, so it will > > add all updating packages to your world file. I hope you haven't used > > this... :-( > > I dont understand this --oneshot option? I've never used it in all my > gentoo years. Why wouldn't I want packages in my world file? Isn't that how > they get updated when new ones come out? Anything in my 'emerge -avu world', > I would not have a --oneshot for, so why would I do it any different if I > manually did 'emerge -av pkg1 pkg2 pkg3 ...'? An "emerge -uD" will check all dependencies for updates. So that's how one is supposed to make a full update. You most certainly don't want all packages in your world file. This would include dependency packages (e.g. libraries), which might not be dependencies tomorrow (changed software, changed USE flags, etc.pp.). And when you do the occasional "emerge --depclean", it can't take those "stale dependencies" into account, because they are in the world file. So e.g. libraries not linked anymore to anything would still be left on the precious disc space, because they're in the world file. I regularly take an editor and trim down my world file (I forget about --oneshot very often) to the packages I want to use. Then I run "emerge --depclean" to get rid of old cruft (to be sure, I could have done a "emerge -pvDn world" before, but I trust myself enough not to shoot myself in the foot). -hwh -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 20:59 ` Richard Fish 2006-11-20 22:18 ` Daevid Vincent @ 2006-11-21 9:13 ` Mark M 2006-11-21 10:14 ` Bo Ørsted Andresen 1 sibling, 1 reply; 13+ messages in thread From: Mark M @ 2006-11-21 9:13 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 883 bytes --] On 11/20/06, Richard Fish <bigfish@asmallpond.org> wrote: > > On 11/20/06, Mark M <makalsky@gmail.com> wrote: > > Hi there, > > I think this topic might help you: > > http://forums.gentoo.org/viewtopic-t-497125-highlight-updateworld.html > > > > when you run it with --prepare option it produces a nice emergelist file > > under .updateworld folder which you can easily edit, and when you run it > > with --install option it will autoskip and resume failed packages and as > a > > bonus will provide you with the list of failed packages also. > > > > This script doesn't use the --oneshot option when merging, so it will > add all updating packages to your world file. I hope you haven't used > this... :-( > > -Richard > -- > gentoo-user@gentoo.org mailing list > > I've edited it a little for my needs (including --oneshot) but basically its a generally good script for starters. [-- Attachment #2: Type: text/html, Size: 1395 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-21 9:13 ` Mark M @ 2006-11-21 10:14 ` Bo Ørsted Andresen 0 siblings, 0 replies; 13+ messages in thread From: Bo Ørsted Andresen @ 2006-11-21 10:14 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 826 bytes --] On Tuesday 21 November 2006 10:13, Mark M wrote: > I've edited it a little for my needs (including --oneshot) but basically > its a generally good script for starters. I guess I disagree. I don't think any beginner needs a massively complex script which they don't understand... A couple of notes on the script, however. If you wrote the script then I suggest that you google a bit for "useless use of cat". The script does a *lot* of that.. IMHO the script is pretty ugly in general but I guess that isn't the most important thing. Worth noting also is that `equery depends` is pretty broken. It gives false positives and it only works for installed packages. I think pquery from sys-apps/pkgcore would be a better choice although I obviously haven't tested it for this purpose. -- Bo Andresen [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 6:37 [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" Daevid Vincent 2006-11-20 8:27 ` Mark M @ 2006-11-20 8:36 ` Bo Ørsted Andresen 2006-11-21 22:59 ` Daevid Vincent 1 sibling, 1 reply; 13+ messages in thread From: Bo Ørsted Andresen @ 2006-11-20 8:36 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1547 bytes --] On Monday 20 November 2006 07:37, Daevid Vincent wrote: > Wondering if someone has a script or shell 'one liner' that can take the > output of "emerge -avu world" and make a list of the packages (I assume all > on one line). Then I could pump that back into "emerge -av" again (I don't > mind if it's a simple manual highlight and copy/append). You need to replace --ask with --pretend when you send the output into a pipe. Otherwise it will wait for input. Also when you send it back to `emerge -av` you should add --oneshot in order to avoid that every package on the list gets added to the world file. [SNIP] > For example: > > daevid ~ # emerge -avu world | grep x11- > [ebuild U ] x11-misc/util-macros-1.1.2 [1.1.0] USE="-debug" 45 kB > [ebuild U ] x11-proto/inputproto-1.4 [1.3.2] USE="-debug" 47 kB > [ebuild U ] x11-proto/xproto-7.0.9 [7.0.7] USE="-debug" 138 kB > [ebuild U ] x11-libs/xtrans-1.0.2 [1.0.1] USE="-debug" 97 kB > [ebuild U ] x11-libs/libX11-1.0.3-r1 [1.0.3] USE="ipv6 -debug" 1,415 kB > ... > > I want to run some command that will give me a list like: > > x11-misc/util-macros x11-proto/inputproto x11-proto/xproto ... > > Then I could just select and copy that "string" and append it to "emerge > -av " I believe [1] should help you understand how this works...: # emerge -va1 $(emerge -pvu world | sed -n -r 's,^\[ebuild[^]]*\]\ (x11-[^\ ]*).*$,\1,p' | sed -r 's/-[^-]+(-r[0-9]+)*$//') [1] http://www.grymoire.com/Unix/Sed.html -- Bo Andresen [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" 2006-11-20 8:36 ` Bo Ørsted Andresen @ 2006-11-21 22:59 ` Daevid Vincent 0 siblings, 0 replies; 13+ messages in thread From: Daevid Vincent @ 2006-11-21 22:59 UTC (permalink / raw To: gentoo-user Thank you for the 'one liner'... I think it is exactly what I need. I'm trying it out lately and let you know... I did tweak it a smidge to be a little more flexible and robust: locutus ~ # cat /usr/local/bin/emerge_select #!/bin/sh if test -z $1; then echo "required search argument is missing." echo "For example, use 'x11' for all the X11 ebuilds." exit else emerge -va1 $(emerge -pvu world | \ sed -n -r 's,^\[ebuild[^]]*\]\ ('$1'[^\ ]*).*$,\1,p' | \ sed -r 's/-[^-]+(-r[0-9]+)*$//') \ || until emerge --resume --skipfirst; do :; done fi DÆVID > -----Original Message----- > From: Bo Ørsted Andresen [mailto:bo.andresen@zlin.dk] > Sent: Monday, November 20, 2006 12:37 AM > To: gentoo-user@lists.gentoo.org > Subject: Re: [gentoo-user] In need of script/command that > will parse out all the packages from "emerge -avu world" > > On Monday 20 November 2006 07:37, Daevid Vincent wrote: > > Wondering if someone has a script or shell 'one liner' that > can take the > > output of "emerge -avu world" and make a list of the > packages (I assume all > > on one line). Then I could pump that back into "emerge -av" > again (I don't > > mind if it's a simple manual highlight and copy/append). > > You need to replace --ask with --pretend when you send the > output into a pipe. > Otherwise it will wait for input. Also when you send it back > to `emerge -av` > you should add --oneshot in order to avoid that every package > on the list > gets added to the world file. > > [SNIP] > > For example: > > > > daevid ~ # emerge -avu world | grep x11- > > [ebuild U ] x11-misc/util-macros-1.1.2 [1.1.0] > USE="-debug" 45 kB > > [ebuild U ] x11-proto/inputproto-1.4 [1.3.2] USE="-debug" 47 kB > > [ebuild U ] x11-proto/xproto-7.0.9 [7.0.7] USE="-debug" 138 kB > > [ebuild U ] x11-libs/xtrans-1.0.2 [1.0.1] USE="-debug" 97 kB > > [ebuild U ] x11-libs/libX11-1.0.3-r1 [1.0.3] USE="ipv6 > -debug" 1,415 kB > > ... > > > > I want to run some command that will give me a list like: > > > > x11-misc/util-macros x11-proto/inputproto x11-proto/xproto ... > > > > Then I could just select and copy that "string" and append > it to "emerge > > -av " > > I believe [1] should help you understand how this works...: > > # emerge -va1 $(emerge -pvu world | > sed -n -r 's,^\[ebuild[^]]*\]\ (x11-[^\ ]*).*$,\1,p' | > sed -r 's/-[^-]+(-r[0-9]+)*$//') > > [1] http://www.grymoire.com/Unix/Sed.html > > -- > Bo Andresen > -- gentoo-user@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-11-21 23:04 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-11-20 6:37 [gentoo-user] In need of script/command that will parse out all the packages from "emerge -avu world" Daevid Vincent 2006-11-20 8:27 ` Mark M 2006-11-20 20:59 ` Richard Fish 2006-11-20 22:18 ` Daevid Vincent 2006-11-20 22:36 ` Boris Fersing 2006-11-21 0:15 ` b.n. 2006-11-21 1:41 ` Richard Fish 2006-11-21 22:59 ` b.n. 2006-11-20 22:50 ` Hans-Werner Hilse 2006-11-21 9:13 ` Mark M 2006-11-21 10:14 ` Bo Ørsted Andresen 2006-11-20 8:36 ` Bo Ørsted Andresen 2006-11-21 22:59 ` Daevid Vincent
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox