Skip to content

Commit

Permalink
Remove the first argument to panic(), which was initially
Browse files Browse the repository at this point in the history
intended to be the exit code, however when a non-zero exit
code was returned to release/Makefile, this would prevent
any remaining (and possibly successful) stages from being
attempted.

Sponsored by:	The FreeBSD Foundation
  • Loading branch information
gjb authored and gjb committed Oct 2, 2014
1 parent 17d149e commit c932f99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 5 additions & 7 deletions release/amd64/mk-vmimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ usage() {
}

panic() {
rc="${1}"
shift 1
msg="${@}"
printf "${msg}\n"
if [ ! -z "${mddev}" ]; then
mdconfig -d -u ${mddev}
fi
# Do not allow one failure case to chain through any remaining image
# builds.
exit 0
return 1
}

vm_create_baseimage() {
Expand Down Expand Up @@ -96,7 +94,7 @@ vm_create_baseimage() {
cd ${WORLDDIR} && \
make DESTDIR=${DESTDIR} \
installworld installkernel distribution || \
panic 1 "\n\nCannot install the base system to ${DESTDIR}."
panic "\n\nCannot install the base system to ${DESTDIR}."
chroot ${DESTDIR} /usr/bin/newaliases
echo '# Custom /etc/fstab for FreeBSD VM images' \
> ${DESTDIR}/etc/fstab
Expand All @@ -111,7 +109,7 @@ vm_create_baseimage() {
# This should never happen. But, it has happened.
msg="Cannot umount(8) ${DESTDIR}\n"
msg="${msg}Something has gone horribly wrong."
panic 1 "${msg}"
panic "${msg}"
fi
sleep 1
done
Expand Down Expand Up @@ -141,11 +139,11 @@ vm_create_vmdisk() {
if [ -z "${mkimg_version}" ]; then
msg="Cannot determine mkimg(1) version.\n"
msg="${msg}Cannot continue without a known mkimg(1) version."
panic 0 "${msg}"
panic "${msg}"
fi

if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then
panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n"
panic "'${FORMAT}' is not supported by this mkimg(1).\n"
fi

case ${FORMAT} in
Expand Down
12 changes: 5 additions & 7 deletions release/i386/mk-vmimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ usage() {
}

panic() {
rc="${1}"
shift 1
msg="${@}"
printf "${msg}\n"
if [ ! -z "${mddev}" ]; then
mdconfig -d -u ${mddev}
fi
# Do not allow one failure case to chain through any remaining image
# builds.
exit 0
return 1
}

vm_create_baseimage() {
Expand Down Expand Up @@ -96,7 +94,7 @@ vm_create_baseimage() {
cd ${WORLDDIR} && \
make DESTDIR=${DESTDIR} \
installworld installkernel distribution || \
panic 1 "\n\nCannot install the base system to ${DESTDIR}."
panic "\n\nCannot install the base system to ${DESTDIR}."
chroot ${DESTDIR} /usr/bin/newaliases
echo '# Custom /etc/fstab for FreeBSD VM images' \
> ${DESTDIR}/etc/fstab
Expand All @@ -111,7 +109,7 @@ vm_create_baseimage() {
# This should never happen. But, it has happened.
msg="Cannot umount(8) ${DESTDIR}\n"
msg="${msg}Something has gone horribly wrong."
panic 1 "${msg}"
panic "${msg}"
fi
sleep 1
done
Expand Down Expand Up @@ -141,11 +139,11 @@ vm_create_vmdisk() {
if [ -z "${mkimg_version}" ]; then
msg="Cannot determine mkimg(1) version.\n"
msg="${msg}Cannot continue without a known mkimg(1) version."
panic 0 "${msg}"
panic "${msg}"
fi

if ! mkimg --formats 2>/dev/null | grep -q ${FORMAT}; then
panic 0 "'${FORMAT}' is not supported by this mkimg(1).\n"
panic "'${FORMAT}' is not supported by this mkimg(1).\n"
fi

case ${FORMAT} in
Expand Down

0 comments on commit c932f99

Please sign in to comment.