From aaa13e5ad6644ba987a9b965cbb1ac62a50c0692 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 7 Aug 2014 12:27:55 -0700 Subject: [PATCH] build.sh: Mention troublesome repo in die() messages So folks don't have to scroll back up and find the "build repo ${REPO}" message or similar. Also wrap long lines after the '||' to try and stay in the vicinity of 80 characters ;). The inspiration came from Erik's gentoo-bb commit [1]. [1]: https://github.com/edannenberg/gentoo-bb/blob/e653d78fdb17f218aec83b5b0e11c5bf2aa07253/build.sh#L246 Based-on-patch-by: Erik Dannenberg --- build.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 94edf31..e37f68c 100755 --- a/build.sh +++ b/build.sh @@ -125,7 +125,8 @@ import_stage3() fi done - gpg --verify "downloads/${STAGE3_DIGESTS}" || die "insecure digests" + gpg --verify "downloads/${STAGE3_DIGESTS}" || + die "insecure digests for gentoo" SHA512_HASHES=$(grep -A1 SHA512 "downloads/${STAGE3_DIGESTS}" | grep -v '^--') SHA512_CHECK=$(cd downloads/ && (echo "${SHA512_HASHES}" | sha512sum -c)) SHA512_FAILED=$(echo "${SHA512_CHECK}" | grep FAILED) @@ -134,11 +135,13 @@ import_stage3() fi msg "import ${NAMESPACE}/gentoo:${DATE}" - "${DOCKER}" import - "${NAMESPACE}/gentoo:${DATE}" < "downloads/${STAGE3}" || die "failed to import" + "${DOCKER}" import - "${NAMESPACE}/gentoo:${DATE}" < "downloads/${STAGE3}" || + die "failed to import gentoo" fi msg "tag ${NAMESPACE}/gentoo:latest" - "${DOCKER}" tag -f "${NAMESPACE}/gentoo:${DATE}" "${NAMESPACE}/gentoo:latest" || die "failed to tag" + "${DOCKER}" tag -f "${NAMESPACE}/gentoo:${DATE}" "${NAMESPACE}/gentoo:latest" || + die "failed to tag gentoo" } # If they don't already exist: @@ -160,14 +163,17 @@ import_portage() fi done - gpg --verify "downloads/${PORTAGE_SIG}" "downloads/${PORTAGE}" || die "insecure digests" + gpg --verify "downloads/${PORTAGE_SIG}" "downloads/${PORTAGE}" || + die "insecure digests for portage-import" msg "import ${NAMESPACE}/portage-import:${DATE}" - "${DOCKER}" import - "${NAMESPACE}/portage-import:${DATE}" < "downloads/${PORTAGE}" || die "failed to import" + "${DOCKER}" import - "${NAMESPACE}/portage-import:${DATE}" < "downloads/${PORTAGE}" || + die "failed to import portage-import" fi msg "tag ${NAMESPACE}/portage-import:latest" - "${DOCKER}" tag -f "${NAMESPACE}/portage-import:${DATE}" "${NAMESPACE}/portage-import:latest" || die "failed to tag" + "${DOCKER}" tag -f "${NAMESPACE}/portage-import:${DATE}" "${NAMESPACE}/portage-import:latest" || + die "failed to tag portage-import" } # extract Busybox for the portage image @@ -216,10 +222,12 @@ build_repo() < "${REPO}/Dockerfile.template" > "${REPO}/Dockerfile" msg "build ${NAMESPACE}/${REPO}:${DATE}" - "${DOCKER}" build ${BUILD_OPTS} -t "${NAMESPACE}/${REPO}:${DATE}" "${REPO}" || die "failed to build" + "${DOCKER}" build ${BUILD_OPTS} -t "${NAMESPACE}/${REPO}:${DATE}" "${REPO}" || + die "failed to build ${REPO}" fi msg "tag ${NAMESPACE}/${REPO}:latest" - "${DOCKER}" tag -f "${NAMESPACE}/${REPO}:${DATE}" "${NAMESPACE}/${REPO}:latest" || die "failed to tag" + "${DOCKER}" tag -f "${NAMESPACE}/${REPO}:${DATE}" "${NAMESPACE}/${REPO}:latest" || + die "failed to tag ${REPO}" } build() -- 2.26.2