source@mandoc.bsd.lv
 help / color / Atom feed
* cvsweb: Simplify the configuration UI by deleting the pointless 
@ 2019-11-26 12:05 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-11-26 12:05 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 12:05 cvsweb: Simplify the configuration UI by deleting the pointless schwarze

source@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-source

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git