aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2011-08-31 23:07:12 +0000
committerGerald Combs <gerald@wireshark.org>2011-08-31 23:07:12 +0000
commit187919723fe68164b464f71cfacd8e228ff8848d (patch)
tree2c60abc0419adc67e23ad0698966438eaa091acb /tools
parent30ec5387fa7d6b62e72b4e95f30d21da8c20161a (diff)
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
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-services.pl31
1 files changed, 18 insertions, 13 deletions
diff --git a/tools/make-services.pl b/tools/make-services.pl
index 78e6371ebb..a78c1b20b5 100755
--- a/tools/make-services.pl
+++ b/tools/make-services.pl
@@ -26,7 +26,7 @@ use English;
my $svc_file = "services";
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(
^spr-itunes
^spl-itunes
@@ -67,23 +67,28 @@ if($in =~ m/^http:/i) {
my $line;
my $pat;
foreach $line (@in_lines) {
- chomp($line);
+ $prefix = "# ";
$exclude_match = 0;
- foreach $pat (@exclude_pats) {
- if ($line =~ $pat) {
- $exclude_match = 1;
- last;
+
+ if ($line =~ /^(\S+)\s+(\d+)\s+(tcp|udp|sctp|dccp)\s+(\S.*)/) {
+ $line = "$1 $2/$3 # $4";
+
+ foreach $pat (@exclude_pats) {
+ if ($line =~ $pat) {
+ $exclude_match = 1;
+ last;
+ }
}
- }
- if ($exclude_match) {
- if ($prefix eq "") {
+
+ if ($exclude_match) {
$body .= "# Excluded by $PROGRAM_NAME\n";
+ } else {
+ $prefix = "";
}
- $prefix = "# ";
- } else {
- $prefix = "";
}
-
+
+ $line =~ s/^\s+|\s+$//g;
+
$body .= $prefix . $line . "\n";
}
} elsif ($result->code eq 304) {