Skip to content

Commit b75ebd9

Browse files
authored
Merge pull request #340 from mekanix/rustdate
Use host's freebsd-rustdate
2 parents d0c4c86 + 1c5f040 commit b75ebd9

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

scripts/update-base.sh

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ elif [ "${BACKEND}" = "base" ]; then
1818
if [ "${PKG_PROXY}" != "no" ]; then
1919
export HTTP_PROXY="${PKG_PROXY}"
2020
fi
21+
if [ "${RUST}" = "YES" ]; then
22+
rustdate=$(which freebsd-rustdate || true)
23+
unset HTTP_PROXY
24+
if [ -z "${rustdate}" ]; then
25+
jexec "${jail_name}" pkg install -y freebsd-rustdate
26+
fi
27+
fi
2128
if [ -z "${JAIL}" ]; then
2229
cd "${BASE_WORKDIR}"
23-
jls -N | egrep -v ' *JID' | awk '{print $1}' | while read jail_name; do
30+
jls -N | egrep -v ' *JID' | egrep -v ' ^svcj' | awk '{print $1}' | while read jail_name; do
2431
if [ -x "${jail_name}/bin/freebsd-version" ]; then
2532
export CURRENTLY_RUNNING="$(jexec "${jail_name}" freebsd-version -u)"
2633
CURRENTLY_RUNNING_FLAVOR="$(echo "${CURRENTLY_RUNNING}" | cut -f 2 -d '-')"
2734
if [ "${CURRENTLY_RUNNING_FLAVOR}" = "RELEASE" ]; then
28-
echo "=== ${jail_name} ==="
35+
echo "=== ${jail_name} cvrc ==="
2936
if [ "${RUST}" = "YES" ]; then
30-
rustdate=$(jexec "${jail_name}" which freebsd-rustdate || true)
31-
if [ -z "${rustdate}" ]; then
32-
jexec "${jail_name}" pkg install -y freebsd-rustdate
33-
fi
34-
jexec "${jail_name}" freebsd-rustdate fetch
35-
jexec "${jail_name}" freebsd-rustdate install
37+
JAIL_ROOT="$(jls -N -j network path)"
38+
${rustdate} -b "${JAIL_ROOT}" fetch
39+
${rustdate} -b "${JAIL_ROOT}" install
3640
else
37-
jexec "${jail_name}" \
38-
freebsd-update \
39-
--not-running-from-cron \
40-
--currently-running "${CURRENTLY_RUNNING}" \
41-
fetch install
41+
freebsd-update -j "${jail_name}" --not-running-from-cron fetch install
4242
echo
4343
fi
4444
fi
@@ -47,12 +47,14 @@ elif [ "${BACKEND}" = "base" ]; then
4747
cd -
4848
elif [ -x "${BASE_WORKDIR}/${JAIL}/bin/freebsd-version" ]; then
4949
echo "=== ${JAIL} ==="
50-
export CURRENTLY_RUNNING="$(jexec "${JAIL}" freebsd-version -u)"
51-
jexec "${JAIL}" \
52-
freebsd-update \
53-
--not-running-from-cron \
54-
--currently-running "${CURRENTLY_RUNNING}" \
55-
fetch install
50+
if [ "${RUST}" = "YES" ]; then
51+
unset HTTP_PROXY
52+
JAIL_ROOT="$(jls -N -j network path)"
53+
${rustdate} -b "${JAIL_ROOT}" fetch
54+
${rustdate} -b "${JAIL_ROOT}" install
55+
else
56+
freebsd-update -j "${jail_name}" --not-running-from-cron fetch install
57+
fi
5658
else
5759
echo "No such jail \"${JAIL}\"!" >&2
5860
exit 1

0 commit comments

Comments
 (0)