diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java index c284c5499323fa..e32a2decb18741 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java @@ -102,7 +102,7 @@ static Decompressor getDecompressor(Path archivePath) throws RepositoryFunctionE return TarXzFunction.INSTANCE; } else if (baseName.endsWith(".tar.zst") || baseName.endsWith(".tzst")) { return TarZstFunction.INSTANCE; - } else if (baseName.endsWith(".tar.bz2")) { + } else if (baseName.endsWith(".tar.bz2") || baseName.endsWith(".tbz")) { return TarBz2Function.INSTANCE; } else if (baseName.endsWith(".ar") || baseName.endsWith(".deb")) { return ArFunction.INSTANCE; @@ -110,7 +110,7 @@ static Decompressor getDecompressor(Path archivePath) throws RepositoryFunctionE throw new RepositoryFunctionException( Starlark.errorf( "Expected a file with a .zip, .jar, .war, .aar, .tar, .tar.gz, .tgz, .tar.xz, .txz," - + " .tar.zst, .tzst, .tar.bz2, .ar or .deb suffix (got %s)", + + " .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got %s)", archivePath), Transience.PERSISTENT); } diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java index e1c53456223812..b1d4a60ee2853d 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java @@ -569,7 +569,7 @@ public StructImpl download( + " the URL." + " If the file has no extension, you can explicitly specify either \"zip\"," + " \"jar\", \"war\", \"aar\", \"tar\", \"tar.gz\", \"tgz\", \"tar.xz\"," - + " \"txz\", \".tar.zst\", \".tzst\", \"tar.bz2\", \".ar\", or \".deb\"" + + " \"txz\", \".tar.zst\", \".tzst\", \"tar.bz2\", \".tbz\", \".ar\", or \".deb\"" + " here."), @Param( name = "stripPrefix", diff --git a/src/test/java/com/google/devtools/build/lib/bazel/repository/DecompressorValueTest.java b/src/test/java/com/google/devtools/build/lib/bazel/repository/DecompressorValueTest.java index 8357dc2790df00..755c381c8e7fe1 100644 --- a/src/test/java/com/google/devtools/build/lib/bazel/repository/DecompressorValueTest.java +++ b/src/test/java/com/google/devtools/build/lib/bazel/repository/DecompressorValueTest.java @@ -57,6 +57,8 @@ public void testKnownFileExtensionsDoNotThrow() throws Exception { unused = DecompressorValue.getDecompressor(path); path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.tar.bz2"); unused = DecompressorValue.getDecompressor(path); + path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.tbz"); + unused = DecompressorValue.getDecompressor(path); path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.ar"); unused = DecompressorValue.getDecompressor(path); path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.deb");