From owner-svn-src-projects@freebsd.org Thu Jul 16 20:34:27 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD42E36D19D for ; Thu, 16 Jul 2020 20:34:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B75Zq3vZ1z447k; Thu, 16 Jul 2020 20:34:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 698DCE483; Thu, 16 Jul 2020 20:34:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06GKYRV5085279; Thu, 16 Jul 2020 20:34:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06GKYQ46085275; Thu, 16 Jul 2020 20:34:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202007162034.06GKYQ46085275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Jul 2020 20:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r363258 - projects/release-git/release X-SVN-Group: projects X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: projects/release-git/release X-SVN-Commit-Revision: 363258 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2020 20:34:27 -0000 Author: gjb Date: Thu Jul 16 20:34:26 2020 New Revision: 363258 URL: https://svnweb.freebsd.org/changeset/base/363258 Log: Makefile.inc1: - New file. Adds logic to search for the git binary, as well as determining the branch and revision, used in various places. Makefile: - Remove searching for the svn{,lite} binary. Makefile.ec2: - Reduce duplicated code, removing searching for the svn{,lite} binary, in addition to EC2_SVN{BRANCH,REV}. - Rename EC2_SVN* with GIT* for consistency. Makefile.mirrors: - Remove the SRCBRANCH declaration, replaced with the exported GITBRANCH variable. - Update _SNAP_SUFFIX from SVNREVISION to GITREV, and remove the leading 'r' from it, since it will break git hashes. - Remove yet another instance of duplicated code to search for the svn{,version}lite binary. Sponsored by: Rubicon Communications, LLC (netgate.com) Added: projects/release-git/release/Makefile.inc1 (contents, props changed) Modified: projects/release-git/release/Makefile projects/release-git/release/Makefile.ec2 projects/release-git/release/Makefile.mirrors Modified: projects/release-git/release/Makefile ============================================================================== --- projects/release-git/release/Makefile Thu Jul 16 17:14:34 2020 (r363257) +++ projects/release-git/release/Makefile Thu Jul 16 20:34:26 2020 (r363258) @@ -90,15 +90,6 @@ EXTRA_PACKAGES+= src.txz .endif .if !defined(NODOC) EXTRA_PACKAGES+= reldoc -. if !defined(SVN) || empty(SVN) -. for S in svn svnlite -. for D in /usr/local/bin /usr/bin -. if(exists(${D}/${S})) -SVN?= ${D}/${S} -. endif -. endfor -. endfor -. endif .endif RELEASE_TARGETS= ftp @@ -173,7 +164,6 @@ ports.txz: reldoc: cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ env MAN4DIR=${WORLDDIR}/share/man/man4 \ - SVN=${SVN} \ _BRANCH=${BRANCH} \ ${MAKE} all install clean "FORMATS=html txt" \ INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ @@ -336,4 +326,5 @@ release-install: cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512 cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 +.include "${.CURDIR}/Makefile.inc1" .include "${.CURDIR}/Makefile.vm" Modified: projects/release-git/release/Makefile.ec2 ============================================================================== --- projects/release-git/release/Makefile.ec2 Thu Jul 16 17:14:34 2020 (r363257) +++ projects/release-git/release/Makefile.ec2 Thu Jul 16 20:34:26 2020 (r363258) @@ -5,30 +5,6 @@ # Makefile for creating an EC2 AMI from a disk image. # -# Figure out where SVN is -.if !defined(SVN_CMD) || empty(SVN_CMD) -. for _P in /usr/bin /usr/local/bin -. for _S in svn svnlite -. if exists(${_P}/${_S}) -SVN_CMD= ${_P}/${_S} -. endif -. endfor -. endfor -.endif -.if exists(${SRCTOP}/.svn) -. if empty(EC2_SVNBRANCH) - EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} 2>/dev/null | sed -e 's/\^\///' -. export EC2_SVNBRANCH -. endif -. if empty(EC2_SVNREV) - EC2_SVNREV!= ${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR} 2>/dev/null || true -. export EC2_SVNREV -. endif -.else -EC2_SVNBRANCH= unknown -EC2_SVNREV= unknown -.endif - .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE" AMINAMESUFFIX!= date +-%Y-%m-%d .endif @@ -40,7 +16,7 @@ PUBLICSNAP= --publicsnap .endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} -EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV} +EC2SNSVERS= ${GITBRANCH}@${GITREV} .endif .if ${TARGET_ARCH} != "amd64" EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} @@ -89,7 +65,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} ${EC2ARCH} --sriov --ena \ ${.OBJDIR}/ec2.raw \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ - "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \ + "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} @touch ${.TARGET} Added: projects/release-git/release/Makefile.inc1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/release-git/release/Makefile.inc1 Thu Jul 16 20:34:26 2020 (r363258) @@ -0,0 +1,25 @@ +# +# $FreeBSD$ +# + +# Figure out where the git binary is. +.if !defined(GIT_CMD) || empty(GIT_CMD) +. for _P in /usr/bin /usr/local/bin +. if exists(${_P}/git) +GIT_CMD= ${_P}/git +. endif +. endfor +. export GIT_CMD +.else +. error "Git binary not found. Set GIT_CMD appropriately." +.endif + +# Set the git branch and hash to export where needed. +.if !defined(GITBRANCH) || empty(GITBRANCH) +GITBRANCH!= ${GIT_CMD} rev-parse --abbrev-ref HEAD 2>/dev/null | sed -e 's/\^\///' +.export GITBRANCH +.endif +.if !defined(GITREV) || empty(GITREV) +GITREV!= ${GIT_CMD} rev-parse --verify --short HEAD 2>/dev/null || true +.export GITREV +.endif Modified: projects/release-git/release/Makefile.mirrors ============================================================================== --- projects/release-git/release/Makefile.mirrors Thu Jul 16 17:14:34 2020 (r363257) +++ projects/release-git/release/Makefile.mirrors Thu Jul 16 20:34:26 2020 (r363258) @@ -19,7 +19,6 @@ FTPDIR?= ${RELEASEDIR}/ftp-stage .if exists(${RELEASEDIR}) STAGE_TARGETS?= iso-images-stage .endif -SRCBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} .if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) . if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != "" @@ -31,26 +30,10 @@ EMBEDDED= 1 .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" || ${BRANCH:MALPHA*} != "" SNAPSHOT= 1 TLD?= ${FTPDIR}/snapshots -. if !defined(SVNREVISION) || empty(SVNREVISION) -. for _D in /usr/bin /usr/local/bin -. for _S in svnversion svnliteversion -. if exists(${_D}/${_S}) -SVNVERSION?= ${_D}/${_S} -. endif -. endfor -. endfor -. if exists(${SVNVERSION}) && !empty(SVNVERSION) -SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile -. endif -. endif # !defined(SVNREVISION) -. if !defined(BUILDDATE) || empty(BUILDDATE) -. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh) -BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d -. else +.if !defined(BUILDDATE) || empty(BUILDDATE) BUILDDATE!= date +%Y%m%d -. endif -. endif -_SNAP_SUFFIX:= ${BUILDDATE}-r${SVNREVISION} +.endif +_SNAP_SUFFIX:= ${BUILDDATE}-${GITREV} .else # release SNAPSHOT= @@ -187,8 +170,8 @@ iso-images-stage: mkdir -p ${FTP_DIR} cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE - echo ${SRCBRANCH} > ${FTP_DIR}/SRCBRANCH - echo r${SVNREVISION} > ${FTP_DIR}/REVISION + echo ${GITBRANCH} > ${FTP_DIR}/GITBRANCH + echo ${GITREV} > ${FTP_DIR}/REVISION cd ${TLD}/${TARGET} && \ ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ ${REVISION}-${BRANCH}