From e73d9e948887621906363a35c980538294898a02 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 Mar 2013 00:27:32 +0100 Subject: Fix annoying Perl 5.16 warnings I.e. Subroutine Nix::Store::isValidPath redefined at /nix/store/clfzsf6gi7qh5i9c0vks1ifjam47rijn-perl-5.16.2/lib/perl5/5.16.2/XSLoader.pm line 92. and so on. --- perl/lib/Nix/Store.pm | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'perl/lib/Nix/Store.pm') diff --git a/perl/lib/Nix/Store.pm b/perl/lib/Nix/Store.pm index 2e79c74fe290..191116ee5637 100644 --- a/perl/lib/Nix/Store.pm +++ b/perl/lib/Nix/Store.pm @@ -42,50 +42,50 @@ if ($Nix::Config::useBindings) { use File::Temp; use Fcntl qw/F_SETFD/; - sub hashFile { + *hashFile = sub { my ($algo, $base32, $path) = @_; my $res = backtick("$Nix::Config::binDir/nix-hash", "--flat", $path, "--type", $algo, $base32 ? "--base32" : ()); chomp $res; return $res; - } - - sub hashPath { + }; + + *hashPath = sub { my ($algo, $base32, $path) = @_; my $res = backtick("$Nix::Config::binDir/nix-hash", $path, "--type", $algo, $base32 ? "--base32" : ()); chomp $res; return $res; - } - - sub hashString { + }; + + *hashString = sub { my ($algo, $base32, $s) = @_; my $fh = File::Temp->new(); print $fh $s; my $res = backtick("$Nix::Config::binDir/nix-hash", $fh->filename, "--type", $algo, $base32 ? "--base32" : ()); chomp $res; return $res; - } - - sub addToStore { + }; + + *addToStore = sub { my ($srcPath, $recursive, $algo) = @_; die "not implemented" if $recursive || $algo ne "sha256"; my $res = backtick("$Nix::Config::binDir/nix-store", "--add", $srcPath); chomp $res; return $res; - } - - sub isValidPath { + }; + + *isValidPath = sub { my ($path) = @_; my $res = backtick("$Nix::Config::binDir/nix-store", "--check-validity", "--print-invalid", $path); chomp $res; return $res ne $path; - } - - sub queryPathHash { + }; + + *queryPathHash = sub { my ($path) = @_; my $res = backtick("$Nix::Config::binDir/nix-store", "--query", "--hash", $path); chomp $res; return $res; - } + }; } 1; -- cgit 1.4.1