From 1749a7b0ae943f6a208ffc3fd0f6e9506872c5b6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 29 Nov 2011 13:01:24 +0000 Subject: * download-using-manifests: use the Perl bindings. --- perl/lib/Nix/Store.pm | 6 +++++- perl/lib/Nix/Store.xs | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'perl/lib/Nix') diff --git a/perl/lib/Nix/Store.pm b/perl/lib/Nix/Store.pm index d96f8e9ab652..d5fc6eec590e 100644 --- a/perl/lib/Nix/Store.pm +++ b/perl/lib/Nix/Store.pm @@ -12,7 +12,11 @@ our %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); -our @EXPORT = qw(isValidPath topoSortPaths computeFSClosure followLinksToStorePath exportPaths); +our @EXPORT = qw( + isValidPath queryReferences queryPathInfo queryDeriver queryPathHash + topoSortPaths computeFSClosure followLinksToStorePath exportPaths + hashPath +); our $VERSION = '0.15'; diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs index aac7761cbd80..5256d1372fe2 100644 --- a/perl/lib/Nix/Store.xs +++ b/perl/lib/Nix/Store.xs @@ -159,3 +159,14 @@ void exportPaths(int fd, int sign, ...) } catch (Error & e) { croak(e.what()); } + + +SV * hashPath(char * algo, int base32, char * path) + PPCODE: + try { + Hash h = hashPath(parseHashType(algo), path).first; + string s = base32 ? printHash32(h) : printHash(h); + XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0))); + } catch (Error & e) { + croak(e.what()); + } -- cgit 1.4.1