diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-19 15:54:50 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-19 15:54:50 +0000 |
commit | d5af5763cff2811f6f8c0786c5bf9dd6a61b8669 (patch) | |
tree | bfccbcbe91a99e3f081f64c746ff2916b43448b0 /perl/lib/Nix/Store.xs | |
parent | 02639716eae1af1c2cbbb1760a14d055f23d1ff5 (diff) | |
parent | 1c8b550e34414d0f4cb0fa20322a2dfe06ce2de0 (diff) |
Merge branch 'master' of github.com:NixOS/nix into remove-storetype-delegate-regStore
Diffstat (limited to 'perl/lib/Nix/Store.xs')
-rw-r--r-- | perl/lib/Nix/Store.xs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs index f14c3f73f..4e038866e 100644 --- a/perl/lib/Nix/Store.xs +++ b/perl/lib/Nix/Store.xs @@ -224,7 +224,7 @@ SV * hashString(char * algo, int base32, char * s) SV * convertHash(char * algo, char * s, int toBase32) PPCODE: try { - Hash h(s, parseHashType(algo)); + auto h = Hash::parseAny(s, parseHashType(algo)); string s = h.to_string(toBase32 ? Base32 : Base16, false); XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0))); } catch (Error & e) { @@ -285,7 +285,7 @@ SV * addToStore(char * srcPath, int recursive, char * algo) SV * makeFixedOutputPath(int recursive, char * algo, char * hash, char * name) PPCODE: try { - Hash h(hash, parseHashType(algo)); + auto h = Hash::parseAny(hash, parseHashType(algo)); auto method = recursive ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat; auto path = store()->makeFixedOutputPath(method, h, name); XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(path).c_str(), 0))); @@ -303,8 +303,11 @@ SV * derivationFromPath(char * drvPath) hash = newHV(); HV * outputs = newHV(); - for (auto & i : drv.outputs) - hv_store(outputs, i.first.c_str(), i.first.size(), newSVpv(store()->printStorePath(i.second.path).c_str(), 0), 0); + for (auto & i : drv.outputsAndPaths(*store())) + hv_store( + outputs, i.first.c_str(), i.first.size(), + newSVpv(store()->printStorePath(i.second.second).c_str(), 0), + 0); hv_stores(hash, "outputs", newRV((SV *) outputs)); AV * inputDrvs = newAV(); |