Fix strip_prefix
Fixes #221.
--
MOS_MIGRATED_REVID=104499510
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/NewHttpArchiveFunction.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/NewHttpArchiveFunction.java
index 295a833..87688c7 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/NewHttpArchiveFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/NewHttpArchiveFunction.java
@@ -81,9 +81,9 @@
try {
AggregatingAttributeMapper mapper = AggregatingAttributeMapper.of(rule);
String prefix = null;
- if (mapper.has("rm_path_prefix", Type.STRING)
- && !mapper.get("rm_path_prefix", Type.STRING).isEmpty()) {
- prefix = mapper.get("rm_path_prefix", Type.STRING);
+ if (mapper.has("strip_prefix", Type.STRING)
+ && !mapper.get("strip_prefix", Type.STRING).isEmpty()) {
+ prefix = mapper.get("strip_prefix", Type.STRING);
}
decompressed = (DecompressorValue) env.getValueOrThrow(
DecompressorValue.key(rule.getTargetKind(), rule.getName(),
diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh
index b0c709b..638d88a 100755
--- a/src/test/shell/bazel/external_integration_test.sh
+++ b/src/test/shell/bazel/external_integration_test.sh
@@ -512,7 +512,7 @@
name = "x",
url = "http://localhost:$nc_port/x.tar.gz",
sha256 = "$sha256",
- rm_path_prefix = "x/y/z",
+ strip_prefix = "x/y/z",
build_file = "x.BUILD",
)
EOF