Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2018 09:31:25 -0700
From:      Colin Percival <cperciva@freebsd.org>
To:        rgrimes@freebsd.org, Matthew Macy <mat.macy@gmail.com>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r336593 - head/release
Message-ID:  <c5cfb224-0701-dab7-790c-a08b37dcdca3@freebsd.org>
In-Reply-To: <201807221504.w6MF4bWW027109@pdx.rh.CN85.dnsmgr.net>
References:  <201807221504.w6MF4bWW027109@pdx.rh.CN85.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 07/22/18 08:04, Rodney W. Grimes wrote:
>> Build still works, but you're assuming that developers only use svn.
> 
> No, he correctly assumed that RELEASE engineering only uses svn/svnlite
> for building release images.  This Makefile is for production of
> official AMIs, official stuff always uses svn.

I'm about to head mostly-AFK for the week, but one option here would be
to change

EC2_SVNBRANCH!=        ${SVN_CMD} info --show-item relative-url ${WORLDDIR} |
sed -e 's/\^\///'
EC2_SVNREV!=   ${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR}

to

.if defined(SVN_CMD)
EC2_SVNBRANCH!=        ${SVN_CMD} info --show-item relative-url ${WORLDDIR} |
sed -e 's/\^\///'
EC2_SVNREV!=   ${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR}
.else
EC2_SVNBRANCH=	unknown
EC2_SVNREV=	unknown
.endif

I don't know if this will make any difference to anyone using this code,
but it should at least silence the warnings for people who aren't checking
code out from svn.

Colin Percival

>> make[1]: "/usr/home/mmacy/devel/freebsd/Makefile.inc1" line 343:
>> SYSTEM_COMPILER: libclang will be built for bootstrapping a
>> cross-compiler.
>> make[1]: "/usr/home/mmacy/devel/freebsd/Makefile.inc1" line 348:
>> SYSTEM_LINKER: libclang will be built for bootstrapping a
>> cross-linker.
>> svn: E155007: '/usr/home/mmacy/devel/freebsd' is not a working copy
>> svn: E155007: '/usr/home/mmacy/devel/freebsd' is not a working copy
>> make[2]: "/usr/home/mmacy/devel/freebsd/release/Makefile.ec2" line 19:
>> warning: "/usr/local/bin/svn info --show-item last-changed-revision
>> /usr/home/mmacy/devel/freebsd/release/.." returned non-zero status
>> svn: E155007: '/usr/home/mmacy/devel/freebsd' is not a working copy
>> svn: E155007: '/usr/home/mmacy/devel/freebsd' is not a working copy
>> make[2]: "/usr/home/mmacy/devel/freebsd/release/Makefile.ec2" line 19:
>> warning: "/usr/local/bin/svn info --show-item last-changed-revision
>> /usr/home/mmacy/devel/freebsd/release/.." returned non-zero status
>>
>> On Sat, Jul 21, 2018 at 3:54 PM, Colin Percival <cperciva@freebsd.org> wrote:
>>> 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}
>>>
>>
>>
> 

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c5cfb224-0701-dab7-790c-a08b37dcdca3>