From d570464973a1450c041b403aad1fd3049d653095 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 7 Feb 2012 03:41:41 +0100 Subject: [PATCH] vmklive: bail if required pkgs aren't available. --- srcpkgs/vmklive/files/mklive.sh.in | 15 +++++++++++++++ srcpkgs/vmklive/template | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/srcpkgs/vmklive/files/mklive.sh.in b/srcpkgs/vmklive/files/mklive.sh.in index 4eae694640..1930429738 100755 --- a/srcpkgs/vmklive/files/mklive.sh.in +++ b/srcpkgs/vmklive/files/mklive.sh.in @@ -265,6 +265,15 @@ if [ "$(id -u)" -ne 0 ]; then error_out fi +# +# Check there are repos registered before anything. +# +${XBPS_REPO_CMD} list >/dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "No repositories available, exiting..." + error_out +fi + # # Mount pseudofs in the target rootfs. # @@ -289,6 +298,12 @@ for f in ${PACKAGE_LIST}; do info_msg " $f" done if [ -z "$ROOTDIR" ]; then + # Check that all pkgs are reachable. + ${XBPS_BIN_CMD} ${XBPS_ARGS} -n install ${PACKAGE_LIST} >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + info_msg "Missing required binary packages, exiting..." + error_out + fi ${XBPS_BIN_CMD} ${XBPS_ARGS} install ${PACKAGE_LIST} \ 2>&1|cat >> $LOGFILE || error_out ${XBPS_BIN_CMD} ${XBPS_ARGS} autoupdate \ diff --git a/srcpkgs/vmklive/template b/srcpkgs/vmklive/template index 4ee2436b53..a387c925a4 100644 --- a/srcpkgs/vmklive/template +++ b/srcpkgs/vmklive/template @@ -1,6 +1,6 @@ # Template file for 'vmklive' pkgname=vmklive -version=0.8.2 +version=0.8.3 short_desc="Void GNU/Linux live image maker" maintainer="Juan RP " license="Public domain"