From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 6653f29b for ; Mon, 11 Nov 2019 09:56:58 -0500 (EST) Date: Mon, 11 Nov 2019 09:56:58 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: cvsweb: Delete GNU Enscript support. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <8d07736290ddb711@mandoc.bsd.lv> Log Message: ----------- Delete GNU Enscript support. I don't need and i don't want syntax highlighting, so i'm certainly not going to maintain it. Modified Files: -------------- cvsweb: INSTALL README cvsweb.cgi Revision Data ------------- Index: cvsweb.cgi =================================================================== RCS file: /home/cvs/mandoc/cvsweb/cvsweb.cgi,v retrieving revision 4.18 retrieving revision 4.19 diff -Lcvsweb.cgi -Lcvsweb.cgi -u -p -r4.18 -r4.19 --- cvsweb.cgi +++ cvsweb.cgi @@ -83,7 +83,6 @@ use vars qw ( $allow_tar @tar_options @gzip_options @zip_options @cvs_options @annotate_options @rcsdiff_options $HTML_DOCTYPE $HTML_META $cssurl $CSS $cvshistory_url - $allow_enscript @enscript_options %enscript_types ); require Compress::Zlib; @@ -150,14 +149,12 @@ sub config_error($$); sub redirect($;$); sub safeglob($); sub search_path($); -sub getEnscriptHL($); sub getMimeType($;$); sub head($;$); sub scan_directives(@); sub openOutputFilter(); sub doAnnotate($$); sub doCheckout($$$); -sub doEnscript($$$;$); sub cvswebMarkup($$$$$$;$); sub viewable($); sub doDiff($$$$$$); @@ -534,27 +531,6 @@ foreach (@stickyvars) { } } -if ($allow_enscript) { - push(@DIFFTYPES, qw(uc cc)); - @DIFFTYPES{qw(uc cc)} = ( - { - 'descr' => 'unified, colored', - 'opts' => ['-u'], - 'colored' => 0, - }, - { - 'descr' => 'context, colored', - 'opts' => ['-c'], - 'colored' => 0, - }, - ); -} else { - # No Enscript -> respect difftype, but don't offer colorization. - if ($input{f} && $input{f} =~ /^([ucs])c$/) { - $input{f} = $1; - } -} - # is there any query ? if (@barequery) { $barequery = join (';', @barequery); @@ -1688,21 +1664,6 @@ sub search_path($) # -# Gets the enscript(1) highlight mode corresponding to the given filename, -# or undef if unsupported. -# -sub getEnscriptHL($) -{ - return undef unless $allow_enscript; - my ($filename) = @_; - while (my ($hl, $regex) = each %enscript_types) { - return $hl if ($filename =~ $regex); - } - return undef; -} - - -# # Gets the MIME type for the given file name. # sub getMimeType($;$) @@ -2130,14 +2091,8 @@ EOF printf '
', $url . $barequery; } else { - print "
\n";
     my $linenumbers = $input{ln} || 0;
-
-    if (my $enscript_hl = getEnscriptHL($filename)) {
-      doEnscript($filehandle, $enscript_hl, $linenumbers);
-
-    } else {
       my $ln  = 0;
       my @buf = ();
       my $ts  = undef;
@@ -2157,8 +2112,6 @@ EOF
         }
         print $preformat_in_markup ? spacedHtmlText($_, $ts) : htmlquote($_);
       }
-    }
-
     print "
