modify script to try attempt --best and regular upx compression before giving up

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
master
kim (grufwub) 4 years ago
parent 0ecb89cec4
commit 32f55ae57f

@ -29,12 +29,22 @@ build_for() {
fi
echo "Attempting to compress ${filename}..."
cp "$filename" "${filename}.topack"
# First try compression with --best
cp "$filename" "${filename}.topack"
if (silent upx --best "${filename}.topack") && (silent upx -t "${filename}.topack"); then
echo "Succeeded with best compression levels!"
mv "${filename}.topack" "$filename"
else
rm "${filename}.topack"
# Failed! Before throwing in the towel, try regular compression levels
cp "$filename" "${filename}.topack"
if (silent upx "${filename}.topack") && (silent upx -t "${filename}.topack"); then
echo "Succeeded with regular compression levels!"
mv "${filename}.topack" "$filename"
else
echo "Failed!"
rm "${filename}.topack"
fi
fi
echo ""

Loading…
Cancel
Save