From: Perl 5 Porters Date: Wed, 20 Mar 1996 10:29:38 +0000 (+0000) Subject: perl 5.002_01: utils/h2xs.PL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5ae7f1db2320c737db79389c37b2b4a58be7659b;p=p5sagit%2Fp5-mst-13.2.git perl 5.002_01: utils/h2xs.PL Use $^O, add autoflush to sample test.pl, and try not to assume we've got /bin/ls around when creating MANIFEST --- diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 4e64d86..f9868dc 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -15,8 +15,7 @@ use File::Basename qw(&basename &dirname); chdir(dirname($0)); ($file = basename($0)) =~ s/\.PL$//; $file =~ s/\.pl$// - if ($Config{'osname'} eq 'VMS' or - $Config{'osname'} eq 'OS2'); # "case-forgiving" + if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving" open OUT,">$file" or die "Can't create $file: $!"; @@ -576,7 +575,7 @@ print EX <<'_END_'; # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) -BEGIN {print "1..1\n";} +BEGIN { $| = 1; print "1..1\n"; } END {print "not ok 1\n" unless $loaded;} _END_ print EX <<_END_; @@ -603,7 +602,15 @@ 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'; +open(MANI,'>MANIFEST') or die "Can't create MANIFEST: $!"; +@files = <*>; +if (!@files) { + eval {opendir(D,'.');}; + unless ($@) { @files = readdir(D); closedir(D); } +} +if (!@files) { @files = map {chomp && $_} `ls`; } +print MANI join("\n",@files); +close MANI; !NO!SUBS! close OUT or die "Can't close $file: $!";