dotnet-system-data-sqlclient
LOW
maintainer ChrisTX
0 votes
scanned 2026-10-31 05:57:59.662655
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Christian Pfeiffer <cpfeiffer at rev-crew dot info>
2
# shellcheck disable=SC2034,SC2154
3
# shellcheck shell=bash
4
5
pkgname=dotnet-system-data-sqlclient
6
_nugetid=System.Data.SqlClient
7
pkgver=4.9.1
8
pkgrel=2
9
pkgdesc="The legacy SQL Server data provider for .NET, System.Data.SqlClient (NuGet package)"
10
arch=('any')
11
url='https://github.com/dotnet/maintenance-packages'
12
license=('MIT')
13
_dotnetsdkver="10.0"
14
makedepends=(
15
dotnet-sdk-"$_dotnetsdkver"
16
jq
17
)
18
# The commit the package was published from, and the official build of it, see the file version
19
# 4.900.126.11103 of its assemblies (Arcade encodes the date and build number in it)
20
_commit="84b081710c66cc560b77d4de38cee493c3a38e9d"
21
_officialbuildid="20260211.3"
22
source=("maintenance-packages-$_commit.tar.gz::$url/archive/$_commit.tar.gz")
23
sha512sums=('1aaf6686b04a0ef15dc6228bfa0d8026065bc6a2bffcaac0d26754b6e27b029c1d895d84891e896545c9d6460e71f0b760cbd609f4fb54bc66b350cb2a98eb30')
24
b2sums=('4aed705ecd4cad427cd7d1fd7ff1bbebcfa14cdf34d9a4ec1c9b90a1b92ed042dd244216b1599c45d92db9cee7753c7bfc73d784505dbc6e8340c42a49a4e580')
25
26
_dotnet_env() {
27
export NUGET_PACKAGES="$srcdir/nuget"
28
export DOTNET_CLI_HOME="$srcdir/dotnet-home"
29
export DOTNET_CLI_TELEMETRY_OPTOUT=1
30
export DOTNET_NOLOGO=1
31
# Arcade looks for a .NET installed into the repository otherwise, e.g. for the test host
32
DOTNET_INSTALL_DIR="$(dirname "$(readlink -f /usr/bin/dotnet)")"
33
export DOTNET_INSTALL_DIR
34
35
# Package validation would need the previous release from nuget.org. The repository information
36
# usually comes from git, which would find the repository this PKGBUILD is in instead.
37
_build_arguments=(
38
--configuration Release
39
-p:EnablePackageValidation=false
40
-p:RepositoryCommit="$_commit"
41
-p:RepositoryUrl="$url"
42
-p:SourceRevisionId="$_commit"
43
-p:EnableSourceControlManagerQueries=false
44
)
45
# The source-built Arcade is a newer version than upstream's (8.x), keep its frameworks and use its
46
# build tasks
47
if [[ -f "$srcdir/arcade-version" ]]; then
48
_build_arguments+=(
49
-p:NetCurrent=net8.0
50
-p:NetMinimum=net6.0
51
-p:MicrosoftDotNetBuildTasksTargetFrameworkVersion="$(<"$srcdir/arcade-version")"
52
)
53
fi
54
}
55
56
# Arcade's packages, the build SDK of the repository
57
_arcadepackages=(
58
Microsoft.DotNet.Arcade.Sdk
59
Microsoft.DotNet.Build.Tasks.TargetFramework
60
Microsoft.DotNet.XliffTasks
61
)
62
63
# Writes NuGet.config with the given feeds ($@, as key=url) for everything but Arcade, which is taken
64
# from the source-built artifacts if prepare() found it there, otherwise from Microsoft's dotnet-eng
65
# feed like upstream does
66
_nuget_config() {
67
local _arcade=("${_arcadepackages[@]}") _local=() _feed
68
local _dotneteng=("dotnet-eng=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json")
69
# dotnet-eng is among the given feeds for everything, or only used for Arcade
70
if [[ " $* " == *" dotnet-eng="* ]]; then
71
_dotneteng=()
72
_arcade=()
73
fi
74
if [[ -f "$srcdir/arcade-version" ]]; then
75
_local=("${_arcadepackages[@]}")
76
_arcade=()
77
fi
78
{
79
cat <<EOF
80
<?xml version="1.0" encoding="utf-8"?>
81
<configuration>
82
<packageSources>
83
<clear />
84
<add key="dotnet-source-built" value="$srcdir/nuget-local" />
85
EOF
86
for _feed in "${_dotneteng[@]}" "$@"; do
87
echo " <add key=\"${_feed%%=*}\" value=\"${_feed#*=}\" />"
88
done
89
echo ' </packageSources>'
90
echo ' <packageSourceMapping>'
91
echo ' <clear />'
92
_nuget_mapping dotnet-source-built "${_local[@]}"
93
_nuget_mapping dotnet-eng "${_arcade[@]}"
94
for _feed in "$@"; do
95
_nuget_mapping "${_feed%%=*}" '*'
96
done
97
echo ' </packageSourceMapping>'
98
echo '</configuration>'
99
} >NuGet.config
100
}
101
102
# Prints the package source mapping of the feed $1 for the package patterns $2..., if there are any
103
_nuget_mapping() {
104
(($# > 1)) || return 0
105
echo " <packageSource key=\"$1\">"
106
shift
107
printf ' <package pattern="%s" />\n' "$@"
108
echo ' </packageSource>'
109
}
110
111
prepare() {
112
# Arcade is part of the source-built .NET of Arch Linux (dotnet-source-built-artifacts), which
113
# Arch Linux ARM doesn't have. It can't be a makedepends of an arch=any package, so it's used when
114
# it's installed, and comes from upstream's feeds otherwise.
115
mkdir -p nuget-local
116
local _artifacts _nupkg _version
117
for _artifacts in /usr/share/dotnet/source-built-artifacts/Private.SourceBuilt.Artifacts.*.tar.gz; do
118
[[ -f "$_artifacts" ]] || continue
119
bsdtar -xf "$_artifacts" -C nuget-local "${_arcadepackages[@]/%/.*.nupkg}"
120
done
121
for _nupkg in nuget-local/Microsoft.DotNet.Arcade.Sdk.*.nupkg; do
122
[[ -f "$_nupkg" ]] || continue
123
_version="${_nupkg##*/Microsoft.DotNet.Arcade.Sdk.}"
124
echo "${_version%.nupkg}" >arcade-version
125
done
126
127
# Upstream builds with the .NET 8 SDK. dotnet only works outside the repository until its
128
# global.json is updated.
129
local _sdkver _arcadever
130
_sdkver=$(dotnet --version)
131
132
cd "maintenance-packages-$_commit" || exit
133
# Upstream's NuGet.config, which has the feeds the tests need
134
mv NuGet.config NuGet.config.upstream
135
_arcadever=$(jq -r '."msbuild-sdks"."Microsoft.DotNet.Arcade.Sdk"' global.json)
136
[[ -f "$srcdir/arcade-version" ]] && _arcadever=$(<"$srcdir/arcade-version")
137
jq --arg sdk "$_sdkver" --arg arcade "$_arcadever" \
138
'.sdk.version = $sdk | .tools.dotnet = $sdk | ."msbuild-sdks"."Microsoft.DotNet.Arcade.Sdk" = $arcade' \
139
global.json >global.json.new
140
mv global.json.new global.json
141
# ApiCompat is only needed for package validation
142
sed -i '/<GlobalPackageReference Include="Microsoft.DotNet.ApiCompat.Task"/d' Directory.Packages.props
143
}
144
145
build() {
146
_dotnet_env
147
cd "maintenance-packages-$_commit" || exit
148
# Versions as in the official build. The assemblies are public signed with Microsoft's key, giving
149
# them the same strong name as upstream's.
150
_nuget_config "nuget.org=https://api.nuget.org/v3/index.json"
151
dotnet pack "src/$_nugetid/src/$_nugetid.csproj" "${_build_arguments[@]}" \
152
-p:OfficialBuildId="$_officialbuildid" -p:DotNetFinalVersionKind=release --output "$srcdir/nupkg"
153
}
154
155
check() {
156
_dotnet_env
157
cd "maintenance-packages-$_commit" || exit
158
# The tests need packages from the feeds upstream uses
159
local _feeds=()
160
mapfile -t _feeds < <(sed -n -E 's|.*<add key="([^"]+)" value="(https[^"]+)".*|\1=\2|p' NuGet.config.upstream)
161
_nuget_config "${_feeds[@]}" "nuget.org=https://api.nuget.org/v3/index.json"
162
# The ExecuteXmlReader tests need a SQL Server (TEST_TCP_CONN_STR), but aren't skipped without one
163
local _test _filter=()
164
for _test in ExecuteXmlReaderTest ExecuteXmlReaderAsyncTest; do
165
_filter+=("FullyQualifiedName!=System.Data.SqlClient.Tests.DiagnosticTest.$_test")
166
done
167
# Only the build for Unix and the newest .NET, the test runner doesn't support .NET 6 anymore. The
168
# newer analyzers of the .NET 10 SDK warn about the test tools, which is an error upstream.
169
DOTNET_ROLL_FORWARD=Major dotnet test "src/$_nugetid/tests/$_nugetid.Tests.csproj" "${_build_arguments[@]}" \
170
-p:TargetFrameworks=net8.0-unix -p:TreatWarningsAsErrors=false --filter "$(
171
IFS='&'
172
echo "${_filter[*]}"
173
)"
174
}
175
176
# Fails if a binary in $pkgdir, also inside the .nupkg files there, is identical to one of the packages
177
# restored from a remote feed like nuget.org into $1, so no prebuilt binary slips in instead of one built
178
# from source
179
_check_prebuilt() {
180
local _extracted="$srcdir/check-prebuilt" _metadata _file _hash _found=0
181
local _binaries=(-type f '(' -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.so.*' -o -name '*.dylib' ')')
182
local -A _prebuilt=()
183
while IFS= read -r -d '' _metadata; do
184
grep -qE '"source": *"https?://' "$_metadata" || continue
185
while IFS= read -r -d '' _file; do
186
_prebuilt[$(sha256sum <"$_file")]="${_file#"$1"/}"
187
done < <(find "${_metadata%/*}" "${_binaries[@]}" -print0)
188
done < <(find "$1" -name .nupkg.metadata -print0)
189
190
rm -rf "$_extracted"
191
mkdir -p "$_extracted"
192
while IFS= read -r -d '' _file; do
193
mkdir -p "$_extracted/${_file#"$pkgdir"/}"
194
bsdtar -xf "$_file" -C "$_extracted/${_file#"$pkgdir"/}"
195
done < <(find "$pkgdir" -type f -name '*.nupkg' -print0)
196
while IFS= read -r -d '' _file; do
197
_hash=$(sha256sum <"$_file")
198
if [[ -v "_prebuilt[$_hash]" ]]; then
199
echo "Prebuilt binary: ${_file#"$_extracted"/} is ${_prebuilt[$_hash]}" >&2
200
_found=1
201
fi
202
done < <(find "$pkgdir" "$_extracted" "${_binaries[@]}" -print0)
203
rm -rf "$_extracted"
204
return "$_found"
205
}
206
207
package() {
208
install -Dm644 "$srcdir/nupkg/$_nugetid.$pkgver.nupkg" -t "$pkgdir/usr/share/dotnet/nuget-packages/"
209
install -Dm644 "maintenance-packages-$_commit/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
210
211
_check_prebuilt "$srcdir/nuget"
212
}
213
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-31 05:57:59 | Low | 1 |