From 44eb0111c3a1cfca7b7bafa6a9aa1d335f6ef313 Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 11 Sep 2023 22:46:56 +1000 Subject: [PATCH] better curl errors. --- overlay.nix | 2 +- update.sh | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/overlay.nix b/overlay.nix index 3b9b82e..a5ccbbf 100644 --- a/overlay.nix +++ b/overlay.nix @@ -15,7 +15,7 @@ final: prev: bap-aslp = prev.callPackage ./bap-aslp.nix {}; bap-uq-pac = prev.ocamlPackages.bap.overrideAttrs rec { - version = "uq-pac"; + version = src.rev; src = prev.fetchFromGitHub { owner = "UQ-PAC"; repo = "bap"; diff --git a/update.sh b/update.sh index 306c844..35d6194 100755 --- a/update.sh +++ b/update.sh @@ -1,5 +1,5 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash --packages nix-update jq curl cacert git nix vim --pure --keep GITHUB_TOKEN --keep NIX_PATH +#! nix-shell -i bash --packages nix-update curl jq cacert git nix vim --pure --keep GITHUB_TOKEN --keep NIX_PATH # updates the revision hash for each upstream package. # for each updated package, this checks the derivation can be built @@ -19,11 +19,21 @@ do-upgrade() { PKGS=./pkgs.nix TMP=$(mktemp) +PID=$$ curl() { + TMP=$(mktemp) if ! [[ -z "$GITHUB_TOKEN" ]]; then - command curl -s --header "Authorization: Bearer $GITHUB_TOKEN" "$@" + command curl --fail-with-body -s --header "Authorization: Bearer $GITHUB_TOKEN" "$@" >$TMP else - command curl -s "$@" + command curl --fail-with-body -s "$@" >$TMP + fi + EXIT=$? + if [[ $EXIT != 0 ]]; then + echo "::error title=curl failure ($EXIT)::curl $@" >&2 + cat $TMP >&2 + kill -ABRT $PID + else + cat $TMP fi } @@ -80,4 +90,6 @@ test-build bap-aslp update-github basil UQ-PAC/bil-to-boogie-translator +update-github bap-uq-pac UQ-PAC/bap aarch64-pull-request-2 + rm -fv ./result