xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] stubdom: modify ioemu linkfarm only if necessary
@ 2016-12-13 13:58 Juergen Gross
  2016-12-13 15:15 ` Wei Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Gross @ 2016-12-13 13:58 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, samuel.thibault, wei.liu2

Several stubdom libraries are being rebuilt each time a top level make
is called as they depend on stubdom/ioemu/linkfarm.stamp which is
depending on tools/qemu-xen-traditional-dir. Unfortunately this
directory is modified by each "make tools" call.

This can be avoided by writing stubdom/ioemu/linkfarm.stamp only if
a source file beneath tools/qemu-xen-traditional-dir has been added
or removed.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2: maintain a list of the to be linked files in linkfarm.stamp and
    rebuild this list at each make call for detecting any change

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 stubdom/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index bc49cfe..38f1688 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -298,9 +298,13 @@ ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
 	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
 			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
 			'*.html' '*.pod'					\
-			)) |							\
-	    while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
-	touch ioemu/linkfarm.stamp
+			)) >linkfarm.stamp.tmp;				\
+	cmp linkfarm.stamp.tmp linkfarm.stamp 2>/dev/null &&		\
+		rm linkfarm.stamp.tmp || {				\
+		mv linkfarm.stamp.tmp linkfarm.stamp;			\
+		cat linkfarm.stamp | while read f;			\
+			do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done;	\
+	}
 else
 export QEMU_ROOT
 
-- 
2.10.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] stubdom: modify ioemu linkfarm only if necessary
  2016-12-13 13:58 [PATCH v2] stubdom: modify ioemu linkfarm only if necessary Juergen Gross
@ 2016-12-13 15:15 ` Wei Liu
  2016-12-13 15:24   ` Juergen Gross
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2016-12-13 15:15 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, wei.liu2, samuel.thibault

On Tue, Dec 13, 2016 at 02:58:27PM +0100, Juergen Gross wrote:
> Several stubdom libraries are being rebuilt each time a top level make
> is called as they depend on stubdom/ioemu/linkfarm.stamp which is
> depending on tools/qemu-xen-traditional-dir. Unfortunately this
> directory is modified by each "make tools" call.
> 
> This can be avoided by writing stubdom/ioemu/linkfarm.stamp only if
> a source file beneath tools/qemu-xen-traditional-dir has been added
> or removed.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

though ...

> ---
> V2: maintain a list of the to be linked files in linkfarm.stamp and
>     rebuild this list at each make call for detecting any change
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  stubdom/Makefile | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index bc49cfe..38f1688 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -298,9 +298,13 @@ ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
>  	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
>  			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
>  			'*.html' '*.pod'					\
> -			)) |							\
> -	    while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
> -	touch ioemu/linkfarm.stamp
> +			)) >linkfarm.stamp.tmp;				\
> +	cmp linkfarm.stamp.tmp linkfarm.stamp 2>/dev/null &&		\

I think we want 'cmp -s' here.

> +		rm linkfarm.stamp.tmp || {				\
> +		mv linkfarm.stamp.tmp linkfarm.stamp;			\
> +		cat linkfarm.stamp | while read f;			\
> +			do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done;	\
> +	}
>  else
>  export QEMU_ROOT
>  
> -- 
> 2.10.2
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] stubdom: modify ioemu linkfarm only if necessary
  2016-12-13 15:15 ` Wei Liu
@ 2016-12-13 15:24   ` Juergen Gross
  2016-12-13 15:27     ` Wei Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Gross @ 2016-12-13 15:24 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, samuel.thibault

