Skip to contentSkip to conversation

firmware/shim: fix build process to use POSIX find options

PATCH Michael Glasgow 3 participants 6 messages Jan 26, 2018 – Feb 1, 2018

lore
Share & tools
lore
#0 lore raw

This recent patch can be simplified a bit. (The patch below is untested, just a suggestion.)

tools/firmware/xen-dir/Makefile +2 -3
diff -ur a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile
@@ -20,9 +20,8 @@
 	rm -f linkfarm.stamp.tmp
 	$(foreach d, $(LINK_DIRS), \
 		 (mkdir -p $(D)/$(d); \
-		  cd $(D)/$(d); \
-		  find $(XEN_ROOT)/$(d)/ -type d -exec sh -c \
-		      "echo {} | sed 's,^$(XEN_ROOT)/$(d)/,,g' | xargs mkdir -p" \;);)
+		  cd $(D)/$(d) && \
+		  (cd $(XEN_ROOT)/$(d) && find . -type d) | xargs mkdir -p \;);)
 	$(foreach d, $(LINK_DIRS), \
 		(cd $(XEN_ROOT); \
 		 find $(d) ! -type l -type f \
Signature · 6 lines
Michael Glasgow <[email protected]>

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 3 lines · Michael Glasgow

This recent patch can be simplified a bit. (The patch below is untested, just a suggestion.)

Thanks, this LGTM, but it needs your Signed-off-by tag in order to be applied.

Also remember to Cc the maintainers when resending, I've done this for you now.

Quoted 24 lines

diff -ur a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile

tools/firmware/xen-dir/Makefile +2 -3
@@ -20,9 +20,8 @@
 	rm -f linkfarm.stamp.tmp
 	$(foreach d, $(LINK_DIRS), \
 		 (mkdir -p $(D)/$(d); \
-		  cd $(D)/$(d); \
-		  find $(XEN_ROOT)/$(d)/ -type d -exec sh -c \
-		      "echo {} | sed 's,^$(XEN_ROOT)/$(d)/,,g' | xargs mkdir -p" \;);)
+		  cd $(D)/$(d) && \
+		  (cd $(XEN_ROOT)/$(d) && find . -type d) | xargs mkdir -p \;);)
 	$(foreach d, $(LINK_DIRS), \
 		(cd $(XEN_ROOT); \
 		 find $(d) ! -type l -type f \
Signature · 7 lines
-- 
Michael Glasgow <[email protected]>

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

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

#2 lore raw
Quoted 6 lines · Roger Pau [Monn_]
Quoted 2 lines · Michael Glasgow

This recent patch can be simplified a bit. (The patch below is untested, just a suggestion.)

Thanks, this LGTM, but it needs your Signed-off-by tag in order to be applied.

Simplify posix-friendly changes a bit.

---

tools/firmware/xen-dir/Makefile 2018-01-26 11:51:41.279825142 -0600 renamed from tools/firmware/xen-dir/Makefile 2018-01-26 11:40:00.711389605 -0600 +2 -3
diff -ur a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile
@@ -20,9 +20,8 @@
        rm -f linkfarm.stamp.tmp
        $(foreach d, $(LINK_DIRS), \
                 (mkdir -p $(D)/$(d); \
-                 cd $(D)/$(d); \
-                 find $(XEN_ROOT)/$(d)/ -type d -exec sh -c \
-                     "echo {} | sed 's,^$(XEN_ROOT)/$(d)/,,g' | xargs mkdir -p"
 \;);)
+                 cd $(D)/$(d) && \
+                 (cd $(XEN_ROOT)/$(d) && find . -type d) | xargs mkdir -p \;);)
        $(foreach d, $(LINK_DIRS), \
                (cd $(XEN_ROOT); \
                 find $(d) ! -type l -type f \

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

Reviewed-by
#3 lore raw
Quoted 11 lines · Michael Glasgow
Quoted 6 lines · Roger Pau [Monn_]
Quoted 2 lines · Michael Glasgow

This recent patch can be simplified a bit. (The patch below is untested, just a suggestion.)

Thanks, this LGTM, but it needs your Signed-off-by tag in order to be applied.

Simplify posix-friendly changes a bit.

With one nit...

Quoted 6 lines

---

diff -ur a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile

tools/firmware/xen-dir/Makefile 2018-01-26 11:51:41.279825142 -0600 line 24

Quoted 8 lines
tools/firmware/xen-dir/Makefile 2018-01-26 11:51:41.279825142 -0600 renamed from tools/firmware/xen-dir/Makefile 2018-01-26 11:40:00.711389605 -0600 +1 -3
@@ -20,9 +20,8 @@
        rm -f linkfarm.stamp.tmp
        $(foreach d, $(LINK_DIRS), \
                 (mkdir -p $(D)/$(d); \
-                 cd $(D)/$(d); \
-                 find $(XEN_ROOT)/$(d)/ -type d -exec sh -c \
-                     "echo {} | sed 's,^$(XEN_ROOT)/$(d)/,,g' | xargs mkdir -p"
 \;);)
+                 cd $(D)/$(d) && \

There should be no need for the '&&', all this chunk should be executed with 'set -e', so please restore the previous ';'.

Thanks, Roger.

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

#4 lore raw
Quoted 20 lines
Quoted 1 line
Quoted 1 line · On 01.02.18 at 11:13, <[email protected]> wrote:
Quoted 11 lines · Michael Glasgow
Quoted 6 lines · Roger Pau [Monn_]
Quoted 2 lines · Michael Glasgow

This recent patch can be simplified a bit. (The patch below is untested, just a suggestion.)

Thanks, this LGTM, but it needs your Signed-off-by tag in order to be applied.

Simplify posix-friendly changes a bit.

With one nit...

Quoted 2 lines

---

Quoted 15 lines

tools/firmware/xen-dir/Makefile 2018-01-26 11:51:41.279825142 -0600 line 24

Quoted 12 lines

diff -ur a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile

tools/firmware/xen-dir/Makefile 2018-01-26 11:51:41.279825142 -0600 renamed from tools/firmware/xen-dir/Makefile 2018-01-26 11:40:00.711389605 -0600 +1 -3
@@ -20,9 +20,8 @@
        rm -f linkfarm.stamp.tmp
        $(foreach d, $(LINK_DIRS), \
                 (mkdir -p $(D)/$(d); \
-                 cd $(D)/$(d); \
-                 find $(XEN_ROOT)/$(d)/ -type d -exec sh -c \
-                     "echo {} | sed 's,^$(XEN_ROOT)/$(d)/,,g' | xargs mkdir -p"
 \;);)
+                 cd $(D)/$(d) && \

There should be no need for the '&&', all this chunk should be executed with 'set -e', so please restore the previous ';'.

As you've seen from the patch I've sent - "should be" != "is". The way it's currently placed the "set -e" has no effect at all.

Jan

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

#5 lore raw
Quoted 36 lines · Jan Beulich
Quoted 20 lines
Quoted 1 line
Quoted 1 line · On 01.02.18 at 11:13, <[email protected]> wrote:
Quoted 11 lines · Michael Glasgow
Quoted 6 lines · Roger Pau [Monn_]
Quoted 2 lines · Michael Glasgow

This recent patch can be simplified a bit. (The patch below is untested, just a suggestion.)

Thanks, this LGTM, but it needs your Signed-off-by tag in order to be applied.

Simplify posix-friendly changes a bit.

With one nit...

Quoted 2 lines

---

Quoted 15 lines

tools/firmware/xen-dir/Makefile 2018-01-26 11:51:41.279825142 -0600 line 24

Quoted 12 lines

diff -ur a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile

tools/firmware/xen-dir/Makefile 2018-01-26 11:51:41.279825142 -0600 renamed from tools/firmware/xen-dir/Makefile 2018-01-26 11:40:00.711389605 -0600 +1 -3
@@ -20,9 +20,8 @@
        rm -f linkfarm.stamp.tmp
        $(foreach d, $(LINK_DIRS), \
                 (mkdir -p $(D)/$(d); \
-                 cd $(D)/$(d); \
-                 find $(XEN_ROOT)/$(d)/ -type d -exec sh -c \
-                     "echo {} | sed 's,^$(XEN_ROOT)/$(d)/,,g' | xargs mkdir -p"
 \;);)
+                 cd $(D)/$(d) && \

There should be no need for the '&&', all this chunk should be executed with 'set -e', so please restore the previous ';'.

Quoted 2 lines

As you've seen from the patch I've sent - "should be" != "is". The way it's currently placed the "set -e" has no effect at all.

Hehe, yes, I've realized that, that's why I've said "should be". In any case this should stay as ';' and the set -e fixed like you do in your patch.

Roger.

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