Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3b9ce14

Browse files
committed
Add RH6 rid detections to build-packages.sh script
1 parent 96fb9ad commit 3b9ce14

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

build-packages.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,26 @@ usage()
1010
exit 1
1111
}
1212

13+
initHostDistroRid()
14+
{
15+
__HostDistroRid=""
16+
if [ "$__HostOS" == "Linux" ]; then
17+
if [ -e /etc/os-release ]; then
18+
source /etc/os-release
19+
__HostDistroRid="$ID.$VERSION_ID-$__HostArch"
20+
elif [ -e /etc/redhat-release ]; then
21+
local redhatRelease=$(</etc/redhat-release)
22+
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
23+
__HostDistroRid="rhel.6-$__HostArch"
24+
fi
25+
fi
26+
fi
27+
28+
if [ "$__HostDistroRid" == "" ]; then
29+
echo "WARNING: Can not determine runtime id for current distro."
30+
fi
31+
}
32+
1333
__ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1434
__IsPortableBuild=1
1535

@@ -88,7 +108,9 @@ if [ $__IsPortableBuild == 1 ]; then
88108
export __DistroRid="osx-$__Arch"
89109
fi
90110
else
91-
export __DistroRid="\${OSRid}-$__Arch"
111+
# init the host distro name
112+
initHostDistroRid
113+
export __DistroRid="$__HostDistroRid"
92114
fi
93115

94116
$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/packages.builds -DistroRid=$__DistroRid -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs

0 commit comments

Comments
 (0)