[llvm] r257663 - Remove bashism from merge.sh: POSIX sh does not have the `function`
Dimitry Andric via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 16 07:20:43 PST 2016
On 13 Jan 2016, at 22:09, Hans Wennborg <hans at chromium.org> wrote:
>
> On Wed, Jan 13, 2016 at 11:55 AM, Dimitry Andric <dimitry at andric.com> wrote:
>> On 13 Jan 2016, at 20:48, Dimitry Andric via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>>>
>>> Author: dim
>>> Date: Wed Jan 13 13:48:50 2016
>>> New Revision: 257663
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=257663&view=rev
>>> Log:
>>> Remove bashism from merge.sh: POSIX sh does not have the `function`
>>> reserved word, and it is even superfluous in bash, for this particular
>>> instance.
>>>
>>> Modified:
>>> llvm/trunk/utils/release/merge.sh
>>
>> Hi Hans,
>>
>> Can I merge this to the 3.8 branch? (Using the fixed merge.sh script of course ;-)
>
> I'm OK with that, but I'm thinking maybe the better fix is to change
> the shebang in these scripts to "#!/usr/bin/env bash", like in
> test-release.sh. For example, tag.sh and export.sh also use 'function'
> with #!/bin/sh.
I did a little inventory:
* There are 53 shell scripts under a release_38 llvm and clang checkout.
* 41 of those have #!/bin/sh
* 9 have #!/bin/bash (this usually won't work on e.g. FreeBSD)
* 2 have #!/usr/bin/env bash (this should work everywhere)
* 1 has #!/bin/csh
Of the /bin/sh scripts, only utils/release/export.sh and utils/release/tag.sh use the 'function' keyword, and for both files these can be safely deleted. They seem to run fine under FreeBSD /bin/sh.
So I think I'll just go ahead and fix up export.sh and tag.sh in a follow-up commit.
-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160116/a2317bfe/attachment.sig>
More information about the llvm-commits
mailing list