Date: Thu, 23 Oct 2025 15:18:40 GMT From: Jessica Clarke <jrtc27@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 970800c38d15 - main - devel/llvm-morello: Add script to automate Makefile.snapshot generation Message-ID: <202510231518.59NFIe2j083810@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/ports/commit/?id=970800c38d158f95bdc36c3b5dafcfdc5c8aa22f commit 970800c38d158f95bdc36c3b5dafcfdc5c8aa22f Author: Jessica Clarke <jrtc27@FreeBSD.org> AuthorDate: 2025-10-23 15:15:06 +0000 Commit: Jessica Clarke <jrtc27@FreeBSD.org> CommitDate: 2025-10-23 15:15:06 +0000 devel/llvm-morello: Add script to automate Makefile.snapshot generation Based on devel/llvm-cheri's, adapted for the GitLab API. --- devel/llvm-morello/files/gen-Makefile.snapshot.sh | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/devel/llvm-morello/files/gen-Makefile.snapshot.sh b/devel/llvm-morello/files/gen-Makefile.snapshot.sh new file mode 100644 index 000000000000..80b23fb7b218 --- /dev/null +++ b/devel/llvm-morello/files/gen-Makefile.snapshot.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Simple script to fetch the latest commits via the gitlab API. Requires +# curl and jq. Uses unauthenticated access. + +REPOS_URL=https://git.morello-project.org/api/v4/projects/morello +MAX_DATE=1970101 + +tmpfile=`mktemp -t gen-Makefile.snapshot` + +query_repo() +{ + curl ${REPOS_URL}%2F$1/repository/branches/morello%2Fdev > $tmpfile + + # Accumulate the dates of the last commits to find the snapshot date + committime=`jq -r '.commit.committed_date' $tmpfile` + committime=${committime%%T*} + year=${committime%%-*} + month=${committime%-*} + month=${month#*-} + day=${committime##*-} + dateint=${year}${month}${day} + if [ $dateint -gt $MAX_DATE ]; then + export MAX_DATE=$dateint + fi + + SHA=`jq -r '.commit.id' $tmpfile` +} + +query_repo llvm-project +LLVM_COMMIT=$SHA + +cat <<EOF > Makefile.snapshot +# Generated file! Do not edit! +# +# Generated by: files/gen-Makefile.snapshot.sh. +# +LLVM_MAJOR= 17 +LLVM_RELEASE= \${LLVM_MAJOR}.0.0 +SNAPDATE= ${MAX_DATE} + +LLVM_COMMIT= ${LLVM_COMMIT} +EOF + +rm -f $tmpfile
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510231518.59NFIe2j083810>
