/[Sack]/trunk/bin/sack.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/sack.pl

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

revision 80 by dpavlin, Sat Sep 26 10:14:03 2009 UTC revision 81 by dpavlin, Sat Sep 26 10:40:05 2009 UTC
# Line 53  sub BEGIN { Line 53  sub BEGIN {
53                  #clean if $clean;       # FIXME                  #clean if $clean;       # FIXME
54                  die "SIG$signame";                  die "SIG$signame";
55          };          };
56    
57            sub port2color {
58                    my $port = shift;
59                    my $c = $port & 0x07;
60                    $c ||= 1; # no black
61                    $c |= 30;
62                    return "[\e[${c}m$port\e[0m]";
63            }
64    
65            $SIG{__WARN__} = sub {
66                    my @loc = caller(1);
67                    my $msg = join('', @_);
68                    $msg =~ s{\[(0|\d\d\d\d)\]}{port2color($1)}e;
69                    print STDOUT $msg;
70                    return 1;
71            };
72    
73  }  }
74    
75  use lib "$prefix/srv/Sack/lib/";  use lib "$prefix/srv/Sack/lib/";

Legend:
Removed from v.80  
changed lines
  Added in v.81

  ViewVC Help
Powered by ViewVC 1.1.26