Skip to content

Commit 6e2c85c

Browse files
committed
Do proper path join for strip_prefix
In some cases there's a `/` at the end of `bin_dir.path` and in some cases there isn't. Using `paths.join()` should deal properly with both cases.
1 parent 4d58bc9 commit 6e2c85c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/rpmtree.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ rpm files into either a .tar or extract files from that tar to
1919
make available to bazel
2020
"""
2121

22+
load("@bazel_skylib//lib:paths.bzl", "paths")
2223
load("//bazeldnf:toolchain.bzl", "BAZELDNF_TOOLCHAIN")
2324
load("//internal:rpm.bzl", "RpmInfo")
2425

@@ -72,7 +73,11 @@ def _expand_path(files):
7273

7374
def _tar2files_impl(ctx):
7475
args = ctx.actions.args()
75-
strip_prefix = ctx.bin_dir.path + ctx.label.package + "/" + ctx.label.name
76+
strip_prefix = paths.join(
77+
ctx.bin_dir.path,
78+
ctx.label.package,
79+
ctx.label.name,
80+
)
7681

7782
args.set_param_file_format("multiline")
7883
args.use_param_file("@%s")

0 commit comments

Comments
 (0)