dotnet-json-more-net-2
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-json-more-net-2
6
_nugetid=Json.More.Net
7
pkgver=2.2.0
8
pkgrel=1
9
pkgdesc="Extended functionality for System.Text.Json, 2.x (NuGet package)"
10
arch=('any')
11
url='https://github.com/json-everything/json-everything'
12
license=('MIT')
13
provides=("dotnet-json-more-net=$pkgver")
14
_dotnetsdkver="10.0"
15
makedepends=(
16
dotnet-sdk-"$_dotnetsdkver"
17
git
18
)
19
# 2.x is the last version line published under the MIT license alone, later releases on nuget.org come
20
# with the Open Source Maintenance Fee EULA (OSMFEULA.txt in the repository). It's what JsonPointer.Net
21
# 5.x and JsonSchema.Net 7.x (dotnet-jsonpointer-net-5, dotnet-jsonschema-net-7) need, the versions
22
# PowerShell uses. 2.2.0 wasn't tagged, this is the commit it was published from.
23
_commit="f53d4d27eeed6a73d377bf4188175f0b8a46f856"
24
source=("json-everything::git+$url.git#commit=$_commit")
25
sha512sums=('b7ec594e732d53e73beb3f957abab14ed0e2a6866bc08d682c00c8de6b3cb508cc43051fb91191fa09365e85f6b511fd75715ec72ec622268316bdf6321010b5')
26
b2sums=('533f4c089f938eb943c38c6bbe60e3fad78b0830c069aab2903c078e6646af41a3a204215574c919cdeaf0dfd683b9f25b9ebf52bd790f96e5d93b357d3e7c09')
27
28
_dotnet_env() {
29
export NUGET_PACKAGES="$srcdir/nuget"
30
export DOTNET_CLI_HOME="$srcdir/dotnet-home"
31
export DOTNET_CLI_TELEMETRY_OPTOUT=1
32
export DOTNET_NOLOGO=1
33
}
34
35
prepare() {
36
cd json-everything || exit
37
# Source link isn't needed for this build
38
find src -name '*.csproj' -exec sed -i '/Microsoft.SourceLink.GitHub/d' {} +
39
}
40
41
build() {
42
_dotnet_env
43
cd json-everything || exit
44
# Build first like upstream's publish workflow, the project sets GeneratePackageOnBuild, which
45
# conflicts with dotnet pack building it
46
dotnet build src/Json.More/Json.More.csproj --configuration Release -p:ContinuousIntegrationBuild=true
47
dotnet pack src/Json.More/Json.More.csproj --configuration Release --no-build -p:IncludeSymbols=false --output "$srcdir/nupkg"
48
}
49
50
check() {
51
_dotnet_env
52
cd json-everything || exit
53
# There's no test build for net10.0, run the one for net9.0 on the current runtime
54
DOTNET_ROLL_FORWARD=Major dotnet test src/Json.More.Tests/Json.More.Tests.csproj --configuration Release \
55
--framework net9.0
56
}
57
58
# Fails if a binary in $pkgdir, also inside the .nupkg files there, is identical to one of the packages
59
# restored from a remote feed like nuget.org into $1, so no prebuilt binary slips in instead of one built
60
# from source
61
_check_prebuilt() {
62
local _extracted="$srcdir/check-prebuilt" _metadata _file _hash _found=0
63
local _binaries=(-type f '(' -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.so.*' -o -name '*.dylib' ')')
64
local -A _prebuilt=()
65
while IFS= read -r -d '' _metadata; do
66
grep -qE '"source": *"https?://' "$_metadata" || continue
67
while IFS= read -r -d '' _file; do
68
_prebuilt[$(sha256sum <"$_file")]="${_file#"$1"/}"
69
done < <(find "${_metadata%/*}" "${_binaries[@]}" -print0)
70
done < <(find "$1" -name .nupkg.metadata -print0)
71
72
rm -rf "$_extracted"
73
mkdir -p "$_extracted"
74
while IFS= read -r -d '' _file; do
75
mkdir -p "$_extracted/${_file#"$pkgdir"/}"
76
bsdtar -xf "$_file" -C "$_extracted/${_file#"$pkgdir"/}"
77
done < <(find "$pkgdir" -type f -name '*.nupkg' -print0)
78
while IFS= read -r -d '' _file; do
79
_hash=$(sha256sum <"$_file")
80
if [[ -v "_prebuilt[$_hash]" ]]; then
81
echo "Prebuilt binary: ${_file#"$_extracted"/} is ${_prebuilt[$_hash]}" >&2
82
_found=1
83
fi
84
done < <(find "$pkgdir" "$_extracted" "${_binaries[@]}" -print0)
85
rm -rf "$_extracted"
86
return "$_found"
87
}
88
89
package() {
90
install -Dm644 "$srcdir/nupkg/$_nugetid.$pkgver.nupkg" -t "$pkgdir/usr/share/dotnet/nuget-packages/"
91
install -Dm644 json-everything/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
92
93
_check_prebuilt "$srcdir/nuget"
94
}
95
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-31 05:57:59 | Low | 1 |