Skip to content

Commit 3e70a96

Browse files
committed
Merge remote-tracking branch 'upstream/main' into dev/shech/mergeFormat
2 parents eb8e6c2 + a0e4e2a commit 3e70a96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2150
-337
lines changed

Directory.Packages.props

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
<PackageVersion Include="System.Composition.Runtime" Version="$(MicrosoftNETCoreAppRefPackageVersion)"/>
9494
<PackageVersion Include="System.Composition.TypedParts" Version="$(MicrosoftNETCoreAppRefPackageVersion)"/>
9595
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="$(MicrosoftNETCoreAppRefPackageVersion)" />
96-
<PackageVersion Include="System.Drawing.Common" Version="$(SystemDrawingCommonPackageVersion)" />
9796
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
9897
<!-- System.Reflection.Metadata and System.Collections.Immutable cannot be pinned here because of hard dependencies within Roslyn on specific versions that have to work both here and in VS -->
9998
<PackageVersion Include="System.Reflection.MetadataLoadContext" Version="$(SystemReflectionMetadataLoadContextVersion)" />

eng/Version.Details.xml

+196-200
Large diffs are not rendered by default.

eng/Versions.props

+62-66
Large diffs are not rendered by default.

eng/common/native/init-distro-rid.sh

+38-42
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22

33
# getNonPortableDistroRid
44
#
@@ -11,67 +11,66 @@
1111
# non-portable rid
1212
getNonPortableDistroRid()
1313
{
14-
local targetOs="$1"
15-
local targetArch="$2"
16-
local rootfsDir="$3"
17-
local nonPortableRid=""
14+
targetOs="$1"
15+
targetArch="$2"
16+
rootfsDir="$3"
17+
nonPortableRid=""
1818

1919
if [ "$targetOs" = "linux" ]; then
20+
# shellcheck disable=SC1091
2021
if [ -e "${rootfsDir}/etc/os-release" ]; then
21-
source "${rootfsDir}/etc/os-release"
22-
23-
if [[ "${ID}" == "rhel" || "${ID}" == "rocky" || "${ID}" == "alpine" ]]; then
24-
# remove the last version digit
25-
VERSION_ID="${VERSION_ID%.*}"
22+
. "${rootfsDir}/etc/os-release"
23+
if [ "${ID}" = "rhel" ] || [ "${ID}" = "rocky" ] || [ "${ID}" = "alpine" ]; then
24+
VERSION_ID="${VERSION_ID%.*}" # Remove the last version digit for these distros
2625
fi
2726

28-
if [[ "${VERSION_ID:-}" =~ ^([[:digit:]]|\.)+$ ]]; then
27+
if echo "${VERSION_ID:-}" | grep -qE '^([[:digit:]]|\.)+$'; then
2928
nonPortableRid="${ID}.${VERSION_ID}-${targetArch}"
3029
else
3130
# Rolling release distros either do not set VERSION_ID, set it as blank or
3231
# set it to non-version looking string (such as TEMPLATE_VERSION_ID on ArchLinux);
3332
# so omit it here to be consistent with everything else.
3433
nonPortableRid="${ID}-${targetArch}"
3534
fi
36-
3735
elif [ -e "${rootfsDir}/android_platform" ]; then
38-
source "$rootfsDir"/android_platform
36+
# shellcheck disable=SC1091
37+
. "${rootfsDir}/android_platform"
3938
nonPortableRid="$RID"
4039
fi
4140
fi
4241

4342
if [ "$targetOs" = "freebsd" ]; then
44-
# $rootfsDir can be empty. freebsd-version is shell script and it should always work.
45-
__freebsd_major_version=$($rootfsDir/bin/freebsd-version | { read v; echo "${v%%.*}"; })
43+
# $rootfsDir can be empty. freebsd-version is a shell script and should always work.
44+
__freebsd_major_version=$("$rootfsDir"/bin/freebsd-version | cut -d'.' -f1)
4645
nonPortableRid="freebsd.$__freebsd_major_version-${targetArch}"
47-
elif command -v getprop && getprop ro.product.system.model 2>&1 | grep -qi android; then
46+
elif command -v getprop >/dev/null && getprop ro.product.system.model | grep -qi android; then
4847
__android_sdk_version=$(getprop ro.build.version.sdk)
4948
nonPortableRid="android.$__android_sdk_version-${targetArch}"
5049
elif [ "$targetOs" = "illumos" ]; then
5150
__uname_version=$(uname -v)
5251
case "$__uname_version" in
5352
omnios-*)
54-
__omnios_major_version=$(echo "${__uname_version:8:2}")
55-
nonPortableRid=omnios."$__omnios_major_version"-"$targetArch"
56-
;;
53+
__omnios_major_version=$(echo "$__uname_version" | cut -c9-10)
54+
nonPortableRid="omnios.$__omnios_major_version-${targetArch}"
55+
;;
5756
joyent_*)
58-
__smartos_major_version=$(echo "${__uname_version:7:4}")
59-
nonPortableRid=smartos."$__smartos_major_version"-"$targetArch"
60-
;;
61-
illumos_*)
62-
nonPortableRid=openindiana-"$targetArch"
63-
;;
57+
__smartos_major_version=$(echo "$__uname_version" | cut -c9-10)
58+
nonPortableRid="smartos.$__smartos_major_version-${targetArch}"
59+
;;
60+
*)
61+
nonPortableRid="illumos-${targetArch}"
62+
;;
6463
esac
6564
elif [ "$targetOs" = "solaris" ]; then
6665
__uname_version=$(uname -v)
67-
__solaris_major_version=$(echo "${__uname_version%.*}")
68-
nonPortableRid=solaris."$__solaris_major_version"-"$targetArch"
66+
__solaris_major_version=$(echo "$__uname_version" | cut -d'.' -f1)
67+
nonPortableRid="solaris.$__solaris_major_version-${targetArch}"
6968
elif [ "$targetOs" = "haiku" ]; then
70-
__uname_release=$(uname -r)
69+
__uname_release="$(uname -r)"
7170
nonPortableRid=haiku.r"$__uname_release"-"$targetArch"
7271
fi
7372

