use Config;
use File::Basename qw(&basename &dirname);
use Cwd;
+use File::Spec::Functions;
# List explicitly here the variables you want Configure to
# generate. Metaconfig only looks for shell variables, so you
# extract patchlevel.h information
-open PATCH_LEVEL, "<../patchlevel.h" or die "Can't open patchlevel.h: $!";
+open PATCH_LEVEL, "<" . catfile(updir, "patchlevel.h")
+ or die "Can't open patchlevel.h: $!";
my $patchlevel_date = (stat PATCH_LEVEL)[9];
print OUT <<'!NO!SUBS!';
use Config;
+use File::Spec::Functions;
use Getopt::Std;
use strict;
$::HaveUtil = ($@ eq "");
};
-my $Version = "1.26";
+my $Version = "1.27";
# Changed in 1.06 to skip Mail::Send and Mail::Util if not available.
# Changed in 1.07 to see more sendmail execs, and added pipe output.
# Changed in 1.24 Added '-F<file>' to save report HVDS 98-07-01
# Changed in 1.25 Warn on failure to open save file. HVDS 98-07-12
# Changed in 1.26 Don't require -t STDIN for -ok. HVDS 98-07-15
+# Changed in 1.27 Added Mac OS and File::Spec support CNANDOR 99-07-27
# TODO: - Allow the user to re-name the file on mail failure, and
# make sure failure (transmission-wise) of Mail::Send is
# - Test -b option
my( $file, $usefile, $cc, $address, $perlbug, $testaddress, $filename,
- $subject, $from, $verbose, $ed, $outfile,
+ $subject, $from, $verbose, $ed, $outfile, $Is_MacOS,
$fh, $me, $Is_MSWin32, $Is_VMS, $msg, $body, $andcc, %REP, $ok);
my $config_tag2 = "$] - $Config{cf_time}";
$Is_MSWin32 = $^O eq 'MSWin32';
$Is_VMS = $^O eq 'VMS';
+ $Is_MacOS = $^O eq 'MacOS';
+
+ @ARGV = split m/\s+/,
+ MacPerl::Ask('Provide command-line args here (-h for help):')
+ if $Is_MacOS && $MacPerl::Version =~ /App/;
if (!getopts("dhva:s:b:f:F:r:e:SCc:to:n:")) { Help(); exit; };
$ed = $::opt_e || $ENV{VISUAL} || $ENV{EDITOR} || $ENV{EDIT}
|| ($Is_VMS && "edit/tpu")
|| ($Is_MSWin32 && "notepad")
+ || ($Is_MacOS && '')
|| "vi";
# Not OK - provide build failure template by finessing OK report
# My username
$me = $Is_MSWin32 ? $ENV{'USERNAME'}
: $^O eq 'os2' ? $ENV{'USER'} || $ENV{'LOGNAME'}
+ : $Is_MacOS ? $ENV{'USER'}
: eval { getpwuid($<) }; # May be missing
$from = $::Config{'cf_email'}
my $guess;
$guess = $ENV{'REPLY-TO'} || $ENV{'REPLYTO'} || '';
+ if ($Is_MacOS) {
+ require Mac::InternetConfig;
+ $guess = $Mac::InternetConfig::InternetConfig{
+ Mac::InternetConfig::kICEmail()
+ };
+ }
+
unless ($guess) {
my $domain;
if ($::HaveUtil) {
}
tryagain:
- my $sts = system("$ed $filename");
+ my $sts = system("$ed $filename") unless $Is_MacOS;
+ if ($Is_MacOS) {
+ require ExtUtils::MakeMaker;
+ ExtUtils::MM_MacOS::launch_file($filename);
+ paraprint <<EOF;
+Press Enter when done.
+EOF
+ scalar <>;
+ }
if ($sts) {
paraprint <<EOF;
The editor you chose (`$ed') could apparently not be run!
-v Include Verbose configuration data in the report
-f File containing the body of the report. Use this to
quickly send a prepared message.
- -F File to output the resulting mail message to, instead of mailing.
+ -F File to output the resulting mail message to, instead of mailing.
-S Send without asking for confirmation.
-a Address to send the report to. Defaults to `$address'.
-c Address to send copy of report to. Defaults to `$cc'.
this if you don't give it here.
-e Editor to use.
-t Test mode. The target address defaults to `$testaddress'.
- -d Data mode (the default if you redirect or pipe output.)
+ -d Data mode (the default if you redirect or pipe output.)
This prints out your configuration data, without mailing
anything. You can use this with -v to get more complete data.
-ok Report successful build on this system to perl porters
sub filename {
my $dir = $Is_VMS ? 'sys$scratch:'
: ($Is_MSWin32 && $ENV{'TEMP'}) ? $ENV{'TEMP'}
- : '/tmp/';
+ : $Is_MacOS ? $ENV{'TMPDIR'}
+ : '/tmp';
$filename = "bugrep0$$";
- $dir .= "\\" if $Is_MSWin32 and $dir !~ m|[\\/]$|;
- $filename++ while -e "$dir$filename";
- $filename = "$dir$filename";
+# $dir .= "\\" if $Is_MSWin32 and $dir !~ m|[\\/]$|;
+ $filename++ while -e catfile($dir, $filename);
+ $filename = catfile($dir, $filename);
}
sub paraprint {
If message isn't in perldiag, it probably isn't generated by Perl.
Consult your operating system documentation instead.
-If you are on a non-UNIX platform check also L<perlport>, some
-features may not be implemented or work differently.
+If you are on a non-UNIX platform check also L<perlport>, as some
+features may be unimplemented or work differently.
Try to study the problem under the perl debugger, if necessary.
See L<perldebug>.
(E<lt>tchrist@perl.comE<gt>), Nathan Torkington (E<lt>gnat@frii.comE<gt>),
Charles F. Randall (E<lt>cfr@pobox.comE<gt>), Mike Guy
(E<lt>mjtg@cam.a.ukE<gt>), Dominic Dunlop (E<lt>domo@computer.orgE<gt>),
-Hugo van der Sanden (E<lt>hv@crypt0.demon.co.ukE<gt>), and
-Jarkko Hietaniemi (E<lt>jhi@iki.fiE<gt>).
+Hugo van der Sanden (E<lt>hv@crypt0.demon.co.ukE<gt>),
+Jarkko Hietaniemi (E<lt>jhi@iki.fiE<gt>), and Chris Nandor
+(E<lt>pudge@pobox.comE<gt>).
=head1 SEE ALSO