svn commit: r363740 - in projects/release-git/release: . scripts
Glen Barber
gjb at FreeBSD.org
Fri Jul 31 19:31:53 UTC 2020
Author: gjb
Date: Fri Jul 31 19:31:52 2020
New Revision: 363740
URL: https://svnweb.freebsd.org/changeset/base/363740
Log:
release: update to use git instead of svn:
release.sh:
- Bump the version number.
- Default VCSCMD to '/usr/local/bin/git clone'.
- Rename SVN* variables to GIT* equivalents.
- Remove dead code to inject a trailing '/' between two variables.
- Remove SRC_FORCE_CHECKOUT.
- Exit if the build host does not have devel/git installed.
- Install devel/git in the build chroot(8) for newvers.sh.
release.conf.sample:
- Update sample configuration variables to the git equivalent.
relnotes-search.sh:
- Remove script. It is specifically for use with svn.
Sponsored by: Rubicon Communications, LLC (netgate.com)
Deleted:
projects/release-git/release/scripts/relnotes-search.sh
Modified:
projects/release-git/release/release.conf.sample
projects/release-git/release/release.sh
Modified: projects/release-git/release/release.conf.sample
==============================================================================
--- projects/release-git/release/release.conf.sample Fri Jul 31 19:25:35 2020 (r363739)
+++ projects/release-git/release/release.conf.sample Fri Jul 31 19:31:52 2020 (r363740)
@@ -12,23 +12,19 @@
## Set the directory within which the release will be built.
CHROOTDIR="/scratch"
-## Set the svn host.
-SVNROOT="svn://svn.FreeBSD.org/"
+## Set the version control system host.
+GITROOT="https://cgit-beta.freebsd.org/"
+GITSRC="src.git"
+GITPORTS="ports.git"
+GITDOC="doc.git"
## Set the src/, ports/, and doc/ branches or tags.
-SRCBRANCH="base/head at rHEAD"
-DOCBRANCH="doc/head at rHEAD"
-PORTBRANCH="ports/head at rHEAD"
+SRCBRANCH="main"
+DOCBRANCH="main"
+PORTBRANCH="main"
-## Run svn co --force for src checkout.
-#SRC_FORCE_CHECKOUT=yes
-
-## Sample configuration for using git instead of svn.
-#VCSCMD="/usr/local/bin/git clone --branch master"
-#SVNROOT=""
-#SRCBRANCH="https://github.com/freebsd/freebsd"
-#DOCBRANCH="https://github.com/freebsd/freebsd-doc"
-#PORTBRANCH="https://github.com/freebsd/freebsd-ports"
+## Sample configuration for using git from ports.
+#GITCMD="/usr/local/bin/git clone --branch main"
## Set to override the default target architecture.
#TARGET="amd64"
Modified: projects/release-git/release/release.sh
==============================================================================
--- projects/release-git/release/release.sh Fri Jul 31 19:25:35 2020 (r363739)
+++ projects/release-git/release/release.sh Fri Jul 31 19:31:52 2020 (r363740)
@@ -38,7 +38,7 @@
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
-VERSION=2
+VERSION=3
# Prototypes that can be redefined per-chroot or per-target.
load_chroot_env() { }
@@ -51,7 +51,7 @@ usage() {
}
# env_setup(): Set up the default build environment variables, such as the
-# CHROOTDIR, VCSCMD, SVNROOT, etc. This is called before the release.conf
+# CHROOTDIR, VCSCMD, GITROOT, etc. This is called before the release.conf
# file is sourced, if '-c <release.conf>' is specified.
env_setup() {
# The directory within which the release will be built.
@@ -60,27 +60,29 @@ env_setup() {
# The default version control system command to obtain the sources.
for _dir in /usr/bin /usr/local/bin; do
- for _svn in svn svnlite; do
- [ -x "${_dir}/${_svn}" ] && VCSCMD="${_dir}/${_svn}"
- [ ! -z "${VCSCMD}" ] && break 2
- done
+ [ -x "${_dir}/git" ] && VCSCMD="/${_dir}/git"
+ [ ! -z "${VCSCMD}" ] && break 2
done
- VCSCMD="${VCSCMD} checkout"
- # The default svn checkout server, and svn branches for src/, doc/,
+ if [ -z "${VCSCMD}" ]; then
+ echo "*** The devel/git port/package is required."
+ exit 1
+ fi
+ VCSCMD="/usr/local/bin/git clone"
+
+ # The default git checkout server, and branches for src/, doc/,
# and ports/.
- SVNROOT="svn://svn.FreeBSD.org/"
- SRCBRANCH="base/head at rHEAD"
- DOCBRANCH="doc/head at rHEAD"
- PORTBRANCH="ports/head at rHEAD"
+ GITROOT="https://cgit-beta.FreeBSD.org/"
+ SRCBRANCH="main"
+ DOCBRANCH="main"
+ PORTBRANCH="main"
+ GITSRC="src.git"
+ GITPORTS="ports.git"
+ GITDOC="doc.git"
# Set for embedded device builds.
EMBEDDEDBUILD=
- # Sometimes one needs to checkout src with --force svn option.
- # If custom kernel configs copied to src tree before checkout, e.g.
- SRC_FORCE_CHECKOUT=
-
# The default make.conf and src.conf to use. Set to /dev/null
# by default to avoid polluting the chroot(8) environment with
# non-default settings.
@@ -128,20 +130,11 @@ env_setup() {
# in env_setup() if '-c <release.conf>' is specified.
env_check() {
chroot_build_release_cmd="chroot_build_release"
- # Fix for backwards-compatibility with release.conf that does not have
- # the trailing '/'.
- case ${SVNROOT} in
- *svn*)
- SVNROOT="${SVNROOT}/"
- ;;
- *)
- ;;
- esac
- # Prefix the branches with the SVNROOT for the full checkout URL.
- SRCBRANCH="${SVNROOT}${SRCBRANCH}"
- DOCBRANCH="${SVNROOT}${DOCBRANCH}"
- PORTBRANCH="${SVNROOT}${PORTBRANCH}"
+ # Prefix the branches with the GITROOT for the full checkout URL.
+ SRC="${GITROOT}${GITSRC}"
+ DOC="${GITROOT}${GITDOC}"
+ PORT="${GITROOT}${GITPORTS}"
if [ -n "${EMBEDDEDBUILD}" ]; then
WITH_DVD=
@@ -187,11 +180,6 @@ env_check() {
else
ARCH_FLAGS=
fi
- # Force src checkout if configured
- FORCE_SRC_KEY=
- if [ -n "${SRC_FORCE_CHECKOUT}" ]; then
- FORCE_SRC_KEY="--force"
- fi
if [ -z "${CHROOTDIR}" ]; then
echo "Please set CHROOTDIR."
@@ -231,13 +219,13 @@ chroot_setup() {
mkdir -p ${CHROOTDIR}/usr
if [ -z "${SRC_UPDATE_SKIP}" ]; then
- ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src
+ ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src
fi
if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then
- ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc
+ ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc
fi
if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then
- ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports
+ ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports
fi
if [ -z "${CHROOTBUILD_SKIP}" ]; then
@@ -274,6 +262,25 @@ 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.
+ 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)
+ 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
+ fi
if [ -d ${CHROOTDIR}/usr/ports ]; then
# Trick the ports 'run-autotools-fixup' target to do the right
# thing.
More information about the svn-src-projects
mailing list