#!/usr/bin/perl use strict; use warnings; use diagnostics; my $pline; while () { chomp; $pline= ""; # if (/^(.*?): /) { if (/^(.*?): === Unmerging\.\.\. \((.*)\)/) { $pline= $1.": starting uninstall of package $2::installed (1 of 1)"; } if (/^(.*?): >>> unmerge success: (.*)/) { $pline= $1.": finished uninstall of package $2::installed (1 of 1)"; } if (/^(.*?): >>> emerge (\(.*? of .*?\)) (.*?) to .*/) { $pline= $1.": starting install of package $3::gentoo $2"; } if (/^(.*?): ::: completed emerge (\(.*? of .*?\)) (.*?) to .*/) { $pline= $1.": finished install of package $3::gentoo $2"; } if (/^(.*?): >>> Starting rsync with (.*)/) { $pline= $1.": starting sync of repository gentoo (1 of 1)"; } if (/^(.*?): === Sync completed with (.*)/) { $pline= $1.": finished sync of repository gentoo (1 of 1)"; } print "$pline\n" unless $pline eq ""; }