diff --git a/scripts/update-base.sh b/scripts/update-base.sh index c20a6b4..70be6d3 100755 --- a/scripts/update-base.sh +++ b/scripts/update-base.sh @@ -18,27 +18,27 @@ elif [ "${BACKEND}" = "base" ]; then if [ "${PKG_PROXY}" != "no" ]; then export HTTP_PROXY="${PKG_PROXY}" fi + if [ "${RUST}" = "YES" ]; then + rustdate=$(which freebsd-rustdate || true) + unset HTTP_PROXY + if [ -z "${rustdate}" ]; then + jexec "${jail_name}" pkg install -y freebsd-rustdate + fi + fi if [ -z "${JAIL}" ]; then cd "${BASE_WORKDIR}" - jls -N | egrep -v ' *JID' | awk '{print $1}' | while read jail_name; do + jls -N | egrep -v ' *JID' | egrep -v ' ^svcj' | awk '{print $1}' | while read jail_name; do if [ -x "${jail_name}/bin/freebsd-version" ]; then export CURRENTLY_RUNNING="$(jexec "${jail_name}" freebsd-version -u)" CURRENTLY_RUNNING_FLAVOR="$(echo "${CURRENTLY_RUNNING}" | cut -f 2 -d '-')" if [ "${CURRENTLY_RUNNING_FLAVOR}" = "RELEASE" ]; then - echo "=== ${jail_name} ===" + echo "=== ${jail_name} cvrc ===" if [ "${RUST}" = "YES" ]; then - rustdate=$(jexec "${jail_name}" which freebsd-rustdate || true) - if [ -z "${rustdate}" ]; then - jexec "${jail_name}" pkg install -y freebsd-rustdate - fi - jexec "${jail_name}" freebsd-rustdate fetch - jexec "${jail_name}" freebsd-rustdate install + JAIL_ROOT="$(jls -N -j network path)" + ${rustdate} -b "${JAIL_ROOT}" fetch + ${rustdate} -b "${JAIL_ROOT}" install else - jexec "${jail_name}" \ - freebsd-update \ - --not-running-from-cron \ - --currently-running "${CURRENTLY_RUNNING}" \ - fetch install + freebsd-update -j "${jail_name}" --not-running-from-cron fetch install echo fi fi @@ -47,12 +47,14 @@ elif [ "${BACKEND}" = "base" ]; then cd - elif [ -x "${BASE_WORKDIR}/${JAIL}/bin/freebsd-version" ]; then echo "=== ${JAIL} ===" - export CURRENTLY_RUNNING="$(jexec "${JAIL}" freebsd-version -u)" - jexec "${JAIL}" \ - freebsd-update \ - --not-running-from-cron \ - --currently-running "${CURRENTLY_RUNNING}" \ - fetch install + if [ "${RUST}" = "YES" ]; then + unset HTTP_PROXY + JAIL_ROOT="$(jls -N -j network path)" + ${rustdate} -b "${JAIL_ROOT}" fetch + ${rustdate} -b "${JAIL_ROOT}" install + else + freebsd-update -j "${jail_name}" --not-running-from-cron fetch install + fi else echo "No such jail \"${JAIL}\"!" >&2 exit 1