On 13/12/16 16:15, Wei Liu wrote:
> On Tue, Dec 13, 2016 at 02:58:27PM +0100, Juergen Gross wrote:
>> Several stubdom libraries are being rebuilt each time a top level make
>> is called as they depend on stubdom/ioemu/linkfarm.stamp which is
>> depending on tools/qemu-xen-traditional-dir. Unfortunately this
>> directory is modified by each "make tools" call.
>>
>> This can be avoided by writing stubdom/ioemu/linkfarm.stamp only if
>> a source file beneath tools/qemu-xen-traditional-dir has been added
>> or removed.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> though ...
> 
>> ---
>> V2: maintain a list of the to be linked files in linkfarm.stamp and
>>     rebuild this list at each make call for detecting any change
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>>  stubdom/Makefile | 10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/stubdom/Makefile b/stubdom/Makefile
>> index bc49cfe..38f1688 100644
>> --- a/stubdom/Makefile
>> +++ b/stubdom/Makefile
>> @@ -298,9 +298,13 @@ ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
>>  	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
>>  			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
>>  			'*.html' '*.pod'					\
>> -			)) |							\
>> -	    while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
>> -	touch ioemu/linkfarm.stamp
>> +			)) >linkfarm.stamp.tmp;				\
>> +	cmp linkfarm.stamp.tmp linkfarm.stamp 2>/dev/null &&		\
> 
> I think we want 'cmp -s' here.

Oh, right. This removes the need for redirecting error output.
Shall I resend or could you fix it up when committing?


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] stubdom: modify ioemu linkfarm only if necessary
  2016-12-13 15:24   ` Juergen Gross
@ 2016-12-13 15:27     ` Wei Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2016-12-13 15:27 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, Wei Liu, samuel.thibault

On Tue, Dec 13, 2016 at 04:24:01PM +0100, Juergen Gross wrote:
> On 13/12/16 16:15, Wei Liu wrote:
> > On Tue, Dec 13, 2016 at 02:58:27PM +0100, Juergen Gross wrote:
> >> Several stubdom libraries are being rebuilt each time a top level make
> >> is called as they depend on stubdom/ioemu/linkfarm.stamp which is
> >> depending on tools/qemu-xen-traditional-dir. Unfortunately this
> >> directory is modified by each "make tools" call.
> >>
> >> This can be avoided by writing stubdom/ioemu/linkfarm.stamp only if
> >> a source file beneath tools/qemu-xen-traditional-dir has been added
> >> or removed.
> >>
> >> Signed-off-by: Juergen Gross <jgross@suse.com>
> > 
> > Acked-by: Wei Liu <wei.liu2@citrix.com>
> > 
> > though ...
> > 
> >> ---
> >> V2: maintain a list of the to be linked files in linkfarm.stamp and
> >>     rebuild this list at each make call for detecting any change
> >>
> >> Signed-off-by: Juergen Gross <jgross@suse.com>
> >> ---
> >>  stubdom/Makefile | 10 +++++++---
> >>  1 file changed, 7 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/stubdom/Makefile b/stubdom/Makefile
> >> index bc49cfe..38f1688 100644
> >> --- a/stubdom/Makefile
> >> +++ b/stubdom/Makefile
> >> @@ -298,9 +298,13 @@ ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
> >>  	(cd $$src && find *	! -type l  -type f  $(addprefix ! -name ,	\
> >>  			'*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen	\
> >>  			'*.html' '*.pod'					\
> >> -			)) |							\
> >> -	    while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
> >> -	touch ioemu/linkfarm.stamp
> >> +			)) >linkfarm.stamp.tmp;				\
> >> +	cmp linkfarm.stamp.tmp linkfarm.stamp 2>/dev/null &&		\
> > 
> > I think we want 'cmp -s' here.
> 
> Oh, right. This removes the need for redirecting error output.
> Shall I resend or could you fix it up when committing?
> 
> 

Please resend with my ack.

> Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-13 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-13 13:58 [PATCH v2] stubdom: modify ioemu linkfarm only if necessary Juergen Gross
2016-12-13 15:15 ` Wei Liu
2016-12-13 15:24   ` Juergen Gross
2016-12-13 15:27     ` Wei Liu

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).