Skip to content

Commit 439856a

Browse files
authored
Merge pull request #141 from kellyma2/tar2files
Do proper path join for strip_prefix
2 parents 4d58bc9 + 1236cf4 commit 439856a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

internal/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ bzl_library(
2222
name = "rpmtree",
2323
srcs = ["rpmtree.bzl"],
2424
visibility = ["//:__subpackages__"],
25-
deps = ["//bazeldnf:toolchain"],
25+
deps = [
26+
"//bazeldnf:toolchain",
27+
"@bazel_skylib//lib:paths",
28+
],
2629
)
2730

2831
bzl_library(

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)