Bug 91621 - libgo/mksysinfo.sh: please avoid test ==
Summary: libgo/mksysinfo.sh: please avoid test ==
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 9.2.0
: P3 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-30 22:33 UTC by Harald van Dijk
Modified: 2019-09-10 20:48 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk 2019-08-30 22:33:05 UTC
r269424 introduced in libgo/mksysinfo.sh:

  if test "$statfs" == ""; then

test == is non-POSIX and not supported in all shells. In my GCC 9.2.0 build log, I see

  /h/gcc-9.2.0/libgo/mksysinfo.sh: 1130: test: type _statfs64 struct { f_type int64; f_bsize int64; f_blocks uint64; f_bfree uint64; f_bavail uint64; f_files uint64; f_ffree uint64; f_fsid ___fsid_t; f_namelen int64; f_frsize int64; f_flags int64; f_spare [3+1]int64; }: unexpected operator

Can this please be changed to use = rather than == ?
Comment 1 ian@gcc.gnu.org 2019-09-10 20:32:51 UTC
Author: ian
Date: Tue Sep 10 20:32:20 2019
New Revision: 275608

URL: https://gcc.gnu.org/viewcvs?rev=275608&root=gcc&view=rev
Log:
	PR go/91621
    mksysinfo: change test == to test =
    
    Fixes https://gcc.gnu.org/PR91621
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194569

Modified:
    trunk/gcc/go/gofrontend/MERGE
    trunk/libgo/mksysinfo.sh
Comment 2 ian@gcc.gnu.org 2019-09-10 20:33:19 UTC
Author: ian
Date: Tue Sep 10 20:32:42 2019
New Revision: 275609

URL: https://gcc.gnu.org/viewcvs?rev=275609&root=gcc&view=rev
Log:
	PR go/91621
    mksysinfo: change test == to test =
    
    Fixes https://gcc.gnu.org/PR91621
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194569

Modified:
    branches/gcc-9-branch/libgo/mksysinfo.sh
Comment 3 Ian Lance Taylor 2019-09-10 20:48:54 UTC
Thanks.  Fixed on trunk and GCC 9 branch.