Skip to content

Instantly share code, notes, and snippets.

@jpf91
Created June 26, 2015 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpf91/8a647cb64512ee3b7c2f to your computer and use it in GitHub Desktop.
Save jpf91/8a647cb64512ee3b7c2f to your computer and use it in GitHub Desktop.
echo "$GCC_VERSION" | grep -qP "gcc-[\d\.]+$"
# Standard release
if [ $? = 0 ]
then
GCC_TARBALL="releases/${GCC_VERSION}/${GCC_VERSION}.tar.bz2"
if [ $(echo "$GCC_VERSION" | cut -c5-5) -gt "4" ]
then
PATCH_VERSION=$(echo "$GCC_VERSION" | cut -c5-5)
# Max supported gcc version in semaphore ci
if [ $(echo "$GCC_VERSION" | cut -c5-5) -gt "5" ]
then
HOST_PACKAGE="5"
else
HOST_PACKAGE=$(echo "$GCC_VERSION" | cut -c5-5)
fi
else
PATCH_VERSION=$(echo "$GCC_VERSION" | cut -c5-7)
HOST_PACKAGE=$(echo "$GCC_VERSION" | cut -c5-7)
fi
# Snapshot or RC
else
GCC_TARBALL="snapshots/$(echo "$GCC_VERSION" | cut -c5-)/${GCC_VERSION}.tar.bz2"
PATCH_VERSION=$(echo "$GCC_VERSION" | cut -c5-5)
HOST_PACKAGE="5"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment