Skip to contentSkip to conversation

stubdom: modify ioemu linkfarm only if necessary

PATCH Superseded Juergen Gross 2 participants 4 messages Dec 13, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 stubdom: modify ioemu linkfarm only if necessary

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.

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

---
 stubdom/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
stubdom/Makefile +7 -3
index bc49cfe..38f1688 100644
@@ -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
 
Signature · 7 lines
2.10.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Acked-by on v2 1/1
#1 lore raw
Quoted 10 lines · Juergen Gross

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.

though ...

Quoted 14 lines

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

---
 stubdom/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
stubdom/Makefile +0 -0
index bc49cfe..38f1688 100644

stubdom/Makefile ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir · line 302

Quoted 8 lines
stubdom/Makefile +2 -3
@@ -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.

Quoted 11 lines
stubdom/Makefile +5 -0
+		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
 
Signature · 1 line
2.10.2

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 25 lines · Wei Liu
Quoted 10 lines · Juergen Gross

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.

though ...

Quoted 9 lines

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

---
 stubdom/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Quoted 15 lines

stubdom/Makefile ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir · line 302

Quoted 13 lines
stubdom/Makefile +2 -3
index bc49cfe..38f1688 100644
@@ -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
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
Quoted 42 lines · Juergen Gross
Quoted 25 lines · Wei Liu
Quoted 10 lines · Juergen Gross

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.

though ...

Quoted 9 lines

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

---
 stubdom/Makefile | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Quoted 15 lines

stubdom/Makefile ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir · line 302

Quoted 13 lines
stubdom/Makefile +2 -3
index bc49cfe..38f1688 100644
@@ -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.

Quoted 4 lines

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.

Quoted 1 line

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel