[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MacPerl port



>At 1:22 AM +0100 12/18/98, Jean-Charles BERTIN wrote:
>
>} Hi !
>}
>} I spent the last weekend to port differents CPAN modules to MacPerl:
>} MailTools-1.12
>
>This you should not have needed to port.  See
><http://www.connect.net/gbarr/cpan-test/by-dist/MailTools.html >.
>
>Send the changes you needed to make to the list or send a Unix diff to
>MailTool's author, Graham Barr.  But there shouldn't have been anything
>left to fix, so I'm curious as to what you think needed fixing (and I can't
>get through to your ftp site).  In any event, since Graham is quite willing
>to support MacPerl, the changes should be included in the main source.

Sorry for that ! MailTools-1.12 don't need any changes...

>
>} MIME-Base64-2.09
>
>Similarly here.  There should be nothing that needs changing.  Chris has
>this module compiled for MacPerl at his site <http://pudge.net/macperl/>.
>

I made only add a typecast in 'decode_base64' to avoid a warning in CW:

   register unsigned char *str = (unsigned char*) SvPV(sv, len);

I also add the PPC and CFM68K compiled libraries in the archive for 
conveniance.

>} MIME-tools-4.121
>}
>} I correct few problems with line endings and file paths. To see
>} differences,
>} compare them with the original CPAN modules. You need also the
>} 'libnet-1.0605'
>} modify by Paul Schinder for these modules to work.
>

This one really needs modifications:

  - Entity.pm : in 'build', change

        # Get recommended filename, allowing explicit no-value value:
        my ($path_fname) = (($params{Path}||'') =~ m{([^/]+)\Z});

                to

        # Get recommended filename, allowing explicit no-value value:
	       my $sep          = ($^O eq 'MacOS') ? ':' : '/';
        my ($path_fname) = (($params{Path}||'') =~ m{([^$sep]+)\Z});


  - Parser.pm :

                **** change 'evil_filename'

        sub evil_filename {
            my ($self, $name) = @_;
            return (!defined($name) or ($name eq '') or ($name =~ 
m{/|^(\.+)\Z}));
        }

                to

        sub evil_filename {
            my ($self, $name) = @_;
    
            my $is_evil;
            if ($^O eq 'MacOS') {
                $is_evil=(!defined($name) or ($name eq '') or ($name =~ 
/:/));
            }
            else {
                $is_evil=(!defined($name) or ($name eq '') or ($name =~ 
m{/|^(\.+)\Z}));
            }
    
            $is_evil;
        }

                **** change 'output_dir', change

        sub output_dir {
            my ($self, $dir) = @_;

            if (@_ > 1) {     # arg given...
	               $dir = '.' if (!defined($dir) || ($dir eq ''));   # 
coerce empty to "."
	               $dir = '/.' if ($dir eq '/');   # coerce "/" so 
"$dir/$filename" works
	               $dir =~ s|/$||;                 # be nice: get rid of any 
trailing "/"
	               $self->{MP_Dir} = $dir;
            }
            $self->{MP_Dir};
        }

                to

        sub output_dir {
            my ($self, $dir) = @_;

            if (@_ > 1) {     # arg given...
            if ($^O eq 'MacOS') {
		              $dir =~ s/:$//;                 # be nice: get rid of any 
trailing ":"
		              $self->{MP_Dir} = $dir;
            }
            else {
	              	$dir = '.' if (!defined($dir) || ($dir eq ''));   # 
coerce empty to "."
		              $dir = '/.' if ($dir eq '/');   # coerce "/" so 
"$dir/$filename" works
		              $dir =~ s|/$||;                 # be nice: get rid of any 
trailing "/"
		              $self->{MP_Dir} = $dir;
            }}
            $self->{MP_Dir};
        }

                **** in 'output_path', change

        return "$outdir/$outname";  

                to

        return (($^O eq 'MacOS') ? "$outdir:$outname" : 
"$outdir/$outname");

  - Latin1.pm : Add complete support MacOS 8-bit ASCII coding.

  - Decoder/QuotedPrint.pm :  Add complete support MacOS 8-bit ASCII 
coding.

  - t/*.t : Modify test files for MacOS.


>libnet is now up to 1.0606, and includes full MacPerl support out of the
>box.  You can find it at any CPAN site.
>

Thanx for the info !




Jean-Charles BERTIN           <mailto:jc.bertin@mipsys.com>
-----------------------------------------------------------
Software engineer
MIPSYS                              Tel.: +33 1 64 86 26 00



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch