xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "Keir (Xen.org)" <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 4 of 5] xen/makefile: Allow XEN_CHANGESET to be set externally
Date: Wed, 1 Aug 2012 10:33:33 +0100	[thread overview]
Message-ID: <5018F7ED.3010100@citrix.com> (raw)
In-Reply-To: <5018FBB60200007800091CCB@nat28.tlf.novell.com>


On 01/08/12 08:49, Jan Beulich wrote:
>>>> On 31.07.12 at 18:55, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
>> Andrew Cooper writes ("[PATCH 4 of 5] xen/makefile: Allow XEN_CHANGESET to be 
>> set externally"):
>> ..
>>> diff -r 6db5c184a777 -r ae32690d0d74 xen/Makefile
>>> --- a/xen/Makefile
>>> +++ b/xen/Makefile
>>> @@ -13,6 +13,7 @@ export BASEDIR := $(CURDIR)
>>>  export XEN_ROOT := $(BASEDIR)/..
>>>  
>>>  EFI_MOUNTPOINT ?= /boot/efi
>>> +XEN_CHANGESET  ?= $(shell hg root &> /dev/null && hg parents --template 
>> "{date|date} {rev}:{node|short}" || echo "unavailable" )
>>>  
>>>  .PHONY: default
>>>  default: build
>>> @@ -107,7 +108,7 @@ include/xen/compile.h: include/xen/compi
>>>  	    -e 's/@@version@@/$(XEN_VERSION)/g' \
>>>  	    -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
>>>  	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
>>> -	    -e 's!@@changeset@@!$(shell ((hg parents --template "{date|date} 
>> {rev}:{node|short}" >/dev/null && hg parents --template "{date|date} 
>> {rev}:{node|short}") || echo "unavailable") 2>/dev/null)!g' \
>>> +	    -e 's!@@changeset@@!$(XEN_CHANGESET)!g' \
>>>  	    < include/xen/compile.h.in > $@.new
>>>  	@grep \" .banner >> $@.new
>>>  	@grep -v \" .banner
>> We need to check how many times, and at which point, this gets
>> executed, when this patch is applied.  I think it's OK...
> If in doubt, perhaps the better option would be to execute this
> once unconditionally (via := assignment to a helper variable), or
> to use := here but frame the assignment with some if construct
> excluding it to be executed when the changeset was already
> specified (assuming that an empty specification is pointless,
> simply checking for it to be non-empty should suffice).
>
> Jan
>

The rule looks like:

# compile.h contains dynamic build info. Rebuilt on every 'make'
invocation.                                                                                                                                  

include/xen/compile.h: include/xen/compile.h.in .banner
        @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \

So it should only be executed once (unless someone is messing around
deleting compile.h)

Having said that, even if it were executed more than once, there is no
reasonable circumstance during which the contents of XEN_CHANGESET
should change.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

  reply	other threads:[~2012-08-01  9:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 15:51 [PATCH 0 of 5] Build system tweaks Andrew Cooper
2012-07-31 15:51 ` [PATCH 1 of 5] tools/ocaml: ignore and clean .spot and .spit files Andrew Cooper
2012-07-31 16:08   ` Ian Jackson
2012-08-01 11:47     ` Ian Campbell
2012-07-31 15:51 ` [PATCH 2 of 5] tools/config: Allow building of components to be controlled from .config Andrew Cooper
2012-07-31 16:10   ` Ian Jackson
2012-08-01 11:47     ` Ian Campbell
2012-07-31 15:51 ` [PATCH 3 of 5] config: Split debug build from debug symbols Andrew Cooper
2012-07-31 16:12   ` Ian Jackson
2012-08-01 11:47     ` Ian Campbell
2012-08-13 17:14   ` Ian Jackson
2012-07-31 15:52 ` [PATCH 4 of 5] xen/makefile: Allow XEN_CHANGESET to be set externally Andrew Cooper
2012-07-31 16:55   ` Ian Jackson
2012-08-01  7:49     ` Jan Beulich
2012-08-01  9:33       ` Andrew Cooper [this message]
2012-08-02 13:35         ` Ian Jackson
2012-08-02 13:47           ` Andrew Cooper
2012-07-31 15:52 ` [PATCH 5 of 5] makefile: Use $(abspath) for XEN_ROOT Andrew Cooper
2012-07-31 16:38   ` Jan Beulich
2012-07-31 16:54     ` Ian Jackson
2012-07-31 17:36     ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5018F7ED.3010100@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).