Skip to content

Commit

Permalink
chore: support for AL2023
Browse files Browse the repository at this point in the history
chore: support for AL2023
  • Loading branch information
Jefferson authored and riosje committed May 8, 2023
1 parent 0c4edf5 commit 07acca8
Show file tree
Hide file tree
Showing 24 changed files with 624 additions and 168 deletions.
33 changes: 26 additions & 7 deletions rpm/setup
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,28 @@ fi
#-check-distro-#

## Check distro and arch
echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
##echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
##DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
PKG_LIST=(
"redhat-release"
"centos-release"
"cloudlinux-release"
"sl-release"
"fedora-release"
"system-release"
)
echo "+ uname -m"
UNAME_ARCH=$(uname -m)

for PKG in "${PKG_LIST[@]}"; do
rpm -q --whatprovides ${PKG}
if [ $? -eq 0 ]; then
echo "exec ${PKG}"
DISTRO_PKG=$(rpm -q --whatprovides ${PKG})
echo "Release package: ""${DISTRO_PKG}"
break
fi
done

if [ "X${UNAME_ARCH}" == "Xi686" ]; then
DIST_ARCH=i386
Expand All @@ -210,32 +227,34 @@ fi

if [[ $DISTRO_PKG =~ ^(redhat|centos|almalinux|rocky|cloudlinux|mageia|sl)- ]]; then
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^system-release-(2023) ]]; then # Amazon Linux 2023 and possibly 2025
DIST_TYPE=al
elif [[ $DISTRO_PKG =~ ^(enterprise|system)-release- ]]; then # Oracle Linux & Amazon Linux
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^(fedora|korora)- ]]; then
DIST_TYPE=fc
elif [[ $DISTRO_PKG =~ fedora-release- ]]; then
DIST_TYPE=fc
else

print_status "\
You don't appear to be running a supported version of Enterprise Linux. \
Please contact NodeSource at \
https://github.com/nodesource/distributions/issues if you think this is \
incorrect or would like your architecture to be considered for support. \
Include your 'distribution package' name: ${DISTRO_PKG}. \
Include your 'distribution package' name in the list: ${PKG_LIST[*]}. \
"
exit 1

fi

if [[ $DISTRO_PKG =~ ^system-release ]]; then
if [[ $DISTRO_PKG =~ ^system-release-2-14 ]]; then

# Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
DIST_VERSION=7
elif [[ $DISTRO_PKG =~ ^system-release-2023 ]]; then

# Amazon Linux 2023
DIST_VERSION=2023
else

## Using the redhat-release-server-X, centos-release-X, centos-stream-release-X, etc. pattern
## extract the major version number of the distro
if [[ $DIST_TYPE =~ fc ]]; then
Expand Down
33 changes: 26 additions & 7 deletions rpm/setup_0.10
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,28 @@ fi
#-check-distro-#

## Check distro and arch
echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
##echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
##DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
PKG_LIST=(
"redhat-release"
"centos-release"
"cloudlinux-release"
"sl-release"
"fedora-release"
"system-release"
)
echo "+ uname -m"
UNAME_ARCH=$(uname -m)

for PKG in "${PKG_LIST[@]}"; do
rpm -q --whatprovides ${PKG}
if [ $? -eq 0 ]; then
echo "exec ${PKG}"
DISTRO_PKG=$(rpm -q --whatprovides ${PKG})
echo "Release package: ""${DISTRO_PKG}"
break
fi
done

if [ "X${UNAME_ARCH}" == "Xi686" ]; then
DIST_ARCH=i386
Expand All @@ -210,32 +227,34 @@ fi

if [[ $DISTRO_PKG =~ ^(redhat|centos|almalinux|rocky|cloudlinux|mageia|sl)- ]]; then
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^system-release-(2023) ]]; then # Amazon Linux 2023 and possibly 2025
DIST_TYPE=al
elif [[ $DISTRO_PKG =~ ^(enterprise|system)-release- ]]; then # Oracle Linux & Amazon Linux
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^(fedora|korora)- ]]; then
DIST_TYPE=fc
elif [[ $DISTRO_PKG =~ fedora-release- ]]; then
DIST_TYPE=fc
else

