From 91076e3eaa7b036546610530333464177f8a5c5a Mon Sep 17 00:00:00 2001 From: Phil Ruffwind Date: Thu, 3 Jun 2021 15:19:10 -0700 Subject: [PATCH 1/2] Handle case where .SRCINFO is missing According to the coments, the code is supposed to support situations where .SRCINFO is missing. To make the build work, it is necessary to generate the .SRCINFO. --- entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a8e3693..25d1ece 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -28,10 +28,12 @@ cd "${INPUT_PKGDIR:-.}" # Assume that if .SRCINFO is missing then it is generated elsewhere. # AUR checks that .SRCINFO exists so a missing file can't go unnoticed. -if [ -f .SRCINFO ] && ! sudo -u builder makepkg --printsrcinfo | diff - .SRCINFO; then +sudo -u builder makepkg --printsrcinfo > .SRCINFO.expected +if [ -f .SRCINFO ] && ! diff .SRCINFO.expected .SRCINFO; then echo "::error file=$FILE,line=$LINENO::Mismatched .SRCINFO. Update with: makepkg --printsrcinfo > .SRCINFO" exit 1 fi +mv .SRCINFO.expected .SRCINFO # Optionally install dependencies from AUR if [ -n "${INPUT_AURDEPS:-}" ]; then From 858b363521a03e1c999139f0db5aa4b783af97ab Mon Sep 17 00:00:00 2001 From: Phil Ruffwind Date: Thu, 3 Jun 2021 15:22:25 -0700 Subject: [PATCH 2/2] Improve readability of .SRCINFO diffs using color and unified format --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 25d1ece..670396f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,7 +29,7 @@ cd "${INPUT_PKGDIR:-.}" # Assume that if .SRCINFO is missing then it is generated elsewhere. # AUR checks that .SRCINFO exists so a missing file can't go unnoticed. sudo -u builder makepkg --printsrcinfo > .SRCINFO.expected -if [ -f .SRCINFO ] && ! diff .SRCINFO.expected .SRCINFO; then +if [ -f .SRCINFO ] && ! diff -u --color=always .SRCINFO.expected .SRCINFO; then echo "::error file=$FILE,line=$LINENO::Mismatched .SRCINFO. Update with: makepkg --printsrcinfo > .SRCINFO" exit 1 fi