-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrepology
More file actions
executable file
·63 lines (53 loc) · 1.58 KB
/
Copy pathrepology
File metadata and controls
executable file
·63 lines (53 loc) · 1.58 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
#!/bin/bash
set -e # Exit script if any statement returns a non-true value.
PTXDIST_GIT_URL="https://git.pengutronix.de/git/ptxdist"
PTXDIST="${PWD}/ptxdist/bin/ptxdist"
JSON_OUTPUT="${PWD}/repology.json"
if [ $# -ne 1 ]; then
echo "Usage: $0 <ptxdist tag/branch>"
echo
echo "Outputs repology.json in current working directory"
echo
echo "Examples:"
echo "$0 ptxdist-2026.01.0"
echo "$0 master"
echo "REPOLOGY_AUTO_COMMIT=1 $0 master"
exit 1
fi
git_ref="${1}"
here="$(cd "$(dirname "$(realpath "${0}")")" && pwd)"
if [ ! -d ptxdist ]; then
git clone "${PTXDIST_GIT_URL}"
fi
cd ptxdist
git checkout master
git pull
git checkout "${git_ref}"
make clean || true
./autogen.sh
./configure
make
cd -
ptxdist_version=$("${PTXDIST}" --version)
"${PTXDIST}" \
--force \
--ptxconfig="${here}/configs/ptxconfig" \
--platformconfig="${here}/configs/platformconfig" \
--toolchain="/usr/bin" \
bash ptxd_repology 2> /dev/null > "${JSON_OUTPUT}"
git_message="repology.json: ${ptxdist_version}"
echo "---------------------------------------------------"
echo "${git_message}"
echo
# Fixup binutils with OSELAS.Toolchain version as "$(CROSS_LD) -v" command does not work
BINUTILS_VERSION="2.40"
sed -i "/name.*binutils/!b;n;s/unknown/${BINUTILS_VERSION}/" "${JSON_OUTPUT}"
sed -i "s/binutils-unknown/binutils-${BINUTILS_VERSION}/g" "${JSON_OUTPUT}"
# Validate output
if grep -c "version.*unknown" "${JSON_OUTPUT}" > /dev/null; then
echo "Warning unknown version found in output JSON!"
fi
if [ -v REPOLOGY_AUTO_COMMIT ]; then
git add repology.json
git commit -s -m "${git_message}"
fi