/[gentoo-perl]/genlop/trunk/genlop
Gentoo

Diff of /genlop/trunk/genlop

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 199 Revision 200
663 # FEATURES contains 'sandbox' and contains both 'userpriv' and 'usersandbox' 663 # FEATURES contains 'sandbox' and contains both 'userpriv' and 'usersandbox'
664 # 20050815 - JeR: On slow systems, running portageq takes a lot of time, 664 # 20050815 - JeR: On slow systems, running portageq takes a lot of time,
665 # sometimes enough to miss all the sandbox action completely. Better to 665 # sometimes enough to miss all the sandbox action completely. Better to
666 # not check for sanity and have users check their FEATURES instead. 666 # not check for sanity and have users check their FEATURES instead.
667 my @targets = (); 667 my @targets = ();
668 my @sandbox_pids = qx{ps --no-header -o pid -C sandbox}; 668 my @sandbox_pids = ();
669 my @sandbox_procs = qx{ps ax -o pid,args | tail -n +2 | sed -e's/^ *//' | grep ' sandbox ' | grep -v ' grep '};
669 my ($e_curmerge, $e_lastmerge); 670 my ($e_curmerge, $e_lastmerge);
671 foreach (@sandbox_procs)
672 {
673 if (m/^(.*?) \[(.*?)\-[0-9].*?\]/)
674 {
675 push @sandbox_pids, $1;
676 push @targets, $2;
677 }
678 }
670 if (scalar @sandbox_pids == 0) 679 if (scalar @sandbox_pids == 0)
671 { 680 {
672 print colored("!!!", $COLORS{'red'}); 681 print colored("!!!", $COLORS{'red'});
673 print " Error: no working merge found.\n"; 682 print " Error: no working merge found.\n";
674 print "(the -c option only works if there is" . " an ongoing compilation, see manpage)\n"; 683 print "(the -c option only works if there is" . " an ongoing compilation, see manpage)\n";
675 exit; 684 exit;
676 }
677 foreach my $pid (@sandbox_pids)
678 {
679 my $current;
680 chomp $pid;
681 $pid =~ s/\s//g;
682 open(my $cmdline, "/proc/$pid/cmdline");
683 while (<$cmdline>)
684 {
685 if ($_ =~ m/^\[(.*?)\-[0-9].*?\]/g)
686 {
687 $current = $1;
688 }
689 }
690 push @targets, $current;
691 } 685 }
692 if (scalar @targets == 0) 686 if (scalar @targets == 0)
693 { 687 {
694 print colored("!!!", $COLORS{'red'}); 688 print colored("!!!", $COLORS{'red'});
695 print "oops! should not happen, pease file bug\n"; 689 print "oops! should not happen, pease file bug\n";

Legend:
Removed from v.199  
changed lines
  Added in v.200

  ViewVC Help
Powered by ViewVC 1.1.20