build.sh: Mention troublesome repo in die() messages
authorW. Trevor King <wking@tremily.us>
Thu, 7 Aug 2014 19:27:55 +0000 (12:27 -0700)
committerW. Trevor King <wking@tremily.us>
Fri, 22 Aug 2014 16:16:19 +0000 (09:16 -0700)
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 <erik.dannenberg@bbe-consulting.de>
build.sh

index 94edf31fb7c988cdea06d41a80f4e44a808be57a..e37f68c63453282c7cdd2e465970d3c7870582e3 100755 (executable)
--- 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()