SA Bugzilla – Bug 325
Problem setting $slash on Apple's Darwin
Last modified: 2002-06-09 18:29:17 UTC
The BEGIN block of spamassassin.raw contains this code: if ($^O eq 'MacOS') { $slash = ':'; $dirtrailer = ':'; } elsif ($^O =~ /(win|os2)/) { $slash = '\\'; } Unfortunately, on Mac OS X, $^O returns "darwin", which matches the /(win|os2)/ pattern, thus setting $slash to \. It should stay /, as with other Unixes. There are many possible fixes. Perhaps: SWITCH: { ($^O eq 'MacOS') && do { $slash = $dirtrailer = ':'; last SWITCH; }; ($^O =~ m/darwin/i) && do { last SWITCH; }; ($^O =~ m/(win|os2)/i) && do { $slash = '\\'; last SWITCH; }; } [Tested only on Mac OS X.]
Subject: Re: [SAdev] New: Problem setting $slash on Apple's Darwin bugzilla-daemon@hughes-family.org wrote: > http://www.hughes-family.org/bugzilla/show_bug.cgi?id=325 > > Summary: Problem setting $slash on Apple's Darwin > Product: Spamassassin > Version: 2.20 > Platform: Other > OS/Version: other > Status: NEW > Severity: normal > Priority: P2 > Component: spamassassin > AssignedTo: spamassassin-devel@lists.sourceforge.net > ReportedBy: DTalcott@purdue.edu > > > The BEGIN block of spamassassin.raw contains this code: > > if ($^O eq 'MacOS') { > $slash = ':'; $dirtrailer = ':'; > } elsif ($^O =~ /(win|os2)/) { > $slash = '\\'; > } > > Unfortunately, on Mac OS X, $^O returns "darwin", which matches the /(win|os2)/ pattern, thus setting $slash to \. It should stay /, as with other Unixes. > > There are many possible fixes. Perhaps: > > SWITCH: { > ($^O eq 'MacOS') && do { $slash = $dirtrailer = ':'; last SWITCH; }; > ($^O =~ m/darwin/i) && do { last SWITCH; }; > ($^O =~ m/(win|os2)/i) && do { $slash = '\\'; last SWITCH; }; > } > > [Tested only on Mac OS X.] I'm not really sure why that whole thing is even there. Can anyone explain to me? I've written plenty of modules with perl scripts that get installed in /usr/bin and all I do is add them to the EXE_FILES section. MakeMaker even fixes up the right path for me. *shrug* Matt.
Subject: Re: [SAdev] New: Problem setting $slash on Apple's Darwin bugzilla-daemon@hughes-family.org wrote: > http://www.hughes-family.org/bugzilla/show_bug.cgi?id=325 > > Summary: Problem setting $slash on Apple's Darwin > Product: Spamassassin > Version: 2.20 > Platform: Other > OS/Version: other > Status: NEW > Severity: normal > Priority: P2 > Component: spamassassin > AssignedTo: spamassassin-devel@lists.sourceforge.net > ReportedBy: DTalcott@purdue.edu > > > The BEGIN block of spamassassin.raw contains this code: > > if ($^O eq 'MacOS') { > $slash = ':'; $dirtrailer = ':'; > } elsif ($^O =~ /(win|os2)/) { > $slash = '\\'; > } > > Unfortunately, on Mac OS X, $^O returns "darwin", which matches the /(win|os2)/ pattern, thus setting $slash to \. It should stay /, as with other Unixes. > > There are many possible fixes. Perhaps: > > SWITCH: { > ($^O eq 'MacOS') && do { $slash = $dirtrailer = ':'; last SWITCH; }; > ($^O =~ m/darwin/i) && do { last SWITCH; }; > ($^O =~ m/(win|os2)/i) && do { $slash = '\\'; last SWITCH; }; > } > > [Tested only on Mac OS X.] I'm not really sure why that whole thing is even there. Can anyone explain to me? I've written plenty of modules with perl scripts that get installed in /usr/bin and all I do is add them to the EXE_FILES section. MakeMaker even fixes up the right path for me. *shrug* Matt. _______________________________________________________________ Have big pipes? SourceForge.net is looking for download mirrors. We supply the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net _______________________________________________ Spamassassin-devel mailing list Spamassassin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spamassassin-devel
Matt Sergeant asks, "I'm not really sure why that whole thing is even there?" It is needed to set @INC correctly when SpamAssassin is installed in a user's local files, rather than in a normal location.
Subject: Re: [SAdev] Problem setting $slash on Apple's Darwin > Matt Sergeant asks, "I'm not really sure why that whole thing is even > there?" It is needed to set @INC correctly when SpamAssassin is installed > in a user's local files, rather than in a normal location. Has anyone actually tested without it? I thought I read somewhere that / would be automatically be converted for finding paths. (I could be wrong!)
Duncf@rogers.com writes, "Has anyone actually tested without it?" I just retested. Mail vanishes with the original spamassassin code, but is delivered okay with the suggested change. The weird part is that it passes the manual tests given in the README. I know that at some time when I first installed SpamAssassin and was trying to get it to work, I saw an error message from perl to the effect that it could not find some package and listed the values in @INC. The list included two paths that would have been correct, except that they had a \ instead of a / at one place. That's how I found the bug. Again, I have tested only the case for spamassassin installed in $HOME/bin/SpamAssassin and being invoked from procmail running on Mac OS X.
I'm going to mark closed -- works fine for me on OSX for months now.