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

Stop using --strip on tar commands #2184

Merged
merged 1 commit into from
Feb 1, 2021
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
12 changes: 8 additions & 4 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,24 @@ getBinaryOpenjdk()
if [ -d "$SDKDIR/openjdkbinary/j2sdk-image/jre" ]; then
extract_dir="./j2sdk-image/jre"
fi
echo "unzip $jar_name in $extract_dir..."
echo "Uncompressing $jar_name over $extract_dir..."
if [[ $jar_name == *zip || $jar_name == *jar ]]; then
unzip -q $jar_name -d $extract_dir
else
# some debug-image tar has parent folder. --strip 1 is used to remove it
gzip -cd $jar_name | tar xof - -C $extract_dir --strip 1
# some debug-image tar has parent folder ... strip it
if tar --version 2>&1 | grep GNU 2>&1; then
gzip -cd $jar_name | tar xof - -C $extract_dir --strip 1
else
mkdir dir.$$ && cd dir.$$ && gzip -cd ../$jar_name | tar xof - && cd * && tar cf - . | (cd ../../$extract_dir && tar xpf -) && cd ../.. && rm -rf dir.$$
fi
fi
else
if [ -d "$SDKDIR/openjdkbinary/tmp" ]; then
rm -rf $SDKDIR/openjdkbinary/tmp/*
else
mkdir $SDKDIR/openjdkbinary/tmp
fi
echo "unzip file: $jar_name ..."
echo "Uncompressing file: $jar_name ..."
if [[ $jar_name == *zip || $jar_name == *jar ]]; then
unzip -q $jar_name -d ./tmp
elif [[ $jar_name == *.pax* ]]; then
Expand Down