mirror of
https://github.com/wentasah/ros2nix.git
synced 2025-06-09 15:52:23 +03:00
Use "non-cone mode" for --use-per-package-src
In cone mode (before this commit), the fetched sources contained not only the specified subdirectory, but also the files in all its parent directories. Non-cone mode means, that only the specified subdirectory is fetched.
This commit is contained in:
parent
3567e9e85a
commit
5053709228
1 changed files with 4 additions and 2 deletions
|
@ -430,7 +430,7 @@ def ros2nix(args):
|
|||
subprocess.check_output(
|
||||
["nix-prefetch-git", "--quiet"]
|
||||
+ (
|
||||
["--sparse-checkout", prefix]
|
||||
["--sparse-checkout", prefix, "--non-cone-mode"]
|
||||
if prefix and args.use_per_package_src
|
||||
else []
|
||||
)
|
||||
|
@ -440,7 +440,9 @@ def ros2nix(args):
|
|||
git_cache[toplevel] = info
|
||||
|
||||
match = re.match("https://github.com/(?P<owner>[^/]*)/(?P<repo>.*?)(.git|/.*)?$", url)
|
||||
sparse_checkout = f"sparseCheckout = [\"{prefix}\"];" if (prefix and args.use_per_package_src) else ""
|
||||
sparse_checkout = f"""sparseCheckout = ["{prefix}"];
|
||||
nonConeMode = true;""" if prefix and args.use_per_package_src else ""
|
||||
|
||||
if match is not None:
|
||||
kwargs["src_param"] = "fetchFromGitHub"
|
||||
kwargs["src_expr"] = strip_empty_lines(dedent(f'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue