-
-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathverify.sh
More file actions
executable file
·77 lines (67 loc) · 2.62 KB
/
Copy pathverify.sh
File metadata and controls
executable file
·77 lines (67 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
# ==================================================
# _____ _ _ _ _
# | |_| | |___ ___ ___|_|_ _ _____
# | | | | | | | -_| | | | | | |
# |_|_|_|_|_|_|___|_|_|_|_|_|___|_|_|_|
#
# ==================================================
#
# Copyright (c) 2026 Project Millennium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Verifies vendored tarballs against their upstream sources.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
PASS=0
FAIL=0
TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT
check() {
local file="$1"
local url="$2"
if [[ ! -f "$file" ]]; then
echo "MISSING $file"
FAIL=$((FAIL + 1))
return
fi
printf "checking %-40s ... " "$file"
curl -fsSL -o "$TMPDIR/$file" "$url"
local committed upstream
committed="$(shasum -a 256 "$file" | awk '{print $1}')"
upstream="$(shasum -a 256 "$TMPDIR/$file" | awk '{print $1}')"
if [[ "$committed" == "$upstream" ]]; then
echo "OK"
PASS=$((PASS + 1))
else
echo "MISMATCH"
echo " committed: $committed"
echo " upstream: $upstream"
FAIL=$((FAIL + 1))
fi
}
check zlib-2.2.5.tar.gz https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.5.tar.gz
check nlohmann_json-v3.12.0.tar.gz https://github.com/nlohmann/json/archive/refs/tags/v3.12.0.tar.gz
check minizip_ng-4.0.10.tar.gz https://github.com/zlib-ng/minizip-ng/archive/refs/tags/4.0.10.tar.gz
check curl-8_13_0.tar.gz https://github.com/curl/curl/archive/refs/tags/curl-8_13_0.tar.gz
check catch2-v3.5.3.tar.gz https://github.com/catchorg/Catch2/archive/refs/tags/v3.5.3.tar.gz
echo ""
echo "$PASS passed, $FAIL failed"
[[ $FAIL -eq 0 ]]