summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-02-02 18:52:27 -0800
committerLarry Wall <lwall@sems.com>1996-02-02 18:52:27 -0800
commitc07a80fdfe3926b5eb0585b674aa5d1f57b32ade (patch)
tree6d56135571eb9ea6635748469bdaf72ad481247a /utils
parent91b7def858c29dac014df40946a128c06b3aa2ed (diff)
downloadperl-c07a80fdfe3926b5eb0585b674aa5d1f57b32ade.tar.gz
perl5.002beta3
[editor's note: no patch file was found for this release, so no fine-grained changes] I can't find the password for our ftp server, so I had to drop it into ftp://ftp.sems.com/pub/incoming/perl5.002b3.tar.gz, which is a drop directory you can't ls. The current plan is that Andy is gonna whack on this a little more, and then release a gamma in a few days when he's happy with it. So don't get carried away. This is now *late* beta. In other words, have less than the appropriate amount of fun. :-) Larry
Diffstat (limited to 'utils')
-rw-r--r--utils/c2ph.PL2
-rw-r--r--utils/h2ph.PL2
-rw-r--r--utils/h2xs.PL21
-rw-r--r--utils/perlbug.PL175
-rw-r--r--[-rwxr-xr-x]utils/pl2pm.PL0
5 files changed, 155 insertions, 45 deletions
diff --git a/utils/c2ph.PL b/utils/c2ph.PL
index dfe9f24db8..ece26acbc1 100644
--- a/utils/c2ph.PL
+++ b/utils/c2ph.PL
@@ -1392,5 +1392,5 @@ close OUT or die "Can't close $file: $!";
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
unlink 'pstruct';
print "Linking c2ph to pstruct.\n";
-link c2ph, pstruct;
+link c2ph, pstruct unless $Config{'osname'} eq 'VMS';
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 4e0dbd1910..720191ec1d 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -237,7 +237,7 @@ sub expr {
}
}
else {
- if ($inif && $new !~ /defined\($/) {
+ if ($inif && $new !~ /defined\s*\($/) {
$new .= '(defined(&' . $id . ') ? &' . $id . ' : 0)';
}
elsif (/^\[/) {
diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index 535ec4108f..26f10c7687 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -149,7 +149,7 @@ The usual warnings if it can't read or write the files involved.
=cut
-my( $H2XS_VERSION ) = '$Revision: 1.12 $' =~ /\$Revision:\s+([^\s]+)/;
+my( $H2XS_VERSION ) = '$Revision: 1.14 $' =~ /\$Revision:\s+([^\s]+)/;
my $TEMPLATE_VERSION = '0.01';
use Getopt::Std;
@@ -238,8 +238,13 @@ else {
die "Won't overwrite existing $ext$modpname\n" if -e $modpname;
-# quick hack, should really loop over @modparts
-mkdir($modparts[0], 0777) if $nested;
+if( $nested ){
+ $modpath = "";
+ foreach (@modparts){
+ mkdir("$modpath$_", 0777);
+ $modpath .= "$_/";
+ }
+}
mkdir($modpname, 0777);
chdir($modpname) || die "Can't chdir $ext$modpname: $!\n";
@@ -481,7 +486,7 @@ use ExtUtils::MakeMaker;
END
print PL "WriteMakefile(\n";
print PL " 'NAME' => '$module',\n";
-print PL " 'VERSION' => '$TEMPLATE_VERSION',\n";
+print PL " 'VERSION_FROM' => '$modfname.pm', # finds \$VERSION\n";
print PL " 'LIBS' => ['$extralibs'], # e.g., '-lm' \n";
print PL " 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' \n";
print PL " 'INC' => '', # e.g., '-I/usr/include/other' \n";
@@ -518,6 +523,14 @@ print "ok 1\n";
_END_
close(EX) || die "Can't close $ext$modpname/test.pl: $!\n";
+warn "Writing $ext$modpname/Changes\n";
+open(EX, ">Changes") || die "Can't create $ext$modpname/Changes: $!\n";
+print EX "Revision history for Perl extension $module.\n\n";
+print EX "$TEMPLATE_VERSION ",scalar localtime,"\n";
+print EX "\t- original version; created by h2xs $H2XS_VERSION\n\n";
+close(EX) || die "Can't close $ext$modpname/Changes: $!\n";
+
+warn "Writing $ext$modpname/MANIFEST\n";
system '/bin/ls > MANIFEST' or system 'ls > MANIFEST';
!NO!SUBS!
diff --git a/utils/perlbug.PL b/utils/perlbug.PL
index e877707184..375bb78576 100644
--- a/utils/perlbug.PL
+++ b/utils/perlbug.PL
@@ -36,15 +36,35 @@ $Config{'startperl'}
print OUT <<'!NO!SUBS!';
use Config;
-use Mail::Send;
-use Mail::Util;
use Getopt::Std;
+BEGIN {
+ eval "use Mail::Send;";
+ $::HaveSend = ($@ eq "");
+ eval "use Mail::Util;";
+ $::HaveUtil = ($@ eq "");
+};
+
+
use strict;
sub paraprint;
-my($Version) = "1.06";
+
+my($Version) = "1.11";
+
+# 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.08 to use correct address for sendmail
+# Changed in 1.09 to close the REP file before calling it up in the editor.
+# Also removed some old comments duplicated elsewhere.
+# Changed in 1.10 to run under VMS without Mail::Send; also fixed
+# temp filename generation
+# Changed in 1.11 to clean up some text and removed Mail::Send deactivator.
+
+# TODO: Allow the user to re-name the file on mail failure, and
+# make sure failure (transmission-wise) of Mail::Send is
+# accounted for.
my( $file, $cc, $address, $perlbug, $testaddress, $filename,
$subject, $from, $verbose, $ed,
@@ -54,6 +74,8 @@ Init();
if($::opt_h) { Help(); exit; }
+if($::opt_d or !-t STDOUT) { Dump(*STDOUT); exit; }
+
Query();
Edit();
NowWhat();
@@ -67,7 +89,7 @@ sub Init {
$Is_VMS = $::Config{'osname'} eq 'VMS';
- getopts("hva:s:b:f:r:e:SCc:t");
+ getopts("dhva:s:b:f:r:e:SCc:t");
# This comment is needed to notify metaconfig that we are
@@ -124,7 +146,7 @@ sub Query {
# Explain what perlbug is
paraprint <<EOF;
-This program allows you to enter a bug report,
+This program allows you to create a bug report,
which will be sent as an e-mail message to $address
once you have filled in the report.
@@ -135,8 +157,8 @@ EOF
if(! $subject) {
paraprint <<EOF;
First of all, please provide a subject for the
-message. It should be concise description of the bug,
-if at all possible.
+message. It should be as a concise description of
+the bug as is possible.
EOF
print "Subject: ";
@@ -160,17 +182,27 @@ EOF
if( !$from) {
# Try and guess return address
- my($domain) = Mail::Util::maildomain();
+ my($domain);
+
+ if($::HaveUtil) {
+ $domain = Mail::Util::maildomain();
+ } elsif ($Is_VMS) {
+ require Sys::Hostname;
+ $domain = Sys::Hostname::hostname();
+ } else {
+ $domain = `hostname`.".".`domainname`;
+ $domain =~ s/[\r\n]+//g;
+ }
my($guess);
if( !$domain) {
$guess = "";
} elsif ($Is_VMS && !$::Config{'d_has_sockets'}) {
- $guess = "$domain$me";
+ $guess = "$domain\:\:$me";
} else {
- $guess = "$me\@$domain" if $domain;
- $guess = "$me\@unknown.addresss" unless $domain;
+ $guess = "$me\@$domain" if $domain;
+ $guess = "$me\@unknown.addresss" unless $domain;
}
if( $guess ) {
@@ -178,7 +210,7 @@ EOF
Your e-mail address will be useful if you need to be contacted.
-If the default is not your proper address, please correct it here.
+If the default shown is not your proper address, please correct it.
EOF
} else {
@@ -205,7 +237,7 @@ EOF
if( $from eq $cc or $me eq $cc ) {
# Try not to copy ourselves
- $cc = "none";
+ $cc = "yourself";
}
@@ -216,7 +248,8 @@ EOF
A copy of this report can be sent to your local
perl administrator. If the address is wrong, please
-correct it, or enter 'none' to not send a copy.
+correct it, or enter 'none' or 'yourself' to not send
+a copy.
EOF
@@ -232,7 +265,7 @@ EOF
}
- if($cc eq "none") { $cc = "" }
+ if($cc =~ /^(none|yourself|myself|ourselves)$/i) { $cc = "" }
$andcc = " and $cc" if $cc;
@@ -242,7 +275,7 @@ EOF
paraprint <<EOF;
-Now you need to enter the bug report. Try to make
+Now you need to supply the bug report. Try to make
the report concise but descriptive. Include any
relevant detail. Some information about your local
perl configuration will automatically be included
@@ -253,7 +286,7 @@ the report. If "$ed" is the editor you want
to use, then just press Enter, otherwise type in
the name of the editor you would like to use.
-If you would like to use a prepared file, just enter
+If you would like to use a prepared file, type
"file", and you will be asked for the filename.
EOF
@@ -271,8 +304,12 @@ EOF
# Generate scratch file to edit report in
- $filename = ($Is_VMS ? 'sys$scratch:' : '/tmp/') . "bugrep0$$";
- $filename++ while -e $filename;
+ {
+ my($dir) = $Is_VMS ? 'sys$scratch:' : '/tmp/';
+ $filename = "bugrep0$$";
+ $filename++ while -e "$dir$filename";
+ $filename = "$dir$filename";
+ }
# Prompt for file to read report from, if needed
@@ -291,7 +328,7 @@ EOF
chop($entry);
if(!-f $entry or !-r $entry) {
- print "\n\nUnable to read `$entry'.\nExiting.\n";
+ print "\n\nUnable to read from `$entry'.\nExiting.\n";
exit;
}
$file = $entry;
@@ -320,8 +357,16 @@ EOF
} else {
print REP "[Please enter your report here]\n";
}
+
+ Dump(*REP);
+ close(REP);
- print REP <<EOF;
+}
+
+sub Dump {
+ local(*OUT) = @_;
+
+ print OUT <<EOF;
@@ -330,30 +375,29 @@ Site configuration information for perl $]:
EOF
if( $::Config{cf_by} and $::Config{cf_time}) {
- print REP "Configured by $::Config{cf_by} at $::Config{cf_time}.\n\n";
+ print OUT "Configured by $::Config{cf_by} at $::Config{cf_time}.\n\n";
}
- print REP Config::myconfig;
+ print OUT Config::myconfig;
if($verbose) {
- print REP "\nComplete configuration data for perl $]:\n\n";
+ print OUT "\nComplete configuration data for perl $]:\n\n";
my($value);
foreach (sort keys %::Config) {
$value = $::Config{$_};
$value =~ s/'/\\'/g;
- print REP "$_='$value'\n";
+ print OUT "$_='$value'\n";
}
}
-
- close(REP);
}
sub Edit {
# Edit the report
if(!$file and !$body) {
- if( system("$ed $filename") ) {
- print "\nUnabled to run editor!\n";
+ my($sts) = system("$ed $filename");
+ if( $Is_VMS ? !($sts & 1) : $sts ) {
+ print "\nUnable to run editor!\n";
}
}
}
@@ -422,19 +466,69 @@ EOF
sub Send {
# Message has been accepted for transmission -- Send the message
+
+ if($::HaveSend) {
- $msg = new Mail::Send Subject => $subject, To => $address;
+ $msg = new Mail::Send Subject => $subject, To => $address;
- $msg->cc($cc) if $cc;
- $msg->add("Reply-To",$from) if $from;
+ $msg->cc($cc) if $cc;
+ $msg->add("Reply-To",$from) if $from;
- $fh = $msg->open;
+ $fh = $msg->open;
+
+ open(REP,"<$filename");
+ while(<REP>) { print $fh $_ }
+ close(REP);
- open(REP,"<$filename");
- while(<REP>) { print $fh $_ }
- close(REP);
+ $fh->close;
+
+ } else {
+ if ($Is_VMS) {
+ if ( ($address =~ /@/ and $address !~ /^\w+%"/) or
+ ($cc =~ /@/ and $cc !~ /^\w+%"/) ){
+ my($prefix);
+ foreach (qw[ IN MX SMTP UCX PONY WINS ],'') {
+ $prefix = "$_%",last if $ENV{"MAIL\$PROTOCOL_$_"};
+ }
+ $address = qq[${prefix}"$address"] unless $address =~ /^\w+%"/;
+ $cc = qq[${prefix}"$cc"] unless !$cc || $cc =~ /^\w+%"/;
+ }
+ $subject =~ s/"/""/g; $address =~ s/"/""/g; $cc =~ s/"/""/g;
+ my($sts) = system(qq[mail/Subject="$subject" $filename. "$address","$cc"]);
+ if (!($sts & 1)) { die "Can't spawn off mail\n\t(leaving bug report in $filename): $sts\n;" }
+ } else {
+ my($sendmail) = "";
+
+ foreach (qw(/usr/lib/sendmail /usr/sbin/sendmail /usr/ucblib/sendmail))
+ {
+ $sendmail = $_, last if -e $_;
+ }
+
+ paraprint <<"EOF" and die "\n" if $sendmail eq "";
+
+I am terribly sorry, but I cannot find sendmail, or a close equivalent, and
+the perl package Mail::Send has not been installed, so I can't send your bug
+report. We apologize for the inconveniencence.
+
+So you may attempt to find some way of sending your message, it has
+been left in the file `$filename'.
+
+EOF
+
+ open(SENDMAIL,"|$sendmail -t");
+ print SENDMAIL "To: $address\n";
+ print SENDMAIL "Subject: $subject\n";
+ print SENDMAIL "Cc: $cc\n" if $cc;
+ print SENDMAIL "Reply-To: $from\n" if $from;
+ print SENDMAIL "\n\n";
+ open(REP,"<$filename");
+ while(<REP>) { print SENDMAIL $_ }
+ close(REP);
+
+ close(SENDMAIL);
+ }
- $fh->close;
+ }
print "\nMessage sent.\n";
@@ -453,7 +547,7 @@ Usage:
$0 [-v] [-a address] [-s subject] [-b body | -f file ]
[-r returnaddress] [-e editor] [-c adminaddress | -C] [-S] [-t]
-Simplest usage: execute "$0", and follow the prompts.
+Simplest usage: run "$0", and follow the prompts.
Options:
@@ -472,13 +566,16 @@ Options:
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.)
+ This prints out your configuration data, without mailing
+ anything. You can use this with -v to get more complete data.
EOF
}
sub paraprint {
my @paragraphs = split /\n{2,}/, "@_";
- print "\n";
+ print "\n\n";
for (@paragraphs) { # implicit local $_
s/(\S)\s*\n/$1 /g;
write;
diff --git a/utils/pl2pm.PL b/utils/pl2pm.PL
index 4e69036499..4e69036499 100755..100644
--- a/utils/pl2pm.PL
+++ b/utils/pl2pm.PL