Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions scripts/update-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down