aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_defs/pkg
diff options
context:
space:
mode:
authorGravatar Benjamin Staffin <benley@gmail.com>2015-11-24 09:21:45 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2015-11-24 14:41:50 +0000
commit3edf784879d20b86f1c80592d498444374479b94 (patch)
tree220b4a5c0d3b69fb79a127238245df708a0ef3c1 /tools/build_defs/pkg
parentd2eff4ea252b8da2f1e0fe2e12e07d83a53cdf9d (diff)
Generate proper filenames for .deb packages
Various tools will break if deb filenames don't follow the right format. Retains a symlink from the <rulename>.deb to the new filename for compatibility. -- Change-Id: Ib8ba5b61fcbfe95469f0d9296a932b2a468bc4c2 Reviewed-on: https://bazel-review.googlesource.com/#/c/2290 MOS_MIGRATED_REVID=108590335
Diffstat (limited to 'tools/build_defs/pkg')
-rw-r--r--tools/build_defs/pkg/pkg.bzl9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/build_defs/pkg/pkg.bzl b/tools/build_defs/pkg/pkg.bzl
index ccef540b32..89b97e9ff0 100644
--- a/tools/build_defs/pkg/pkg.bzl
+++ b/tools/build_defs/pkg/pkg.bzl
@@ -89,7 +89,7 @@ def _pkg_deb_impl(ctx):
"""The implementation for the pkg_deb rule."""
files = [ctx.file.data]
args = [
- "--output=" + ctx.outputs.out.path,
+ "--output=" + ctx.outputs.deb.path,
"--data=" + ctx.file.data.path,
"--package=" + ctx.attr.package,
"--architecture=" + ctx.attr.architecture,
@@ -155,9 +155,13 @@ def _pkg_deb_impl(ctx):
executable = ctx.executable._make_deb,
arguments = args,
inputs = files,
- outputs = [ctx.outputs.out],
+ outputs = [ctx.outputs.deb],
mnemonic="MakeDeb"
)
+ ctx.action(
+ command = "ln -s %s %s" % (ctx.outputs.deb.basename, ctx.outputs.out.path),
+ inputs = [ctx.outputs.deb],
+ outputs = [ctx.outputs.out])
# A rule for creating a tar file, see README.md
pkg_tar = rule(
@@ -219,5 +223,6 @@ pkg_deb = rule(
},
outputs = {
"out": "%{name}.deb",
+ "deb": "%{package}_%{version}_%{architecture}.deb",
},
executable = False)