diff options
author | Jérôme Quelin <jquelin@mandriva.org> | 2010-02-10 16:45:41 +0000 |
---|---|---|
committer | Jérôme Quelin <jquelin@mandriva.org> | 2010-02-10 16:45:41 +0000 |
commit | 01eb051d4af0b9b322b8a21762b5a3f11047024e (patch) | |
tree | 947119554b73725e23ef08d76b6c2e42f9865410 /perl.req-from-meta | |
parent | 7770611e745f20814ff34569608edd630b8ab079 (diff) | |
download | rpm-setup-01eb051d4af0b9b322b8a21762b5a3f11047024e.tar rpm-setup-01eb051d4af0b9b322b8a21762b5a3f11047024e.tar.gz rpm-setup-01eb051d4af0b9b322b8a21762b5a3f11047024e.tar.bz2 rpm-setup-01eb051d4af0b9b322b8a21762b5a3f11047024e.tar.xz rpm-setup-01eb051d4af0b9b322b8a21762b5a3f11047024e.zip |
reverting commit r266103
Diffstat (limited to 'perl.req-from-meta')
-rwxr-xr-x | perl.req-from-meta | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perl.req-from-meta b/perl.req-from-meta index 243f54f..5b612dd 100755 --- a/perl.req-from-meta +++ b/perl.req-from-meta @@ -3,7 +3,8 @@ use strict; use warnings; -use YAML qw{ Load }; +use JSON qw{ from_json }; +use YAML qw{ Load }; # slurp the file my $path = shift; @@ -12,7 +13,9 @@ my $data = do { local $/; <$fh> }; close $fh; # parse meta - either yaml or json -my $meta = Load($data); +my $meta = $path =~ /\.yml$/ + ? Load( $data ) + : from_json( $data ); # dump the requires with their version my $requires = $meta->{requires}; |