diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2015-08-31 12:22:29 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-08-31 19:13:41 +0000 |
commit | ea9a436b12f848edf47fabd391e2c50e87e08734 (patch) | |
tree | afda5f9e6babf9adb11f886beebe57db73dda66d /scripts | |
parent | 3a160e754eaa27be157f463c42ecea045906516f (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')
-rw-r--r-- | scripts/packages/BUILD | 1 | ||||
-rw-r--r-- | scripts/packages/self_extract_binary.bzl | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/scripts/packages/BUILD b/scripts/packages/BUILD index 0364718a75..9159ac0809 100644 --- a/scripts/packages/BUILD +++ b/scripts/packages/BUILD @@ -29,6 +29,7 @@ load("self_extract_binary", "self_extract_binary") self_extract_binary( name = "install.sh", + empty_files = ["tools/defaults/BUILD"], flatten_resources = ["//src:bazel"], launcher = ":launcher_bin.sh", resources = [ 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), |