Fwd: Re: [PATCH 1/4] Rewrite basic_machine `if` with `case`

2018-04-26 Thread John Ericson
My bad, forgot to also reply to list-- Forwarded message --From: John Ericson Date: Apr 27, 2018 12:35 AMSubject: Re: [PATCH 1/4] Rewrite basic_machine `if` with `case`To: Ben Elliston Cc: Indeed it didn't. Is this set good with you in that regard? Conceptually, it's 3 patches in the first change and one in the second change, which is why there are only 2 change log entries, and in the 3rd and 4th commits. Feel free to squash.I wrote it the way I did to make the diff more readable. It took a bit to work it out what was going on before, find the refactor, and convince myself that it was backwards compatible, and breaking it up into steps like this helped me. But let me know if you rather have 2 patches (or 1!) than 4 instead.JohnOn Apr 26, 2018 9:18 PM, Ben Elliston  wrote:On Sat, Apr 21, 2018 at 10:01:26PM -0400, John Ericson wrote:



> OK the last email didn't contain the [PATCH] and attatchments

> instead, which may be less convenient.



It also didn't contain ChangeLog entries ..



Ben


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


Re: [PATCH 1/4] Rewrite basic_machine `if` with `case`

2018-04-26 Thread Ben Elliston
On Sat, Apr 21, 2018 at 10:01:26PM -0400, John Ericson wrote:

> OK the last email didn't contain the [PATCH] and attatchments
> instead, which may be less convenient.

It also didn't contain ChangeLog entries ..

Ben


signature.asc
Description: PGP signature
___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


[PATCH 1/4] Rewrite basic_machine `if` with `case`

2018-04-26 Thread John Ericson
OK the last email didn't contain the [PATCH] and attatchments instead,
which may be less convenient. Also, with my armv6m patch merged
(thanks!) there are some trivial conflicts and I realized I forgot to
include any change log entries (which you kindly added for that). So I
am now resubmitting a rebased version with change log entries.

Hope this is more convenient,

John

--
This hopefully makes the condition more readable
---
 config.sub | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/config.sub b/config.sub
index ba37cf9..ca94006 100755
--- a/config.sub
+++ b/config.sub
@@ -128,9 +128,14 @@ case $maybe_os in
 ;;
   *)
 basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
-if [ "$basic_machine" != "$1" ]
-then os=`echo "$1" | sed 's/.*-/-/'`
-else os=; fi
+case $1 in
+  *-*)
+os=`echo "$1" | sed 's/.*-/-/'`
+;;
+  *)
+os=
+;;
+esac
 ;;
 esac
 
-- 
2.16.2


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches