diff options
author | Bryan Drewery <bryan@shatow.net> | 2022-03-10 03:23:02 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2022-03-10 03:23:10 +0300 |
commit | 03b2e06697a5919d841c741f401620e21a4c3bbd (patch) | |
tree | eeb4e51b2ee56d61cfe03b324b987865ae194aa5 /src | |
parent | a869290056645880e39fcc9f663e116d5e0b6717 (diff) |
pkg repo: Be more verbose and catch errors better.
Issue #985
Diffstat (limited to 'src')
-rwxr-xr-x | src/share/poudriere/common.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index 242e9c5b..a76c3496 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -8366,6 +8366,7 @@ sign_pkg() { local sigtype="$1" local pkgfile="$2" + msg "Signing pkg bootstrap with method: ${sigtype}" if [ "${sigtype}" = "fingerprint" ]; then unlink "${pkgfile}.sig" sha256 -q "${pkgfile}" | ${SIGNING_COMMAND} > "${pkgfile}.sig" @@ -8400,15 +8401,20 @@ build_repo() { fi mkdir -p ${MASTERMNT}/tmp/packages if [ -n "${PKG_REPO_SIGNING_KEY}" ]; then + msg "Signing repository with key: ${PKG_REPO_SIGNING_KEY}" install -m 0400 ${PKG_REPO_SIGNING_KEY} \ ${MASTERMNT}/tmp/repo.key injail ${PKG_BIN} repo \ ${pkg_repo_list_files} \ -o /tmp/packages \ ${PKG_META} \ - /packages /tmp/repo.key + /packages /tmp/repo.key || + err "$?" "Failed to sign pkg repository" unlink ${MASTERMNT}/tmp/repo.key elif [ "${PKG_REPO_FROM_HOST:-no}" = "yes" ]; then + if [ -n "${SIGNING_COMMAND-}" ]; then + msg "Signing repository with command: ${SIGNING_COMMAND}" + fi # Sometimes building repo from host is needed if # using SSH with DNSSEC as older hosts don't support # it. @@ -8416,12 +8422,17 @@ build_repo() { ${pkg_repo_list_files} \ -o ${MASTERMNT}/tmp/packages ${PKG_META_MASTERMNT} \ ${MASTERMNT}/packages \ - ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} + ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} || + err "$?" "Failed to sign pkg repository" else + if [ -n "${SIGNING_COMMAND-}" ]; then + msg "Signing repository with command: ${SIGNING_COMMAND}" + fi JNETNAME="n" injail ${PKG_BIN} repo \ ${pkg_repo_list_files} \ -o /tmp/packages ${PKG_META} /packages \ - ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} + ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} || + err "$?" "Failed to sign pkg repository" fi cp ${MASTERMNT}/tmp/packages/* ${PACKAGES}/ |