Skip to content

Commit

Permalink
Add support for decompression of tar.xz in get.sh (#5762)
Browse files Browse the repository at this point in the history
* Add support for decompression tar.xz in get.sh

Signed-off-by: Stewart X Addison <[email protected]>

* De-duplicate setting of DECOMPRESS_TOOL

Signed-off-by: Stewart X Addison <[email protected]>

---------

Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa authored Nov 20, 2024
1 parent e12ddde commit 22677f8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ getBinaryOpenjdk()
for file_name in "${jdk_file_array[@]}"
do
if [[ ! "$file_name" =~ "sbom" ]]; then
if [[ $file_name == *xz ]]; then
DECOMPRESS_TOOL=xz
else
# Noting that this will be set, but not used, for zip files
DECOMPRESS_TOOL=gzip
fi
if [[ "$file_name" =~ "debug-image" ]] || [[ "$file_name" =~ "debugimage" ]] || [[ "$file_name" =~ "symbols-" ]]; then
# if file_name contains debug-image, extract into j2sdk-image/jre or j2sdk-image dir
# Otherwise, files will be extracted under ./tmp
Expand All @@ -415,7 +421,7 @@ getBinaryOpenjdk()
if [[ $file_name == *zip ]] || [[ $file_name == *jar ]]; then
unzip -q ../$file_name
else
gzip -cd ../$file_name | tar xof -
$DECOMPRESS_TOOL -cd ../$file_name | tar xof -
fi

# Remove 1 possibly 2 top-level folders (debugimage has 2)
Expand All @@ -437,7 +443,7 @@ getBinaryOpenjdk()
cd ./tmp
pax -p xam -rzf ../$file_name
else
gzip -cd $file_name | (cd tmp && tar xof -)
$DECOMPRESS_TOOL -cd $file_name | (cd tmp && tar xof -)
fi

cd $SDKDIR/jdkbinary/tmp
Expand Down

0 comments on commit 22677f8

Please sign in to comment.