mirror of
https://github.com/Mic92/nix-update.git
synced 2024-11-03 21:04:49 +03:00
Try pkg.meta.position before unsafeGetAttrPos
Fixes `nixpkgs.mpvScripts.*`, discovered while reviewing https://github.com/NixOS/nixpkgs/pull/308062
This commit is contained in:
parent
cafad8ced8
commit
63b5a4e989
@ -142,13 +142,22 @@ def eval_expression(
|
||||
return f"""
|
||||
let
|
||||
{indent(dedent(let_bindings), " ")}
|
||||
positionFromMeta = pkg: let
|
||||
parts = builtins.match "(.*):([0-9]+)" pkg.meta.position;
|
||||
in {{
|
||||
file = builtins.elemAt parts 0;
|
||||
line = builtins.fromJSON (builtins.elemAt parts 1);
|
||||
}};
|
||||
|
||||
raw_version_position = sanitizePosition (builtins.unsafeGetAttrPos "version" pkg);
|
||||
|
||||
position = if pkg ? isRubyGem then
|
||||
position = if pkg ? meta.position then
|
||||
sanitizePosition (positionFromMeta pkg)
|
||||
else if pkg ? isRubyGem then
|
||||
raw_version_position
|
||||
else if pkg ? isPhpExtension then
|
||||
raw_version_position
|
||||
else
|
||||
else
|
||||
sanitizePosition (builtins.unsafeGetAttrPos "src" pkg);
|
||||
in {{
|
||||
name = pkg.name;
|
||||
|
Loading…
Reference in New Issue
Block a user