public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [Patch] [Makefile] Exit if provided an incorrect argument
@ 2018-12-14 15:16 Matthew Malcomson
  2019-01-15 10:01 ` Matthew Malcomson
  2019-01-15 10:04 ` Florian Weimer
  0 siblings, 2 replies; 5+ messages in thread
From: Matthew Malcomson @ 2018-12-14 15:16 UTC (permalink / raw)
  To: libc-alpha; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 814 bytes --]

At the moment the ./testrun.sh file generated for testing a new glibc
doesn't handle incorrect arguments well.
It prints the usage of the script in an infinite loop.

This patch stops the infinite loop by exiting the program.

Tested by manually running the script after building.
I don't have commit rights, so if OK could someone commit this for me.
OK for master?

ChangeLog:

2018-11-29  Matthew Malcomson  <matthew.malcomson@arm.com>

	* Makefile (testrun.sh): Exit if provided incorrect arg.


diff --git a/Makefile b/Makefile
index b4703e48fec93075cd5e3ddd83469705d2fee8f8..1e1866be3da1ba4520911eb27016544de419161b 100644
--- a/Makefile
+++ b/Makefile
@@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
       ;;
     --*)
       usage
+      exit 1
       ;;
     *)
       break


[-- Attachment #2: testrun-help-fix.patch --]
[-- Type: text/plain, Size: 284 bytes --]

diff --git a/Makefile b/Makefile
index b4703e48fec93075cd5e3ddd83469705d2fee8f8..1e1866be3da1ba4520911eb27016544de419161b 100644
--- a/Makefile
+++ b/Makefile
@@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
       ;;
     --*)
       usage
+      exit 1
       ;;
     *)
       break


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

* Re: [Patch] [Makefile] Exit if provided an incorrect argument
  2018-12-14 15:16 [Patch] [Makefile] Exit if provided an incorrect argument Matthew Malcomson
@ 2019-01-15 10:01 ` Matthew Malcomson
  2019-01-15 10:04 ` Florian Weimer
  1 sibling, 0 replies; 5+ messages in thread
From: Matthew Malcomson @ 2019-01-15 10:01 UTC (permalink / raw)
  To: libc-alpha; +Cc: nd

ping


On 14/12/18 14:26, Matthew Malcomson wrote:
> At the moment the ./testrun.sh file generated for testing a new glibc
> doesn't handle incorrect arguments well.
> It prints the usage of the script in an infinite loop.
>
> This patch stops the infinite loop by exiting the program.
>
> Tested by manually running the script after building.
> I don't have commit rights, so if OK could someone commit this for me.
> OK for master?
>
> ChangeLog:
>
> 2018-11-29  Matthew Malcomson  <matthew.malcomson@arm.com>
>
> 	* Makefile (testrun.sh): Exit if provided incorrect arg.
>
>
> diff --git a/Makefile b/Makefile
> index b4703e48fec93075cd5e3ddd83469705d2fee8f8..1e1866be3da1ba4520911eb27016544de419161b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
>         ;;
>       --*)
>         usage
> +      exit 1
>         ;;
>       *)
>         break
>

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

* Re: [Patch] [Makefile] Exit if provided an incorrect argument
  2018-12-14 15:16 [Patch] [Makefile] Exit if provided an incorrect argument Matthew Malcomson
  2019-01-15 10:01 ` Matthew Malcomson
@ 2019-01-15 10:04 ` Florian Weimer
  2019-01-15 10:33   ` Matthew Malcomson
  1 sibling, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2019-01-15 10:04 UTC (permalink / raw)
  To: Matthew Malcomson; +Cc: libc-alpha, nd

* Matthew Malcomson:

> --- a/Makefile
> +++ b/Makefile
> @@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
>        ;;
>      --*)
>        usage
> +      exit 1
>        ;;
>      *)
>        break

I think you should add the exit to the usage function.

Thanks,
Florian

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

* Re: [Patch] [Makefile] Exit if provided an incorrect argument
  2019-01-15 10:04 ` Florian Weimer
@ 2019-01-15 10:33   ` Matthew Malcomson
  2019-02-04 12:09     ` Florian Weimer
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Malcomson @ 2019-01-15 10:33 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha, nd

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]

On 15/01/19 10:03, Florian Weimer wrote:
> * Matthew Malcomson:
>
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
>>         ;;
>>       --*)
>>         usage
>> +      exit 1
>>         ;;
>>       *)
>>         break
> I think you should add the exit to the usage function.
>
> Thanks,
> Florian

Makes sense -- thanks!
Fixed patch attached.

ChangeLog:

2019-01-15  Matthew Malcomson  <matthew.malcomson@arm.com>

	* Makefile (testrun.sh): Exit if provided incorrect arg.


--- Patch Inlined for ease of reply ----

diff --git a/Makefile b/Makefile
index b4703e4..9d76d86 100644
--- a/Makefile
+++ b/Makefile
@@ -137,6 +137,7 @@ GCONV_PATH="$${builddir}/iconvdata"
  usage () {
    echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
    echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
+  exit 1
  }

  toolname=default


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: testrun-help-fix.patch --]
[-- Type: text/x-patch; name="testrun-help-fix.patch", Size: 338 bytes --]

diff --git a/Makefile b/Makefile
index b4703e4..9d76d86 100644
--- a/Makefile
+++ b/Makefile
@@ -137,6 +137,7 @@ GCONV_PATH="$${builddir}/iconvdata"
 usage () {
   echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
   echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
+  exit 1
 }
 
 toolname=default


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

* Re: [Patch] [Makefile] Exit if provided an incorrect argument
  2019-01-15 10:33   ` Matthew Malcomson
@ 2019-02-04 12:09     ` Florian Weimer
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Weimer @ 2019-02-04 12:09 UTC (permalink / raw)
  To: Matthew Malcomson; +Cc: libc-alpha, nd

* Matthew Malcomson:

> On 15/01/19 10:03, Florian Weimer wrote:
>> * Matthew Malcomson:
>>
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -148,6 +148,7 @@ while test $$# -gt 0 ; do
>>>         ;;
>>>       --*)
>>>         usage
>>> +      exit 1
>>>         ;;
>>>       *)
>>>         break
>> I think you should add the exit to the usage function.
>>
>> Thanks,
>> Florian
>
> Makes sense -- thanks!
> Fixed patch attached.

Thanks, pushed.

Florian

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

end of thread, other threads:[~2019-02-04 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14 15:16 [Patch] [Makefile] Exit if provided an incorrect argument Matthew Malcomson
2019-01-15 10:01 ` Matthew Malcomson
2019-01-15 10:04 ` Florian Weimer
2019-01-15 10:33   ` Matthew Malcomson
2019-02-04 12:09     ` Florian Weimer

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 read-only IMAP folder(s) and NNTP newsgroup(s).