74-
echo "$(echo $nonPortableRid | tr '[:upper:]' '[:lower:]')"
73+
echo "$nonPortableRid" | tr '[:upper:]' '[:lower:]'
7574
}
7675

7776
# initDistroRidGlobal
@@ -85,26 +84,23 @@ getNonPortableDistroRid()
8584
# None
8685
#
8786
# Notes:
88-
#
89-
# It is important to note that the function does not return anything, but it
90-
# exports the following variables on success:
91-
#
92-
# __DistroRid : Non-portable rid of the target platform.
93-
# __PortableTargetOS : OS-part of the portable rid that corresponds to the target platform.
94-
#
87+
# It is important to note that the function does not return anything, but it
88+
# exports the following variables on success:
89+
# __DistroRid : Non-portable rid of the target platform.
90+
# __PortableTargetOS : OS-part of the portable rid that corresponds to the target platform.
9591
initDistroRidGlobal()
9692
{
97-
local targetOs="$1"
98-
local targetArch="$2"
99-
local rootfsDir=""
100-
if [ "$#" -ge 3 ]; then
93+
targetOs="$1"
94+
targetArch="$2"
95+
rootfsDir=""
96+
if [ $# -ge 3 ]; then
10197
rootfsDir="$3"
10298
fi
10399

104100
if [ -n "${rootfsDir}" ]; then
105101
# We may have a cross build. Check for the existence of the rootfsDir
106102
if [ ! -e "${rootfsDir}" ]; then
107-
echo "Error rootfsDir has been passed, but the location is not valid."
103+
echo "Error: rootfsDir has been passed, but the location is not valid."
108104
exit 1
109105
fi
110106
fi
@@ -119,7 +115,7 @@ initDistroRidGlobal()
119115
STRINGS="$(command -v llvm-strings || true)"
120116
fi
121117

122-
# Check for musl-based distros (e.g Alpine Linux, Void Linux).
118+
# Check for musl-based distros (e.g. Alpine Linux, Void Linux).
123119
if "${rootfsDir}/usr/bin/ldd" --version 2>&1 | grep -q musl ||
124120
( [ -n "$STRINGS" ] && "$STRINGS" "${rootfsDir}/usr/bin/ldd" 2>&1 | grep -q musl ); then
125121
__PortableTargetOS="linux-musl"

eng/common/native/init-os-and-arch.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22

33
# Use uname to determine what the OS is.
44
OSName=$(uname -s | tr '[:upper:]' '[:lower:]')
@@ -54,6 +54,7 @@ case "$CPUName" in
5454
;;
5555

5656
armv7l|armv8l)
57+
# shellcheck disable=SC1091
5758
if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then
5859
arch=armel
5960
else

0 commit comments

Comments
 (0)