Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.4.0] Allow decompression of nupkg #23818

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ static Decompressor getDecompressor(Path archivePath) throws RepositoryFunctionE
if (baseName.endsWith(".zip")
|| baseName.endsWith(".jar")
|| baseName.endsWith(".war")
|| baseName.endsWith(".aar")) {
|| baseName.endsWith(".aar")
|| baseName.endsWith(".nupkg")) {
return ZipDecompressor.INSTANCE;
} else if (baseName.endsWith(".tar")) {
return TarFunction.INSTANCE;
Expand All @@ -118,8 +119,8 @@ static Decompressor getDecompressor(Path archivePath) throws RepositoryFunctionE
} else {
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, .tbz, .ar or .deb suffix (got %s)",
"Expected a file with a .zip, .jar, .war, .aar, .nupkg, .tar, .tar.gz, .tgz, .tar.xz,"
+ " , .tar.zst, .tzst, .tar.bz2, .tbz, .ar or .deb suffix (got %s)",
archivePath),
Transience.PERSISTENT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ public Object download(
The archive type of the downloaded file. By default, the archive type is \
determined from the file extension of 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", \
"aar", "nupkg", "tar", "tar.gz", "tgz", "tar.xz", "txz", ".tar.zst", \
".tzst", "tar.bz2", ".tbz", ".ar", or ".deb" here.
"""),
@Param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public void testKnownFileExtensionsDoNotThrow() throws Exception {
unused = DecompressorValue.getDecompressor(path);
path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.zip");
unused = DecompressorValue.getDecompressor(path);
path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.nupkg");
unused = DecompressorValue.getDecompressor(path);
path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.tar.gz");
unused = DecompressorValue.getDecompressor(path);
path = fs.getPath("/foo/.external-repositories/some-repo/bar.baz.tgz");
Expand Down
Loading