… | |
… | |
761 | $meta = { |
761 | $meta = { |
762 | %{ $meta->{"" } || {} }, |
762 | %{ $meta->{"" } || {} }, |
763 | %{ $meta->{$file} || {} }, |
763 | %{ $meta->{$file} || {} }, |
764 | }; |
764 | }; |
765 | |
765 | |
766 | if ($meta->{license} =~ s/^#//) { |
766 | if (exists $meta->{license} && $meta->{license} =~ s/^#//) { # exists == avoid autovivification |
767 | $meta->{license} = ({ |
767 | $meta->{license} = ({ |
768 | "pd" => "Public Domain", |
768 | "pd" => "Public Domain", |
769 | "gpl" => "GNU General Public License, version 3.0 or any later", |
769 | "gpl" => "GNU General Public License, version 3.0 or any later", |
770 | "cc/by/2.0" => "Licensed under Creative Commons Attribution 2.0 http://creativecommons.org/licenses/by/2.0/", |
770 | "cc/by/2.0" => "Licensed under Creative Commons Attribution 2.0 http://creativecommons.org/licenses/by/2.0/", |
771 | "cc/by/2.1" => "Licensed under Creative Commons Attribution 2.1 http://creativecommons.org/licenses/by/2.1/", |
771 | "cc/by/2.1" => "Licensed under Creative Commons Attribution 2.1 http://creativecommons.org/licenses/by/2.1/", |
… | |
… | |
782 | $file =~ s/\.res$//; |
782 | $file =~ s/\.res$//; |
783 | $file =~ s/\.(ogg|wav|jpg|png)$//; |
783 | $file =~ s/\.(ogg|wav|jpg|png)$//; |
784 | |
784 | |
785 | if ($file =~ s/\.plt$//) { |
785 | if ($file =~ s/\.plt$//) { |
786 | $data = process_plt "$dir/$file", $data; |
786 | $data = process_plt "$dir/$file", $data; |
787 | } elsif (my $filter = $meta->{cfutil_filter}) { |
787 | } elsif (my $filter = delete $meta->{cfutil_filter}) { |
788 | if ($filter eq "yaml2json") { |
788 | if ($filter eq "yaml2json") { |
789 | $data = JSON::XS::encode_json YAML::XS::Load $data; |
789 | $data = JSON::XS::encode_json YAML::XS::Load $data; |
790 | } elsif ($filter eq "json2json") { |
790 | } elsif ($filter eq "json2json") { |
791 | $data = JSON::XS::encode_json JSON::XS->relaxed->utf8->decode ($data); |
791 | $data = JSON::XS::encode_json JSON::XS->relaxed->utf8->decode ($data); |
792 | } elsif ($filter eq "perl2json") { |
792 | } elsif ($filter eq "perl2json") { |
… | |
… | |
844 | if ($file =~ /\.(jpg|png)$/) { |
844 | if ($file =~ /\.(jpg|png)$/) { |
845 | $c_any->put ([\&process_res, $path, $file, 0]) # FT_FACE |
845 | $c_any->put ([\&process_res, $path, $file, 0]) # FT_FACE |
846 | } elsif ($file =~ /\.(res)$/) { |
846 | } elsif ($file =~ /\.(res)$/) { |
847 | $c_any->put ([\&process_res, $path, $file, 6]) # FT_RSRC |
847 | $c_any->put ([\&process_res, $path, $file, 6]) # FT_RSRC |
848 | } else { |
848 | } else { |
849 | $c_any->put ([\&process_res, $path, $file, undef]); |
849 | $c_any->put ([\&process_res, $path, $file, 6]); # was type undef, but now meta files are mandatory, so any mentioned file surely has a purpose |
850 | } |
850 | } |
851 | |
851 | |
852 | } elsif ($file =~ /\.png$/) { |
852 | } elsif ($file =~ /\.png$/) { |
853 | $PNG{$file} = $path; |
853 | $PNG{$file} = $path; |
854 | |
854 | |