Skip to content

Commit

Permalink
Try pkg.meta.position after unsafeGetAttrPos
Browse files Browse the repository at this point in the history
`meta.position` is prone to point at files where `src` and `version` is not contained, as is the case for overridden packages and packages that use a generic builder.
  • Loading branch information
pbsds authored and mergify[bot] committed Aug 10, 2024
1 parent f6f817b commit 0785ad8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nix_update/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ def eval_expression(
raw_version_position = sanitizePosition (builtins.unsafeGetAttrPos "version" pkg);
position = if pkg ? meta.position then
sanitizePosition (positionFromMeta pkg)
else if pkg ? isRubyGem then
position = if pkg ? isRubyGem then
raw_version_position
else if pkg ? isPhpExtension then
raw_version_position
else if (builtins.unsafeGetAttrPos "src" pkg) != null then
sanitizePosition (builtins.unsafeGetAttrPos "src" pkg)
else
sanitizePosition (builtins.unsafeGetAttrPos "src" pkg);
sanitizePosition (positionFromMeta pkg);
in {{
name = pkg.name;
old_version = pkg.version or (builtins.parseDrvName pkg.name).version;
Expand Down

0 comments on commit 0785ad8

Please sign in to comment.