This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH] Abstract "utility" information from installman
authorSimon Cozens <simon@netthink.co.uk>
Wed, 16 May 2001 15:57:55 +0000 (16:57 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 16 May 2001 14:18:56 +0000 (14:18 +0000)
Message-ID: <20010516155755.A4728@netthink.co.uk>

p4raw-id: //depot/perl@10129

MANIFEST
installman
installperl
utils.lst [new file with mode: 0644]

index ed59a6d..52e4367 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1858,6 +1858,7 @@ utf8.h                    Unicode header
 utfebcdic.h            Unicode on EBCDIC (UTF-EBCDIC, tr16) header
 util.c                 Utility routines
 util.h                 Dummy header
+utils.lst              Lists utilities bundled with Perl
 utils/Makefile         Extract the utility scripts
 utils/c2ph.PL          program to translate dbx stabs to perl
 utils/dprofpp.PL       Perl code profile post-processor
index 2b6e627..b948c78 100755 (executable)
@@ -67,6 +67,7 @@ $opts{verbose} ||= $opts{V} || $opts{notify};
 
 $packlist = ExtUtils::Packlist->new("$Config{installarchlib}/.packlist");
 
+
 # Install the main pod pages.
 runpod2man('pod', $opts{man1dir}, $opts{man1ext});
 
@@ -74,22 +75,17 @@ runpod2man('pod', $opts{man1dir}, $opts{man1ext});
 runpod2man('lib', $opts{man3dir}, $opts{man3ext});
 
 # Install the pods embedded in the installed scripts
-runpod2man('utils', $opts{man1dir}, $opts{man1ext}, 'c2ph', 'h2ph', 'h2xs',
-          'perlcc', 'perldoc', 'perlbug', 'pl2pm', 'splain', 'dprofpp');
-runpod2man('x2p', $opts{man1dir}, $opts{man1ext}, 's2p', 'a2p.pod',
-          'find2perl');
-runpod2man('pod', $opts{man1dir}, $opts{man1ext}, 'pod2man', 'pod2html',
-          'pod2text', 'pod2usage', 'podchecker', 'podselect');
-
-# It would probably be better to have this page linked
-# to the c2ph man page.  Or, this one could say ".so man1/c2ph.1",
-# but then it would have to pay attention to $opts{man1dir} and $opts{man1ext}.
-runpod2man('utils', $opts{man1dir}, $opts{man1ext}, 'pstruct'); 
-
-# Similar concern as with pstruct/c2ph above: psed is s2p by other name.
-runpod2man('x2p', $opts{man1dir}, $opts{man1ext}, 'psed'); 
-
-runpod2man('lib/ExtUtils', $opts{man1dir}, $opts{man1ext}, 'xsubpp');
+open UTILS, "utils.lst" or die "Can't open 'utils.lst': $!";
+while (<UTILS>) {
+    next if /^#/;
+    chomp;
+    $_ = $1 if /#.*pod\s*=\s*(\S+)/;
+    my ($where, $what) = m|^(.*)/(.*)|;
+    runpod2man($where, $opts{man1dir}, $opts{man1ext}, $what);
+    if (($where, $what) = /#.*link\s*=\s*(\S+)/) {
+        runpod2man($where, $opts{man1dir}, $opts{man1ext}, $what);
+    }
+}
 
 sub runpod2man {
     # @script is scripts names if we are installing manpages embedded 
index 6adcdf2..6bfbdc9 100755 (executable)
@@ -63,12 +63,20 @@ while (@ARGV) {
 }
 
 $versiononly = 1 if $Config{versiononly} && !defined $versiononly;
-
-my @scripts = qw(utils/c2ph utils/h2ph utils/h2xs utils/perlbug utils/perldoc
-               utils/pl2pm utils/splain utils/perlcc utils/dprofpp
-               x2p/s2p x2p/find2perl 
-               pod/pod2man pod/pod2html pod/pod2latex pod/pod2text
-               pod/pod2usage pod/podchecker pod/podselect);
+my (@scripts, @tolink);
+open SCRIPTS, "utils.lst" or die "Can't open utils.lst: $!";
+while (<SCRIPTS>) {
+    next if /^#/;
+    next if /#\s*pod\s*=/; # Binary programs need separate treatment
+    chomp;
+    if (/(\S*)\s*#\s*link\s*=\s*(\S*)/) {
+        push @scripts, $1;
+        push @tolink, [$1, $2];
+    } else {
+        push @scripts, $_;
+    }
+}
+close SCRIPTS;
 
 if ($scr_ext) { @scripts = map { "$_$scr_ext" } @scripts; }
 
@@ -417,11 +425,12 @@ if (! $versiononly) {
        chmod(0755, "$installscript/$base");
     }
 
-    # pstruct should be a link to c2ph
-    script_alias($installscript, 'c2ph', 'pstruct', $scr_ext);
-
-    # psed should be a link to s2p
-    script_alias($installscript, 's2p', 'psed',     $scr_ext);
+    for (@tolink) { 
+        my ($from, $to)= @$_;
+        (my $frbase = $from) =~ s#.*/##;
+        (my $tobase = $to) =~ s#.*/##;
+        script_alias($installscript, $frbase, $tobase, $scr_ext);
+    }
 }
 
 # Install pod pages.  Where? I guess in $installprivlib/pod
diff --git a/utils.lst b/utils.lst
new file mode 100644 (file)
index 0000000..a3cd5a8
--- /dev/null
+++ b/utils.lst
@@ -0,0 +1,19 @@
+utils/c2ph      # link = utils/pstruct
+utils/h2ph
+utils/h2xs
+utils/perlcc
+utils/perldoc
+utils/perlbug
+utils/pl2pm
+utils/splain
+utils/dproffpp
+x2p/s2p         # link = xsp/psed
+x2p/findperl
+x2p/a2p         # pod = x2p/a2p.pod
+pod/pod2man
+pod/pod2html
+pod/pod2text
+pod/pod2usage
+pod/podchecker
+pod/podselect
+lib/ExtUtils/xsubpp