print_status "\
You don't appear to be running a supported version of Enterprise Linux. \
Please contact NodeSource at \
https://github.com/nodesource/distributions/issues if you think this is \
incorrect or would like your architecture to be considered for support. \
Include your 'distribution package' name: ${DISTRO_PKG}. \
Include your 'distribution package' name in the list: ${PKG_LIST[*]}. \
"
exit 1

fi

if [[ $DISTRO_PKG =~ ^system-release ]]; then
if [[ $DISTRO_PKG =~ ^system-release-2-14 ]]; then

# Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
DIST_VERSION=7
elif [[ $DISTRO_PKG =~ ^system-release-2023 ]]; then

# Amazon Linux 2023
DIST_VERSION=2023
else

## Using the redhat-release-server-X, centos-release-X, centos-stream-release-X, etc. pattern
## extract the major version number of the distro
if [[ $DIST_TYPE =~ fc ]]; then
Expand Down
33 changes: 26 additions & 7 deletions rpm/setup_0.12
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,28 @@ fi
#-check-distro-#

## Check distro and arch
echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
##echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
##DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
PKG_LIST=(
"redhat-release"
"centos-release"
"cloudlinux-release"
"sl-release"
"fedora-release"
"system-release"
)
echo "+ uname -m"
UNAME_ARCH=$(uname -m)

for PKG in "${PKG_LIST[@]}"; do
rpm -q --whatprovides ${PKG}
if [ $? -eq 0 ]; then
echo "exec ${PKG}"
DISTRO_PKG=$(rpm -q --whatprovides ${PKG})
echo "Release package: ""${DISTRO_PKG}"
break
fi
done

if [ "X${UNAME_ARCH}" == "Xi686" ]; then
DIST_ARCH=i386
Expand All @@ -210,32 +227,34 @@ fi

if [[ $DISTRO_PKG =~ ^(redhat|centos|almalinux|rocky|cloudlinux|mageia|sl)- ]]; then
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^system-release-(2023) ]]; then # Amazon Linux 2023 and possibly 2025
DIST_TYPE=al
elif [[ $DISTRO_PKG =~ ^(enterprise|system)-release- ]]; then # Oracle Linux & Amazon Linux
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^(fedora|korora)- ]]; then
DIST_TYPE=fc
elif [[ $DISTRO_PKG =~ fedora-release- ]]; then
DIST_TYPE=fc
else

print_status "\
You don't appear to be running a supported version of Enterprise Linux. \
Please contact NodeSource at \
https://github.com/nodesource/distributions/issues if you think this is \
incorrect or would like your architecture to be considered for support. \
Include your 'distribution package' name: ${DISTRO_PKG}. \
Include your 'distribution package' name in the list: ${PKG_LIST[*]}. \
"
exit 1

fi

if [[ $DISTRO_PKG =~ ^system-release ]]; then
if [[ $DISTRO_PKG =~ ^system-release-2-14 ]]; then

# Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
DIST_VERSION=7
elif [[ $DISTRO_PKG =~ ^system-release-2023 ]]; then

# Amazon Linux 2023
DIST_VERSION=2023
else

## Using the redhat-release-server-X, centos-release-X, centos-stream-release-X, etc. pattern
## extract the major version number of the distro
if [[ $DIST_TYPE =~ fc ]]; then
Expand Down
33 changes: 26 additions & 7 deletions rpm/setup_10.x
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,28 @@ fi
#-check-distro-#

## Check distro and arch
echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
##echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
##DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
PKG_LIST=(
"redhat-release"
"centos-release"
"cloudlinux-release"
"sl-release"
"fedora-release"
"system-release"
)
echo "+ uname -m"
UNAME_ARCH=$(uname -m)

for PKG in "${PKG_LIST[@]}"; do
rpm -q --whatprovides ${PKG}
if [ $? -eq 0 ]; then
echo "exec ${PKG}"
DISTRO_PKG=$(rpm -q --whatprovides ${PKG})
echo "Release package: ""${DISTRO_PKG}"
break
fi
done

if [ "X${UNAME_ARCH}" == "Xi686" ]; then
DIST_ARCH=i386
Expand All @@ -210,32 +227,34 @@ fi

