Browse Source

[doc] create-mime.conf.pl -v for warnings

Do not issue warnings about duplicated entries unless called with -v

/etc/mime.types is not typically edited by the end user,
so the warning trace is noise to most end users.
master
Glenn Strauss 1 month ago
parent
commit
be8909833b
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      doc/scripts/create-mime.conf.pl

+ 5
- 1
doc/scripts/create-mime.conf.pl View File

@ -5,6 +5,10 @@
use strict;
# future: might use Getopt::Std, but this is simple enough for now
my $verbose = 0;
foreach (@ARGV) { $verbose = 1 if ($_ eq "-v"); }
# text/* subtypes to serve as "text/...; charset=utf-8"
# text/html IS NOT INCLUDED: html has its own method for defining charset
# (<meta>), but the standards specify that content-type in HTTP wins over
@ -130,7 +134,7 @@ sub add {
}
}
print STDERR "Duplicate mimetype: '${extension}' => '${mimetype}' (already have '${have}'), merging to 'application/octet-stream'\n";
print STDERR "Duplicate mimetype: '${extension}' => '${mimetype}' (already have '${have}'), merging to 'application/octet-stream'\n" if $verbose;
set ($extension, 'application/octet-stream');
} else {
set @_;


Loading…
Cancel
Save