Basicly it removes the "ebuild U "(or what ever else is there)
from the begining and version numbers from the end of the
list of files genterated by `emerge -p > file.txt`
#!/usr/bin/perl #this program was created by John teBokkel aka Tanj #the program is used to remove "[ebuild N ]" from #the dependency list from `emerge -p packageName > file.txt` #also it removes version information from the end of the ebuild name use strict; our($garbage,$string,$file,$newfile); $file=$ARGV[0]; $newfile=$ARGV[1]; unless($file and $newfile) { die "missing argument\nagr1 source agr2 destination\n"; } open(FILE,"$file") || die "no such file\nagr1 source agr2 destination\ +n"; open(WORK,">$newfile") || die "could not create file\nagr1 source agr2 + destination\n"; while(<FILE>) { $garbage=s/\[(.*?)\]//; s/\-\d(.*?)\n//; $string=$_ . "\n"; if($garbage==1) { print WORK "$string"; } } close FILE; close WORK; print "done\n";
turns this
These are the packages that I would merge, in order: Calculating world dependencies *** Package in world file is not installed: kde-base/kde  ...done! [ebuild U ] media-sound/alsa-utils-0.9.0_rc8-r1 [0.9.0_rc8] [ebuild U ] sys-apps/file-3.41 [3.39] [ebuild U ] net-print/hpijs-1.3.1 [1.3] [ebuild U ] sys-apps/console-tools-0.3.2 [0.2.3-r4] [ebuild U ] media-sound/alsa-driver-0.9.0_rc8-r1 [0.9.0_rc8]
into this
media-sound/alsa-utils sys-apps/file net-print/hpijs sys-apps/console-tools media-sound/alsa-driver

In reply to Gentoo Linux `emerge -p package >file` by Tanj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.