aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/packages/self_extract_binary.bzl
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-08-31 12:22:29 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-08-31 19:13:41 +0000
commitea9a436b12f848edf47fabd391e2c50e87e08734 (patch)
treeafda5f9e6babf9adb11f886beebe57db73dda66d /scripts/packages/self_extract_binary.bzl
parent3a160e754eaa27be157f463c42ecea045906516f (diff)
Add the tools/defaults/BUILD file to the installer script
This file is a dummy and cannot be extracted from the Bazel workspace so create it. -- MOS_MIGRATED_REVID=101925956
Diffstat (limited to 'scripts/packages/self_extract_binary.bzl')
-rw-r--r--scripts/packages/self_extract_binary.bzl7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/packages/self_extract_binary.bzl b/scripts/packages/self_extract_binary.bzl
index 60928f6358..4aa30fe0d4 100644
--- a/scripts/packages/self_extract_binary.bzl
+++ b/scripts/packages/self_extract_binary.bzl
@@ -36,6 +36,10 @@ def _self_extract_binary(ctx):
"""Implementation for the self_extract_binary rule."""
# This is a bit complex for stripping out timestamps
zip_artifact = ctx.new_file(ctx.label.name + ".zip")
+ touch_empty_files = [
+ "mkdir -p $(dirname ${tmpdir}/%s); touch ${tmpdir}/%s" % (f, f)
+ for f in ctx.attr.empty_files
+ ]
cp_resources = [
("mkdir -p $(dirname ${tmpdir}/%s)\n" % r.short_path +
"cp %s ${tmpdir}/%s" % (r.path, r.short_path))
@@ -51,7 +55,7 @@ def _self_extract_binary(ctx):
command = "\n".join([
"tmpdir=$(mktemp -d ${TMPDIR:-/tmp}/tmp.XXXXXXXX)",
"trap \"rm -fr ${tmpdir}\" EXIT"
- ] + cp_resources + cp_flatten_resources + [
+ ] + touch_empty_files + cp_resources + cp_flatten_resources + [
"find ${tmpdir} -exec touch -t 198001010000.00 '{}' ';'",
"(d=${PWD}; cd ${tmpdir}; zip -rq ${d}/%s *)" % zip_artifact.path,
]),
@@ -77,6 +81,7 @@ self_extract_binary = rule(
mandatory=True,
allow_files=True,
single_file=True),
+ "empty_files": attr.string_list(default=[]),
"resources": attr.label_list(
default=[],
allow_files=True),