aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_defs/pkg/pkg.bzl
diff options
context:
space:
mode:
authorGravatar Brian Silverman <bsilver16384@gmail.com>2015-11-06 14:28:37 +0000
committerGravatar Florian Weikert <fwe@google.com>2015-11-06 16:40:08 +0000
commita2c60d0594545ec266b23cf0122d664397b69b77 (patch)
tree4139165984bff8a0679ab028c0790dcb2f463be0 /tools/build_defs/pkg/pkg.bzl
parent619ad608ef1270461aade6608ae5f1371009e4b9 (diff)
Fix bash completion script location in the Debian package
It was ending up installed as /bazel. Also, the documented way of telling pkg_tar not to strip off the prefix didn't work. -- Change-Id: I593d17690526c614697369cab543aff1ba67de0a Reviewed-on: https://bazel-review.googlesource.com/#/c/2222/ MOS_MIGRATED_REVID=107229260
Diffstat (limited to 'tools/build_defs/pkg/pkg.bzl')
-rw-r--r--tools/build_defs/pkg/pkg.bzl8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/build_defs/pkg/pkg.bzl b/tools/build_defs/pkg/pkg.bzl
index d8a69644a0..399369cb1a 100644
--- a/tools/build_defs/pkg/pkg.bzl
+++ b/tools/build_defs/pkg/pkg.bzl
@@ -41,12 +41,12 @@ def _compute_data_path(out, data_path):
# There is no way to handle .// correctly (no function that would make
# that possible and Skylark is not turing complete) so just consider it
# as an absolute path.
- if data_path[0:2] == "./":
+ if len(data_path) >= 2 and data_path[0:2] == "./":
data_path = data_path[2:]
- if data_path[0] == "/": # Absolute path
- return data_path[1:]
- elif not data_path or data_path == ".": # Relative to current package
+ if not data_path or data_path == ".": # Relative to current package
return _short_path_dirname(out)
+ elif data_path[0] == "/": # Absolute path
+ return data_path[1:]
else: # Relative to a sub-directory
return _short_path_dirname(out) + "/" + data_path
else: