Skip to content

Commit 682b871

Browse files
committed
bazel: make sure we accept **kwargs
Make sure we pass down all arguments
1 parent 44b315d commit 682b871

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

booking/tar.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
22
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
33
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
44

5-
def remap_tar(name, tar, old_prefix, new_prefix):
5+
def remap_tar(name, tar, old_prefix, new_prefix, **kwargs):
66
"""
77
Generate a new tar.gz from an existing one but change it's internal structure
88
@@ -15,6 +15,7 @@ def remap_tar(name, tar, old_prefix, new_prefix):
1515
tar: source .tar.gz label
1616
old_prefix: prefix in the source tar file
1717
new_prefix: prefix in the resulting tar file
18+
**kwargs: other arguments passed to native.genrule
1819
"""
1920
if old_prefix.startswith("/"):
2021
old_prefix = old_prefix[1:]
@@ -34,6 +35,7 @@ def remap_tar(name, tar, old_prefix, new_prefix):
3435
"mv {} {}".format(old_prefix, new_prefix), # map
3536
"tar -czf $$CWD/$@ `find . -type f`", # ignore empty directories
3637
]),
38+
**kwargs
3739
)
3840

3941
def pkg_tar_with_structure(name, srcs = [], **kwargs):
@@ -43,6 +45,7 @@ def pkg_tar_with_structure(name, srcs = [], **kwargs):
4345
Args:
4446
name: resulting label
4547
srcs: list of files, output of glob for instance
48+
**kwargs: other arguments passed to pkg_tar
4649
"""
4750
dirs = {}
4851

0 commit comments

Comments
 (0)