Guide and scripts to locally build the FSFE website or single files of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
461B

  1. #!/usr/bin/perl -w
  2. use strict;
  3. open MIMETYPES, "/etc/mime.types" or exit;
  4. print "mimetype.assign = (\n";
  5. my %extensions;
  6. while(<MIMETYPES>) {
  7. chomp;
  8. s/\#.*//;
  9. next if /^\w*$/;
  10. if(/^([a-z0-9\/+-.]+)\s+((?:[a-z0-9.+-]+[ ]?)+)$/) {
  11. foreach(split / /, $2) {
  12. # mime.types can have same extension for different
  13. # mime types
  14. next if $extensions{$_};
  15. $extensions{$_} = 1;
  16. print "\".$_\" => \"$1\",\n";
  17. }
  18. }
  19. }
  20. print ")\n";