Bug 325 - Problem setting $slash on Apple's Darwin
Summary: Problem setting $slash on Apple's Darwin
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 2.20
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-16 07:48 UTC by Dale Talcott
Modified: 2002-06-09 18:29 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Dale Talcott 2002-05-16 07:48:20 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.]
Comment 1 Matt Sergeant 2002-05-16 09:18:45 UTC
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.


Comment 2 Matt Sergeant 2002-05-16 09:19:15 UTC
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

Comment 3 Dale Talcott 2002-05-16 15:51:15 UTC
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.
Comment 4 Duncan Findlay 2002-05-16 17:32:45 UTC
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!)

Comment 5 Dale Talcott 2002-05-17 08:21:13 UTC
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.
Comment 6 Craig Hughes 2002-06-10 02:29:17 UTC
I'm going to mark closed -- works fine for me on OSX for months now.