\n"; } html_footer(); @@ -2301,36 +2254,6 @@ sub doDiff($$$$$$) html_footer(); gzipclose(); exit; - - } elsif ($f =~ /^([ucs])c$/) { - # - # Enscript colored diff. - # - my $hl = 'diff'; - $hl .= $1 if ($1 eq 'u' || $1 eq 's'); - (my $where_nd = $where) =~ s/\.diff$//; - (my $pathname = $where_nd) =~ s|((?<=/)Attic/)?[^/]*$||; - (my $filename = $where_nd) =~ s|^.*/||; - (my $swhere = $scriptwhere) =~ s|\.diff$||; - navigateHeader($swhere, $pathname, $filename, $rev2, 'diff'); - printf(<Diff for /%s between versions %s and %s -
-EOF
-    doEnscript(\$fh, $hl, 0, 'cvsweb_diff');
-    print <
-
-
-EOF - printDiffSelectStickyVars(); - print 'Diff format: '; - printDiffSelect(); - print "\n
\n"; - html_footer(); - gzipclose(); - exit; - } else { # # Plain diff. @@ -3450,36 +3373,6 @@ EOF
EOF -} - - -sub doEnscript($$$;$) -{ - my ($filehandle, $highlight, $linenumbers, $lang) = @_; - $lang ||= 'cvsweb'; - - my @cmd = ($CMD{enscript}, - @enscript_options, - '-q', "--language=$lang", '-o', '-', "--highlight=$highlight"); - - local *ENSCRIPT_OUT; - my ($h, $err) = - startproc(\@cmd, $filehandle, '>pipe', \*ENSCRIPT_OUT); - fatal('500 Internal Error', $err) unless $h; - - # We could short-circuit and have enscript output directly to STDOUT above, - # but that doesn't work with mod_perl (at least some 1.99 versions). - if ($linenumbers) { - my $ln = 0; - while () { - printf '%5d: ', (++$ln) x 2; - print $_; - } - } else { - local $/ = undef; - print ; - } - $h->finish(); } Index: INSTALL =================================================================== RCS file: /home/cvs/mandoc/cvsweb/INSTALL,v retrieving revision 4.5 retrieving revision 4.6 diff -LINSTALL -LINSTALL -u -p -r4.5 -r4.6 --- INSTALL +++ INSTALL @@ -39,9 +39,6 @@ of this document. repository (or a copy of it) therefore; rsh, ssh or pserver access doesn't work yet. - Install GNU Enscript if you want syntax highlighting, and see (7) for - more info. You'll need version 1.6.3 or newer. - Install CVSHistory if you want to use it with CVSweb, and see (8) for configuration notes. You'll need version 2.0 or newer. @@ -75,13 +72,6 @@ of this document. 5) Copy cvsweb.css from the css/ directory to a web server directory, and point the $cssurl variable in cvsweb.conf to it. -7) GNU Enscript can be used for syntax - highlighting. To enable it, copy lang_cvsweb.st and lang_cvsweb_diff.st - from the enscript/ dir to your Enscript "hl" directory (often eg. - /usr/share/enscript/hl/) and enable $allow_enscript in cvsweb.conf. - lang_cvsweb.st is used for generic colorization, and lang_cvsweb_diff.st - for diffs. - 8) CVSHistory can be used with this version of CVSweb. See the $cvshistory_url configuration variable in cvsweb.conf. For best results, configure CVSweb and CVSHistory to use @@ -183,10 +173,6 @@ The following configuration variables in $cvstreedefault is now optional. If unset, the first one in @CVSrepositories is used. - %DEFAULTVALUE for "f" (default diff format) now understands the values - "uc", "cc" and "sc" for enscript-colored diffs (unified, context and - side-by-side respectively). - %DEFAULTVALUE for "ln" can now be set to a boolean indicating whether line numbers in markup views should be shown or not. The default is off. @@ -200,9 +186,6 @@ The following configuration variables in The following parameters have been removed, with no replacement: $open_extern_window, $extern_window_height, $extern_window_width, $checkout_magic. - - $allow_enscript, @enscript_options and %enscript_types control the use - and behavior of enscript(1). $file_list_len can be set to work around problems with rlog(1) and dirs with lots of files. Index: README =================================================================== RCS file: /home/cvs/mandoc/cvsweb/README,v retrieving revision 4.5 retrieving revision 4.6 diff -LREADME -LREADME -u -p -r4.5 -r4.6 --- README +++ README @@ -87,8 +87,6 @@ o Security fixes to let it work under pe o Annotate works under mod_perl and against a read only repository. -o Syntax highlighting using GNU Enscript . - o CVSHistory integration. o Line number output for HTMLized views. -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv