You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ruleqa@spamassassin.apache.org by Tom Hendrikx <to...@whyscream.net> on 2018/09/04 20:15:45 UTC

bashisms in automasscheck-minimal.sh

Hi,

today I updated the automasscheck-minimal.sh file I'm using. The copy I
had was from feb 2017. After the update my wrapper scripts didn't work
anymore.

It seems that there have been a few changes to the script (according to
svn log) "to improve /bin/sh compatibility", but actually the file has
quite a few bashims, and some were added by the commits to improve
/bin/sh compatibility. The script now doesn't work anymore with ubuntu's
bin/sh (which comes from dash).

My biggest concern is that new masscheckers fail to get stuff working
and give up setting up masschecks.

I'd be happy to fix the script to work using dash as /bin/sh too, but
don't have commit access. I'll post a patch here if anyone is interested
in committing it.

Kind regards

	Tom


Re: bashisms in automasscheck-minimal.sh

Posted by "Kevin A. McGrail" <km...@apache.org>.
Henrik, let's not break anything this week so if you can hold off until
after the release, please?

--
Kevin A. McGrail
VP Fundraising, Apache Software Foundation
Chair Emeritus Apache SpamAssassin Project
https://www.linkedin.com/in/kmcgrail - 703.798.0171

On Wed, Sep 5, 2018 at 2:46 AM, Henrik Krohns <he...@hege.li> wrote:

> On Tue, Sep 04, 2018 at 10:15:45PM +0200, Tom Hendrikx wrote:
> > Hi,
> >
> > today I updated the automasscheck-minimal.sh file I'm using. The copy I
> > had was from feb 2017. After the update my wrapper scripts didn't work
> > anymore.
> >
> > It seems that there have been a few changes to the script (according to
> > svn log) "to improve /bin/sh compatibility", but actually the file has
> > quite a few bashims, and some were added by the commits to improve
> > /bin/sh compatibility. The script now doesn't work anymore with ubuntu's
> > bin/sh (which comes from dash).
> >
> > My biggest concern is that new masscheckers fail to get stuff working
> > and give up setting up masschecks.
> >
> > I'd be happy to fix the script to work using dash as /bin/sh too, but
> > don't have commit access. I'll post a patch here if anyone is interested
> > in committing it.
>
> Noticed that too.  Is this contrib-script considered RTC?  I can change it
> back to bash.
>
> Grepping the whole spamassassin codebase you can find a 50/50 mix of
> #!/bin/sh
> and #!/bin/bash declarations.  Unless there is a clear vision of turning
> everything to purist super-portable POSIX code, there is no reason to avoid
> bash.
>
> Then there's also the matter of using "#!/usr/bin/env bash" or not.  This
> problem also affects Perl and the whole masscheck run.  I use custom perl
> location, so I have to do lots of sedding because masscheck script rsyncs a
> tagged build which has #!/usr/bin/perl everywhere.  It's probably not
> possible to use "#!/usr/bin/env perl", since spamassassin hardcodes correct
> location at installation time and there are "-w -T" perl options when
> #!shebang can only have one argument I think?
>
> So I would add a PERL= option to .automasscheck.cf that will sed necessary
> files.
>
> Cheers,
> Henrik
>

Re: bashisms in automasscheck-minimal.sh

Posted by Henrik Krohns <he...@hege.li>.
On Tue, Sep 04, 2018 at 10:15:45PM +0200, Tom Hendrikx wrote:
> Hi,
> 
> today I updated the automasscheck-minimal.sh file I'm using. The copy I
> had was from feb 2017. After the update my wrapper scripts didn't work
> anymore.
> 
> It seems that there have been a few changes to the script (according to
> svn log) "to improve /bin/sh compatibility", but actually the file has
> quite a few bashims, and some were added by the commits to improve
> /bin/sh compatibility. The script now doesn't work anymore with ubuntu's
> bin/sh (which comes from dash).
> 
> My biggest concern is that new masscheckers fail to get stuff working
> and give up setting up masschecks.
> 
> I'd be happy to fix the script to work using dash as /bin/sh too, but
> don't have commit access. I'll post a patch here if anyone is interested
> in committing it.

Noticed that too.  Is this contrib-script considered RTC?  I can change it
back to bash.

Grepping the whole spamassassin codebase you can find a 50/50 mix of #!/bin/sh
and #!/bin/bash declarations.  Unless there is a clear vision of turning
everything to purist super-portable POSIX code, there is no reason to avoid
bash.

Then there's also the matter of using "#!/usr/bin/env bash" or not.  This
problem also affects Perl and the whole masscheck run.  I use custom perl
location, so I have to do lots of sedding because masscheck script rsyncs a
tagged build which has #!/usr/bin/perl everywhere.  It's probably not
possible to use "#!/usr/bin/env perl", since spamassassin hardcodes correct
location at installation time and there are "-w -T" perl options when
#!shebang can only have one argument I think?

So I would add a PERL= option to .automasscheck.cf that will sed necessary
files.

Cheers,
Henrik