Guide and scripts to locally build the FSFE website or single files of it
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

create-mime.assign.pl 461B

1234567891011121314151617181920
  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";