Skip to content

Commit

Permalink
escape attribute for special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
dmadisetti committed Apr 4, 2023
1 parent 42fc158 commit 0dccf1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -482,17 +482,17 @@ def _nixpkgs_package_impl(repository_ctx):
nix_file = cp(repository_ctx, repository_ctx.attr.nix_file)
default_nix_substs = {
"%{def}": "import /${\"%s\"}" % repository_ctx.path(nix_file),
"%{maybe_attr}": (".%s" % attribute_path) if attribute_path else "",
"%{maybe_attr}": (".\"${%s}\"" % attribute_path) if attribute_path else "",
}
elif repository_ctx.attr.nix_file_content:
default_nix_substs = {
"%{def}": repository_ctx.attr.nix_file_content,
"%{maybe_attr}": (".%s" % attribute_path) if attribute_path else "",
"%{maybe_attr}": (".\"${%s}\"" % attribute_path) if attribute_path else "",
}
else:
default_nix_substs = {
"%{def}": "import <nixpkgs> { config = {}; overlays = []; }",
"%{maybe_attr}": ".%s" % (attribute_path or repository_ctx.attr.name),
"%{maybe_attr}": ".\"${%s}\"" % (attribute_path or repository_ctx.attr.name),
}

nix_file_deps = {}
Expand Down

0 comments on commit 0dccf1d

Please sign in to comment.