source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: cvsweb: Simplify the configuration UI by deleting the pointless
Date: Tue, 26 Nov 2019 07:05:25 -0500 (EST)	[thread overview]
Message-ID: <8d07958e6db3cfa9@mandoc.bsd.lv> (raw)

Log Message:
-----------
Simplify the configuration UI by deleting the pointless $cvstreedefault
variable.  Just put the default first and be done with it.

Modified Files:
--------------
    cvsweb:
        INSTALL
        cvsweb.cgi
        cvsweb.conf

Revision Data
-------------
Index: cvsweb.cgi
===================================================================
RCS file: /home/cvs/mandoc/cvsweb/cvsweb.cgi,v
retrieving revision 4.25
retrieving revision 4.26
diff -Lcvsweb.cgi -Lcvsweb.cgi -u -p -r4.25 -r4.26
--- cvsweb.cgi
+++ cvsweb.cgi
@@ -69,7 +69,7 @@ use vars qw (
   $bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot
   $charset $output_filter
   @command_path %CMD $allow_compress $backicon $diricon $fileicon
-  $fullname $cvstreedefault $logo $defaulttitle $address $binfileicon
+  $fullname $logo $defaulttitle $address $binfileicon
   $long_intro $short_instruction $shortLogLen $show_author
   $tablepadding $hr_breakable $showfunc $hr_ignwhite $hr_ignkeysubst
   $inputTextSize $mime_types $allow_annotate $allow_markup $allow_mailtos
@@ -198,7 +198,7 @@ $config = '/conf/cvsweb/cvsweb.conf';
 @CVSrepositories = @CVSROOT = %CVSROOT = %MIRRORS = %DEFAULTVALUE = %ICONS =
   %MTYPES = %tags = %alltags = %fileinfo = %DIFF_COMMANDS = ();
 
-$cvstreedefault = $logo = $defaulttitle =
+$logo = $defaulttitle =
   $address = $long_intro = $short_instruction = $shortLogLen = $show_author =
   $tablepadding = $hr_breakable = $showfunc = $hr_ignwhite =
   $hr_ignkeysubst = $inputTextSize = $mime_types = $allow_annotate =
@@ -472,7 +472,6 @@ for (my $i = 0; $i < scalar(@CVSreposito
     next;
   }
   $rootfound ||= 1;
-  $cvstreedefault = $key unless defined($cvstreedefault);
   $CVSROOTdescr{$key} = $descr;
   $CVSROOT{$key} = $root;
   push(@CVSROOT, $key);
@@ -485,19 +484,7 @@ unless ($rootfound) {
 }
 undef $rootfound;
 
-#
-# Default CVS root
-#
-if (!defined($CVSROOT{$cvstreedefault})) {
-  fatal("500 Internal Error",
-        '<code>$cvstreedefault</code> points to a repository (%s) not ' .
-        'defined in <code>@CVSrepositories</code> in your configuration ' .
-        'file (<code>%s</code>).',
-        $cvstreedefault,
-        $config);
-}
-
-$DEFAULTVALUE{cvsroot} = $cvstreedefault;
+$DEFAULTVALUE{cvsroot} = $CVSrepositories[0];
 
 while (my ($key, $defval) = each %DEFAULTVALUE) {
 
@@ -576,7 +563,7 @@ $logsort = $input{logsort};
 if ($input{cvsroot} && $CVSROOT{$input{cvsroot}}) {
   $cvstree = $input{cvsroot};
 } else {
-  $cvstree = $cvstreedefault;
+  $cvstree = $CVSrepositories[0];
 }
 
 $cvsroot = $CVSROOT{$cvstree};
@@ -1134,7 +1121,7 @@ EOF
       printf(qq{<input type="hidden" name="%s" value="%s" />\n},
              $v, $input{$v} || 0);
     }
-    if ($cvstree ne $cvstreedefault) {
+    if ($cvstree ne $CVSrepositories[0]) {
       print "<input type=\"hidden\" name=\"cvsroot\" value=\"$cvstree\" />\n";
     }
     print <<EOF;
Index: INSTALL
===================================================================
RCS file: /home/cvs/mandoc/cvsweb/INSTALL,v
retrieving revision 4.7
retrieving revision 4.8
diff -LINSTALL -LINSTALL -u -p -r4.7 -r4.8
--- INSTALL
+++ INSTALL
@@ -155,9 +155,6 @@ The following configuration variables in
    modules in CVS terminology, and the implementation was broken.
    @ForbiddenFiles has been enhanced to affect directories as well.
 
-   $cvstreedefault is now optional.  If unset, the first one in
-   @CVSrepositories is used.
-
    %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.
 
Index: cvsweb.conf
===================================================================
RCS file: /home/cvs/mandoc/cvsweb/cvsweb.conf,v
retrieving revision 4.13
retrieving revision 4.14
diff -Lcvsweb.conf -Lcvsweb.conf -u -p -r4.13 -r4.14
--- cvsweb.conf
+++ cvsweb.conf
@@ -57,16 +57,6 @@ $CMD{tar} ||= search_path('tar');
         'local'   => ['Local Repository', '/cvs'],
 );
 
-# The default CVS root.  Note that @CVSrepositories is list, not a hash,
-# so you'll want to use 2 * 0-based-index-number here; or set this directly
-# to the default's symbolic name. Unless specified, the first valid one in
-# @CVSrepositories is used as the default.
-#
-# For example:
-#
-#$cvstreedefault = $CVSrepositories[2 * 0];
-#$cvstreedefault = 'local';
-
 # Mirror sites.  The keys will be used as link texts, and the values are
 # URLs pointing to the corresponding mirrors.
 #
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2019-11-26 12:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d07958e6db3cfa9@mandoc.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).