On Wed, Sep 09, 2020 at 11:45:49AM +0500, Ruslan Garipov wrote:
> On August 28, 2020 2:19:33 AM Glen Barber <g...@freebsd.org> wrote:
> 
> > Author: gjb
> > Date: Thu Aug 27 21:19:16 2020
> > New Revision: 364891
> > URL: https://svnweb.freebsd.org/changeset/base/364891
> > 
> > Log:
> >   Merge the projects/release-git branch to head.
> >   This allows building 13.x from Git instead of Subversion.
> I'm sorry for the late response (and for the bad first one I made on this
> commit recently via Gmail web client).
> 
> My build machine is completely offline.  I provide it with fresh snapshots
> of the source and ports tree manually -- via tarballs which I'm pulling on
> a FreeBSD machine having Internet connection.  Therefore, neither
> "/scratch", nor the chrooted environment for me don't require Internet
> access (I fetch distfiles for offline usage too).
> 
> Can we somehow remove that requirement for the devel/git port?  For
> example, if one has set all three {SRC,PORTS,DOC}_UPDATE_SKIP variables,
> then release/release.sh doesn't require devel/git to exist on the host.
> 
> I really don't need git on my build machine (and don't need it for
> building).
> 
Can you verify if the attached patch works for your use case?  You will
need to set NOGIT=1 in your release.conf.

Glen

Index: release/release.conf.sample
===================================================================
--- release/release.conf.sample (revision 365503)
+++ release/release.conf.sample (working copy)
@@ -12,6 +12,8 @@
 ## Set the directory within which the release will be built.
 CHROOTDIR="/scratch"
 
+## Do not explicitly require the devel/git port to be installed.
+#NOGIT=1
 ## Set the version control system host.
 GITROOT="https://cgit-beta.freebsd.org/";
 GITSRC="src.git"
Index: release/release.sh
===================================================================
--- release/release.sh  (revision 365503)
+++ release/release.sh  (working copy)
@@ -65,7 +65,7 @@ env_setup() {
                [ ! -z "${VCSCMD}" ] && break 2
        done
 
-       if [ -z "${VCSCMD}" ]; then
+       if [ -z "${VCSCMD}" -a ! -z "${NOGIT}" ]; then
                echo "*** The devel/git port/package is required."
                exit 1
        fi
@@ -275,30 +275,32 @@ extra_chroot_setup() {
                cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF}
        fi
 
-       # 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
-               # Trick the ports 'run-autotools-fixup' target to do the right
-               # thing.
-               _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
-               REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V 
REVISION)
-               BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH)
-               UNAME_r=${REVISION}-${BRANCH}
-               GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS"
-               GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL"
-               GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN"
-               GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2"
-               eval chroot ${CHROOTDIR} env OPTIONS_UNSET=\"${GITUNSETOPTS}\" \
-                       make -C /usr/ports/devel/git FORCE_PKG_REGISTER=1 \
-                       WRKDIRPREFIX=/tmp/ports \
-                       DISTDIR=/tmp/distfiles \
-                       install clean distclean
-       else
-               eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \
-                       pkg install -y devel/git
-               eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \
-                       pkg clean -y
+       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
+                       # Trick the ports 'run-autotools-fixup' target to do 
the right
+                       # thing.
+                       _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U)
+                       REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release 
-V REVISION)
+                       BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release 
-V BRANCH)
+                       UNAME_r=${REVISION}-${BRANCH}
+                       GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS"
+                       GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL"
+                       GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN"
+                       GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2"
+                       eval chroot ${CHROOTDIR} env 
OPTIONS_UNSET=\"${GITUNSETOPTS}\" \
+                               make -C /usr/ports/devel/git 
FORCE_PKG_REGISTER=1 \
+                               WRKDIRPREFIX=/tmp/ports \
+                               DISTDIR=/tmp/distfiles \
+                               install clean distclean
+               else
+                       eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \
+                               pkg install -y devel/git
+                       eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \
+                               pkg clean -y
+               fi
        fi
        if [ -d ${CHROOTDIR}/usr/ports ]; then
                # Trick the ports 'run-autotools-fixup' target to do the right

Attachment: signature.asc
Description: PGP signature

Reply via email to