public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR 90142: contrib/download_prerequisites uses test ==
@ 2021-08-30 20:47 apinski
  2021-08-31  6:08 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: apinski @ 2021-08-30 20:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andrew Pinski

From: Andrew Pinski <apinski@marvell.com>

Since == is not portable, it is better to use = in contrib/
download_prerequisites.  The only place == was used is inside
the function md5_check which is used only on Mac OS X.

Tested on Mac OS X as:
./contrib/download_prerequisites --md5
Both with all files having the correct checksum and one with a broken one.

contrib/ChangeLog:

	* download_prerequisites (md5_check): Replace == inside
	test with = to be more portable.
---
 contrib/download_prerequisites | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites
index 8f69b61f5a9..11c283ecb1a 100755
--- a/contrib/download_prerequisites
+++ b/contrib/download_prerequisites
@@ -113,7 +113,7 @@ md5_check() {
   md5_checksum_output=$(md5 -r "${file_to_check}")
   # Grab the text before the first space
   md5_checksum_detected="${md5_checksum_output%% *}"
-  [ "${md5_checksum_expected}" == "${md5_checksum_detected}" ] \
+  [ "${md5_checksum_expected}" = "${md5_checksum_detected}" ] \
     || die "Cannot verify integrity of possibly corrupted file ${file_to_check}"
   echo "${file_to_check}: OK"
 }
-- 
2.17.1


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

* Re: [PATCH] Fix PR 90142: contrib/download_prerequisites uses test ==
  2021-08-30 20:47 [PATCH] Fix PR 90142: contrib/download_prerequisites uses test == apinski
@ 2021-08-31  6:08 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-08-31  6:08 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Patches

On Mon, Aug 30, 2021 at 10:49 PM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> Since == is not portable, it is better to use = in contrib/
> download_prerequisites.  The only place == was used is inside
> the function md5_check which is used only on Mac OS X.
>
> Tested on Mac OS X as:
> ./contrib/download_prerequisites --md5
> Both with all files having the correct checksum and one with a broken one.

Ok.

> contrib/ChangeLog:
>
>         * download_prerequisites (md5_check): Replace == inside
>         test with = to be more portable.
> ---
>  contrib/download_prerequisites | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites
> index 8f69b61f5a9..11c283ecb1a 100755
> --- a/contrib/download_prerequisites
> +++ b/contrib/download_prerequisites
> @@ -113,7 +113,7 @@ md5_check() {
>    md5_checksum_output=$(md5 -r "${file_to_check}")
>    # Grab the text before the first space
>    md5_checksum_detected="${md5_checksum_output%% *}"
> -  [ "${md5_checksum_expected}" == "${md5_checksum_detected}" ] \
> +  [ "${md5_checksum_expected}" = "${md5_checksum_detected}" ] \
>      || die "Cannot verify integrity of possibly corrupted file ${file_to_check}"
>    echo "${file_to_check}: OK"
>  }
> --
> 2.17.1
>

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

end of thread, other threads:[~2021-08-31  6:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 20:47 [PATCH] Fix PR 90142: contrib/download_prerequisites uses test == apinski
2021-08-31  6:08 ` Richard Biener

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