forked from osmocom/wireshark
Fix the format of the services file. The output from make-services.pl is
still uglier than a box of YouTube comments but transport name resolution seems to work now. Fixes bug 6274. svn path=/trunk/; revision=38829
This commit is contained in:
parent
30ec5387fa
commit
187919723f
|
@ -26,7 +26,7 @@ use English;
|
||||||
|
|
||||||
my $svc_file = "services";
|
my $svc_file = "services";
|
||||||
my $in = shift;
|
my $in = shift;
|
||||||
my $min_size = 800000; # Size was 833397 on 2010-10-04
|
my $min_size = 2000000; # Size was 2654612 on 2011-08-31
|
||||||
my @exclude_pats = qw(
|
my @exclude_pats = qw(
|
||||||
^spr-itunes
|
^spr-itunes
|
||||||
^spl-itunes
|
^spl-itunes
|
||||||
|
@ -67,22 +67,27 @@ if($in =~ m/^http:/i) {
|
||||||
my $line;
|
my $line;
|
||||||
my $pat;
|
my $pat;
|
||||||
foreach $line (@in_lines) {
|
foreach $line (@in_lines) {
|
||||||
chomp($line);
|
$prefix = "# ";
|
||||||
$exclude_match = 0;
|
$exclude_match = 0;
|
||||||
|
|
||||||
|
if ($line =~ /^(\S+)\s+(\d+)\s+(tcp|udp|sctp|dccp)\s+(\S.*)/) {
|
||||||
|
$line = "$1 $2/$3 # $4";
|
||||||
|
|
||||||
foreach $pat (@exclude_pats) {
|
foreach $pat (@exclude_pats) {
|
||||||
if ($line =~ $pat) {
|
if ($line =~ $pat) {
|
||||||
$exclude_match = 1;
|
$exclude_match = 1;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($exclude_match) {
|
if ($exclude_match) {
|
||||||
if ($prefix eq "") {
|
|
||||||
$body .= "# Excluded by $PROGRAM_NAME\n";
|
$body .= "# Excluded by $PROGRAM_NAME\n";
|
||||||
}
|
|
||||||
$prefix = "# ";
|
|
||||||
} else {
|
} else {
|
||||||
$prefix = "";
|
$prefix = "";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$line =~ s/^\s+|\s+$//g;
|
||||||
|
|
||||||
$body .= $prefix . $line . "\n";
|
$body .= $prefix . $line . "\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue