From owner-svn-src-all@freebsd.org Sat Jul 21 22:54:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12F09102F443; Sat, 21 Jul 2018 22:54:45 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7B547B349; Sat, 21 Jul 2018 22:54:44 +0000 (UTC) (envelope-from cperciva@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 831BE25558; Sat, 21 Jul 2018 22:54:44 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6LMsigV000890; Sat, 21 Jul 2018 22:54:44 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6LMsi3v000889; Sat, 21 Jul 2018 22:54:44 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201807212254.w6LMsi3v000889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 21 Jul 2018 22:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336593 - head/release X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 336593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2018 22:54:45 -0000 Author: cperciva Date: Sat Jul 21 22:54:43 2018 New Revision: 336593 URL: https://svnweb.freebsd.org/changeset/base/336593 Log: Use svn or svnlite, or ${SVN_CMD} if set, for extracting the SVN branch and revision number announced in SNS notifications about new EC2 AMIs. While I'm here, incorporate that information into the AMI "description" fields, since it's more useful than simply echoing the information already provided via the AMI "name". Approved by: gjb Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Sat Jul 21 22:15:48 2018 (r336592) +++ head/release/Makefile.ec2 Sat Jul 21 22:54:43 2018 (r336593) @@ -5,6 +5,19 @@ # 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 +EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} | sed -e 's/\^\///' +EC2_SVNREV!= ${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR} + .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE" AMINAMESUFFIX!= date +-%Y-%m-%d .endif @@ -13,8 +26,6 @@ PUBLISH= --public .endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} -EC2_SVNBRANCH!= svn info --show-item relative-url ${WORLDDIR} | sed -e 's/\^\///' -EC2_SVNREV!= svn info --show-item last-changed-revision ${WORLDDIR} EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV} .endif @@ -60,7 +71,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} /usr/local/bin/bsdec2-image-upload ${PUBLISH} --sriov --ena \ ${.OBJDIR}/ec2.raw \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ - "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \ + "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} @touch ${.TARGET}