summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-07-06 18:47:30 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-07-08 02:07:48 +0000
commitfb87c415cfc5d52e36013c492176de3a1df7a905 (patch)
treef9fa67c1c4ae32e4b5bf364e5ef0385b85681df0 /configpm
parentb5be31e977337013082e02b64d1c4513c158d1e6 (diff)
downloadperl-fb87c415cfc5d52e36013c492176de3a1df7a905.tar.gz
applied patch, various tweaks to pander to pod2man tantrums
Message-Id: <199807070247.WAA10677@monk.mps.ohio-state.edu> Subject: [PATCH 5.004_70] CONFIGPM p4raw-id: //depot/perl@1362
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm69
1 files changed, 44 insertions, 25 deletions
diff --git a/configpm b/configpm
index 2b8d982c18..971af7fbdd 100755
--- a/configpm
+++ b/configpm
@@ -288,37 +288,56 @@ some of the variables described below, or may have extraneous variables
specific to that particular port. See the port specific documentation
in such cases.
-=over 4
-
ENDOFTAIL
open(GLOS, "<$glossary") or die "Can't open $glossary: $!";
+%seen = ();
+$text = 0;
+$/ = '';
+
+sub process {
+ s/\A(\w*)\s+\(([\w.]+)\):\s*\n(\t?)/=item C<$1>\n\nFrom F<$2>:\n\n/m;
+ my $c = substr $1, 0, 1;
+ unless ($seen{$c}++) {
+ print CONFIG <<EOF if $text;
+=back
-my ($var,$unit,$indentpara);
-my $text = "";
-while (<GLOS>) {
- if (/^\s*(.*)\s*\(\s*(.+\.U)\s*\):\s*$/) {
- print CONFIG "\n=item $var\n\n$text\n" if $var and $text;
- ($var,$unit,$text) = ($1,$2,"");
- }
- else {
- # bite off exactly one tab-width
- s/^([ ]{8}|[ ]{0,7}\t)//;
-
- # indented stuff starts a separate paragraph
- if (/^\s/) {
- $text .= "\n" unless $indentpara;
- $indentpara = 1;
- }
- else {
- $text .= "\n" if $indentpara;
- $indentpara = 0;
- }
- $text .= $_;
- }
+EOF
+ print CONFIG <<EOF;
+=head2 $c
+
+=over
+
+EOF
+ $text = 1;
+ }
+ s/n't/n\00t/g; # leave can't, won't etc untouched
+ s/^\t\s+(.*)/\n\t$1\n/gm; # Indented lines ===> paragraphs
+ s/^(?<!\n\n)\t(.*)/$1/gm; # Not indented lines ===> text
+ s{([\'\"])(?=[^\'\"\s]*[./][^\'\"\s]*\1)([^\'\"\s]+)\1}(F<$2>)g; # '.o'
+ s{([\'\"])([^\'\"\s]+)\1}(C<$2>)g; # "date" command
+ s{\'([A-Za-z_\- *=/]+)\'}(C<$1>)g; # 'ln -s'
+ s{
+ (?<! [\w./<\'\"] ) # Only standalone file names
+ (?! e \. g \. ) # Not e.g.
+ (?! \. \. \. ) # Not ...
+ (?! \d ) # Not 5.004
+ ( [\w./]* [./] [\w./]* ) # Require . or / inside
+ (?<! \. (?= \s ) ) # Do not include trailing dot
+ (?! [\w/] ) # Include all of it
+ }
+ (F<$1>)xg; # /usr/local
+ s/((?<=\s)~\w*)/F<$1>/g; # ~name
+ s/(?<![.<\'\"])\b([A-Z_]{2,})\b(?![\'\"])/C<$1>/g; # UNISTD
+ s/(?<![.<\'\"])\b(?!the\b)(\w+)\s+macro\b/C<$1> macro/g; # FILE_cnt macro
+ s/n[\0]t/n't/g; # undo can't, won't damage
}
-print CONFIG "\n=item $var\n\n$text\n" if $var and $text;
+<GLOS>; # Skip the preamble
+while (<GLOS>) {
+ process;
+ print CONFIG;
+}
print CONFIG <<'ENDOFTAIL';