if [[ $DISTRO_PKG =~ ^(redhat|centos|almalinux|rocky|cloudlinux|mageia|sl)- ]]; then
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^system-release-(2023) ]]; then # Amazon Linux 2023 and possibly 2025
DIST_TYPE=al
elif [[ $DISTRO_PKG =~ ^(enterprise|system)-release- ]]; then # Oracle Linux & Amazon Linux
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^(fedora|korora)- ]]; then
DIST_TYPE=fc
elif [[ $DISTRO_PKG =~ fedora-release- ]]; then
DIST_TYPE=fc
else

print_status "\
You don't appear to be running a supported version of Enterprise Linux. \
Please contact NodeSource at \
https://github.com/nodesource/distributions/issues if you think this is \
incorrect or would like your architecture to be considered for support. \
Include your 'distribution package' name: ${DISTRO_PKG}. \
Include your 'distribution package' name in the list: ${PKG_LIST[*]}. \
"
exit 1

fi

if [[ $DISTRO_PKG =~ ^system-release ]]; then
if [[ $DISTRO_PKG =~ ^system-release-2-14 ]]; then

# Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
DIST_VERSION=7
elif [[ $DISTRO_PKG =~ ^system-release-2023 ]]; then

# Amazon Linux 2023
DIST_VERSION=2023
else

## Using the redhat-release-server-X, centos-release-X, centos-stream-release-X, etc. pattern
## extract the major version number of the distro
if [[ $DIST_TYPE =~ fc ]]; then
Expand Down
33 changes: 26 additions & 7 deletions rpm/setup_11.x
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,28 @@ fi
#-check-distro-#

## Check distro and arch
echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
##echo "+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release"
##DISTRO_PKG=$(rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release)
PKG_LIST=(
"redhat-release"
"centos-release"
"cloudlinux-release"
"sl-release"
"fedora-release"
"system-release"
)
echo "+ uname -m"
UNAME_ARCH=$(uname -m)

for PKG in "${PKG_LIST[@]}"; do
rpm -q --whatprovides ${PKG}
if [ $? -eq 0 ]; then
echo "exec ${PKG}"
DISTRO_PKG=$(rpm -q --whatprovides ${PKG})
echo "Release package: ""${DISTRO_PKG}"
break
fi
done

if [ "X${UNAME_ARCH}" == "Xi686" ]; then
DIST_ARCH=i386
Expand All @@ -210,32 +227,34 @@ fi

if [[ $DISTRO_PKG =~ ^(redhat|centos|almalinux|rocky|cloudlinux|mageia|sl)- ]]; then
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^system-release-(2023) ]]; then # Amazon Linux 2023 and possibly 2025
DIST_TYPE=al
elif [[ $DISTRO_PKG =~ ^(enterprise|system)-release- ]]; then # Oracle Linux & Amazon Linux
DIST_TYPE=el
elif [[ $DISTRO_PKG =~ ^(fedora|korora)- ]]; then
DIST_TYPE=fc
elif [[ $DISTRO_PKG =~ fedora-release- ]]; then
DIST_TYPE=fc
else

print_status "\
You don't appear to be running a supported version of Enterprise Linux. \
Please contact NodeSource at \
https://github.com/nodesource/distributions/issues if you think this is \
incorrect or would like your architecture to be considered for support. \
Include your 'distribution package' name: ${DISTRO_PKG}. \
Include your 'distribution package' name in the list: ${PKG_LIST[*]}. \
"
exit 1

fi

if [[ $DISTRO_PKG =~ ^system-release ]]; then
if [[ $DISTRO_PKG =~ ^system-release-2-14 ]]; then

# Amazon Linux, for 2014.* use el7, older versions are unknown, perhaps el6
DIST_VERSION=7
elif [[ $DISTRO_PKG =~ ^system-release-2023 ]]; then

# Amazon Linux 2023
DIST_VERSION=2023
else

## Using the redhat-release-server-X, centos-release-X, centos-stream-release-X, etc. pattern
## extract the major version number of the distro
if [[ $DIST_TYPE =~ fc ]]; then
Expand Down
Loading

0 comments on commit 07acca8

Please sign in to comment.