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

Add support for decompression of tar.xz in get.sh #5762

Merged
merged 3 commits into from
Nov 20, 2024
Merged
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
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the check more specific? Instead of checking xz, check
if [[ $file_name == *.tar.xz ]]; then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary reason for not doing that is that .txz is also used by some people (same as .tgz is often used as a shorted .tar.gz), so this would catch that situation too .

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