File: test-ed25519-upstream.sh

package info (click to toggle)
python-securesystemslib 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,316 kB
  • sloc: python: 5,319; sh: 38; makefile: 5
file content (27 lines) | stat: -rwxr-xr-x 1,026 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

# Check for new commits in upstream ed25519
#
# Return 0 if the upstream ed25519 main branch HEAD matches the
# commit that our copy was vendored from.
#
# This is used in CI workflow to open an issue if new commits are found

set -eu

# This commit matches our securesystemslib/_vendor/ed25519/ content.
# If upstream changes, we should review the changes, vendor them,
# and update the hash here
pyca_ed25519_expected="08a7962a8059e4546a21b97f4a847f75cd1a1bbb"
pyca_ed25519_git_url="https://github.com/pyca/ed25519.git"

pyca_ed25519_main_head=$(git ls-remote "$pyca_ed25519_git_url" main | cut -f1)
if [ "$pyca_ed25519_main_head" != "$pyca_ed25519_expected" ]; then
    echo "Expected [main](https://github.com/pyca/ed25519/commits/main)" \
	 "to be commit ${pyca_ed25519_expected:0:7}, found" \
	 "${pyca_ed25519_main_head:0:7} instead" \
	 "([diff](https://github.com/pyca/ed25519/compare/${pyca_ed25519_expected}...main))."
    exit 1
fi

echo "No unexpected commits in https://github.com/pyca/ed25519.git"