From 6baddb6b117664f51e2b1d2427fced946913a08f Mon Sep 17 00:00:00 2001 From: Colin Percival Date: Fri, 29 Mar 2024 00:10:50 -0700 Subject: [PATCH] release.sh: Don't install git if already present Prior to this commit, we install git from ports if there is a ports tree available and git is not installed, and we install git from pkg otherwise -- including the case where git is already installed. Rework the logic to not (re)install git at all if it is already installed. MFC after: 3 days --- release/release.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/release/release.sh b/release/release.sh index 75278a12daa6..c9d0203debd4 100755 --- a/release/release.sh +++ b/release/release.sh @@ -252,11 +252,11 @@ extra_chroot_setup() { cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi - if [ -z "${NOGIT}" ]; then - # Install git from ports or packages if the ports tree is - # available and VCSCMD is unset. - _gitcmd="$(which git)" - if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then + _gitcmd="$(which git)" + if [ -z "${NOGIT}" -a -z "${_gitcmd}" ]; then + # Install git from ports if the ports tree is available; + # otherwise install the pkg. + if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right # thing. _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)