Content-Type: multipart/mixed; boundary="===============3919580486096952021==" MIME-Version: 1.0 From: Rong Chen To: kbuild-all@lists.01.org Subject: Re: [PATCH] gcov: fail build on gcov_info size mismatch Date: Mon, 15 Mar 2021 10:31:49 +0800 Message-ID: <09373c3d-73e8-933a-24ad-5c4ba4fdc615@intel.com> In-Reply-To: List-Id: --===============3919580486096952021== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 3/13/21 1:52 AM, Linus Torvalds wrote: > On Thu, Mar 11, 2021 at 7:50 PM Rong Chen wrote: >> >> The issue is from a=3D!, and [ "$a $b" =3D ".size .LPBX0," ] can avoid t= he >> error. >> >> + [ ! =3D .size -a ABI =3D .LPBX0, ] >> ./kernel/gcov/geninfosize.sh: 13: [: =3D: unexpected operator > But that's not what the patch did. > > The patch used quotes around $a, so "$a" should still be fine. > > See: > > [torvalds(a)ryzen ~]$ a=3D"!" [ "$a" =3D ".size" ] > > is fine, but > > [torvalds(a)ryzen ~]$ a=3D"!" [ $a =3D ".size" ] > -bash: [: =3D: unary operator expected > > and the patch I saw, and that the test robot replied to, had that > correct quoting, afaik. > > So I still don't see what the test robot is complaining about. Was > there an earlier version of the patch without the quotes that I didn't > see? > > Or is the shell on the test robot doing something really really odd, > and it's somehow nds32-specific? > > Linus Hi Linus, It can be reproduced with '-a' option in dash: =C2=A0=C2=A0=C2=A0 $ a=3D"!" =C2=A0=C2=A0=C2=A0 $ [ "$a" =3D ".size" ] =C2=A0=C2=A0=C2=A0 $ [ "$a" =3D ".size" -a "$b" =3D ".LPBX0," ] =C2=A0=C2=A0=C2=A0 sh: 2: [: =3D: unexpected operator and there is a advice for the option at = https://wiki.ubuntu.com/DashAsBinSh, I'm not sure it's the best practice = or not. =C2=A0=C2=A0=C2=A0 While dash supports most uses of the -a and -o options,= they have = very confusing semantics even in bash and are best avoided. Commands = like the following: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [ \( "$foo" =3D "$bar" -a -f /b= in/baz \) -o ! -x /bin/quux ] =C2=A0=C2=A0=C2=A0 should be replaced with: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (([ "$foo" =3D "$bar" ] && [ -f= /bin/baz ]) || [ ! -x /bin/quux ]) Best Regards, Rong Chen --===============3919580486096952021==--