mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-11 15:08:33 +01:00
Merge pull request #119406 from sternenseemann/toDerivation-list
lib/attrsets: make toDerivation x always work when isStorePath x
This commit is contained in:
commit
527861959b
|
@ -659,7 +659,7 @@ rec {
|
|||
Example:
|
||||
isStorePath "/nix/store/d945ibfx9x185xf04b890y4f9g3cbb63-python-2.7.11/bin/python"
|
||||
=> false
|
||||
isStorePath "/nix/store/d945ibfx9x185xf04b890y4f9g3cbb63-python-2.7.11/"
|
||||
isStorePath "/nix/store/d945ibfx9x185xf04b890y4f9g3cbb63-python-2.7.11"
|
||||
=> true
|
||||
isStorePath pkgs.python
|
||||
=> true
|
||||
|
@ -667,7 +667,7 @@ rec {
|
|||
=> false
|
||||
*/
|
||||
isStorePath = x:
|
||||
if isCoercibleToString x then
|
||||
if !(isList x) && isCoercibleToString x then
|
||||
let str = toString x; in
|
||||
substring 0 1 str == "/"
|
||||
&& dirOf str == storeDir
|
||||
|
|
Loading…
Reference in a new issue