diff options
Diffstat (limited to 'maintainers/scripts')
-rw-r--r-- | maintainers/scripts/nix-generate-from-cpan.nix | 2 | ||||
-rwxr-xr-x | maintainers/scripts/nix-generate-from-cpan.pl | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/maintainers/scripts/nix-generate-from-cpan.nix b/maintainers/scripts/nix-generate-from-cpan.nix index 59a9b89bbe7c2..fffe11f1a5fc7 100644 --- a/maintainers/scripts/nix-generate-from-cpan.nix +++ b/maintainers/scripts/nix-generate-from-cpan.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation { name = "nix-generate-from-cpan-1"; - buildInputs = [ makeWrapper perl perlPackages.YAML perlPackages.JSON ]; + buildInputs = [ makeWrapper perl perlPackages.YAMLLibYAML perlPackages.JSON ]; unpackPhase = "true"; buildPhase = "true"; diff --git a/maintainers/scripts/nix-generate-from-cpan.pl b/maintainers/scripts/nix-generate-from-cpan.pl index 86749bcac6906..1eb6c51a16af1 100755 --- a/maintainers/scripts/nix-generate-from-cpan.pl +++ b/maintainers/scripts/nix-generate-from-cpan.pl @@ -2,7 +2,7 @@ use strict; use CPANPLUS::Backend; -use YAML; +use YAML::XS; use JSON; my $module_name = $ARGV[0]; @@ -50,7 +50,13 @@ print STDERR "unpacked to: $pkg_path\n"; my $meta; if (-e "$pkg_path/META.yml") { - $meta = YAML::LoadFile("$pkg_path/META.yml"); + eval { + $meta = YAML::XS::LoadFile("$pkg_path/META.yml"); + }; + if ($@) { + system("iconv -f windows-1252 -t utf-8 '$pkg_path/META.yml' > '$pkg_path/META.yml.tmp'"); + $meta = YAML::XS::LoadFile("$pkg_path/META.yml.tmp"); + } } print STDERR "metadata: ", encode_json($meta), "\n"; |