[packages/viewvc] Up to 1.3.0

arekm arekm at pld-linux.org
Sun Nov 22 01:53:29 CET 2026


commit 44b98d539cc7ef6dfd88de22f6cd35d0fa45763f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Nov 22 01:13:09 2026 +0100

    Up to 1.3.0
    
    Fixes CVE-2025-54141, CVE-2023-22464, CVE-2023-22456, CVE-2020-5283.

 apache.conf           |  54 ++++---------
 config.patch          |  72 +++++++++--------
 cvsweb-compat.patch   |  54 +++++++------
 error-status.patch    |  34 ++++++++
 error-traceback.patch |  21 +++++
 fcgi-shebang.patch    |   8 ++
 stream-close.patch    |  21 +++++
 viewvc.spec           | 217 +++++++++++++++++++++++---------------------------
 8 files changed, 271 insertions(+), 210 deletions(-)
---
diff --git a/viewvc.spec b/viewvc.spec
index 3a79b94..8711af1 100644
--- a/viewvc.spec
+++ b/viewvc.spec
@@ -1,31 +1,36 @@
-# TODO
-# - fcgi subpackage
 Summary:	Browser interface for CVS and Subversion version control repositories
 Summary(pl.UTF-8):	Interfejs przeglądarki do repozytoriów systemów kontroli wersji CVS i Subversion
 Name:		viewvc
-Version:	1.1.26
+Version:	1.3.0
 Release:	1
 License:	BSD
 Group:		Applications/WWW
 Source0:	https://github.com/viewvc/viewvc/releases/download/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	e4a84fef6d7fb0414c27faed4ff24c1e
+# Source0-md5:	5ec58287f44f1729809da0811ed30d76
 Source1:	apache.conf
 Patch0:		cvsweb-compat.patch
 Patch1:		config.patch
-URL:		http://viewvc.org/
-BuildRequires:	python
-BuildRequires:	python-modules
+Patch2:		stream-close.patch
+Patch3:		error-status.patch
+Patch4:		error-traceback.patch
+Patch5:		fcgi-shebang.patch
+URL:		https://www.viewvc.org/
+BuildRequires:	python3 >= 1:3.10
+BuildRequires:	python3-modules >= 1:3.10
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires:	%{name}-template
+Requires:	diffutils
+Requires:	python3-modules >= 1:3.10
 Requires:	rcs
 Requires:	webapps
 Suggests:	%{name}-cgi
 Suggests:	cvsgraph >= 1.5.0
-Suggests:	python-MySQLdb >= 0.9.0
-Suggests:	python-pygments >= 0.9
-Suggests:	python-subversion
-Obsoletes:	viewcvs
+Suggests:	python3-PyMySQL
+Suggests:	python3-chardet
+Suggests:	python3-pygments >= 1.1
+Suggests:	python3-subversion >= 1.14.0
+Obsoletes:	viewcvs < 1.0
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -62,8 +67,8 @@ Here are some of the additional features of ViewVC:
 - INI-like configuration file (as opposed to requiring actual code
   tweaks).
 
-In order to run viewvc you must install viewvc-cgi or
-viewvc-mod_python package.
+In order to run viewvc you must install viewvc-cgi, viewvc-wsgi or
+viewvc-fcgi package.
 
 %description -l pl.UTF-8
 ViewVC to interfejs przeglądarki do repozytoriów systemów kontroli
@@ -93,8 +98,8 @@ Niektóre dodatkowe możliwości ViewVC:
 - wyszukiwanie plików w oparciu o wyrażenia regularne
 - plik konfiguracyjny w stylu INI (nie wymagający modyfikacji kodu).
 
-Aby uruchomić viewvc należy zainstalować pakiet viewvc-cgi lub
-viewvc-mod_python.
+Aby uruchomić viewvc należy zainstalować pakiet viewvc-cgi,
+viewvc-wsgi lub viewvc-fcgi.
 
 %package cgi
 Summary:	ViewVC - CGI interface
@@ -109,26 +114,43 @@ ViewVC - CGI interface.
 %description cgi -l pl.UTF-8
 ViewVC - interfejs CGI.
 
-%package mod_python
-Summary:	ViewVC - mod_python interface
-Summary(pl.UTF-8):	ViewVC - interfejs mod_python
+%package wsgi
+Summary:	ViewVC - WSGI interface
+Summary(pl.UTF-8):	ViewVC - interfejs WSGI
 Group:		Applications/WWW
 Requires:	%{name} = %{version}-%{release}
-Requires:	apache-mod_python
+Suggests:	apache-mod_wsgi-py3
+Obsoletes:	viewvc-mod_python < 1.3
 
-%description mod_python
-ViewVC - mod_python interface.
+%description wsgi
+ViewVC - WSGI interface.
 
-%description mod_python -l pl.UTF-8
-ViewVC - interfejs mod_python.
+%description wsgi -l pl.UTF-8
+ViewVC - interfejs WSGI.
+
+%package fcgi
+Summary:	ViewVC - FastCGI interface
+Summary(pl.UTF-8):	ViewVC - interfejs FastCGI
+Group:		Applications/WWW
+Requires:	%{name} = %{version}-%{release}
+Requires:	python3-flup
+Suggests:	apache-mod_fcgid
+
+%description fcgi
+ViewVC - FastCGI interface.
+
+%description fcgi -l pl.UTF-8
+ViewVC - interfejs FastCGI.
 
 %package template-default
 Summary:	ViewVC - default template
 Summary(pl.UTF-8):	ViewVC - domyślny szablon
 Group:		Applications/WWW
 Requires:	%{name} = %{version}-%{release}
-Requires:	webserver(cgi)
+Requires:	webserver(alias)
 Provides:	%{name}-template
+Obsoletes:	viewvc-template-newvc < 1.2
+Obsoletes:	viewvc-template-viewsvn < 1.2
 
 %description template-default
 ViewVC - default template
@@ -136,38 +158,28 @@ ViewVC - default template
 %description template-default -l pl.UTF-8
 ViewVC - domyślny szablon
 
-%package template-newvc
-Summary:	ViewVC - newvc template
-Summary(pl.UTF-8):	ViewVC - szablon newvc
-Group:		Applications/WWW
-Requires:	%{name} = %{version}-%{release}
-Requires:	webserver(cgi)
-Provides:	%{name}-template
-
-%description template-newvc
-ViewVC - newvc template
-
-%description template-newvc -l pl.UTF-8
-ViewVC - szablon newvc
-
-%package template-viewsvn
-Summary:	ViewVC - viewsvn template
-Summary(pl.UTF-8):	ViewVC - szablon viewsvn
+%package template-classic
+Summary:	ViewVC - classic template
+Summary(pl.UTF-8):	ViewVC - szablon classic
 Group:		Applications/WWW
 Requires:	%{name} = %{version}-%{release}
-Requires:	webserver(cgi)
+Requires:	webserver(alias)
 Provides:	%{name}-template
 
-%description template-viewsvn
-ViewVC - viewsvn template
+%description template-classic
+ViewVC - classic template
 
-%description template-viewsvn -l pl.UTF-8
-ViewVC - szablon viewsvn
+%description template-classic -l pl.UTF-8
+ViewVC - szablon classic
 
 %prep
 %setup -q
 %patch -P0 -p1
 %patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
+%patch -P5 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -177,7 +189,7 @@ cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
 #cp -p lighttpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
 
-./viewvc-install \
+%{__python3} ./viewvc-install \
 	--prefix=%{_appdir} \
 	--destdir=$RPM_BUILD_ROOT
 
@@ -186,19 +198,19 @@ mv $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}/viewvc.conf
 ln -s %{_sysconfdir}/cvsgraph.conf $RPM_BUILD_ROOT%{_appdir}/cvsgraph.conf
 ln -s %{_sysconfdir}/viewvc.conf $RPM_BUILD_ROOT%{_appdir}/viewvc.conf
 
-%py_postclean %{_appdir}/lib
+%py3_comp $RPM_BUILD_ROOT%{_appdir}/lib
+%py3_ocomp $RPM_BUILD_ROOT%{_appdir}/lib
 
 # cleanup
-rm $RPM_BUILD_ROOT%{_appdir}/lib/win32popen.pyc
+rm -r $RPM_BUILD_ROOT%{_appdir}/bin/cgi/iis
 rm $RPM_BUILD_ROOT%{_appdir}/cvsgraph.conf.dist
 rm $RPM_BUILD_ROOT%{_appdir}/mimetypes.conf.dist
 rm $RPM_BUILD_ROOT%{_appdir}/viewvc.conf.dist
-rm -r $RPM_BUILD_ROOT%{_appdir}/lib/vclib/ccvs/rcsparse/test-data
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%triggerpostun -- %{name} < 1.1.23-1
+%triggerpostun -- %{name} < 1.3.0-1
 # skip on downgrade
 [ $1 -le 1 ] && exit 0
 
@@ -208,6 +220,23 @@ for f in cvsgraph.conf viewvc.conf; do
 	mv -vf /etc/viewvc/$f.rpmsave %{_sysconfdir}/$f
 done
 
+# a kept viewvc.conf from < 1.3 points at template sets that are gone
+sed -i -e 's,^\(template_dir[ \t]*=[ \t]*\)\(templates\|templates-contrib/newvc/templates\|templates-contrib/viewsvn/templates\)[ \t]*$,\1templates/default,' \
+	-e 's,^\(docroot[ \t]*=[ \t]*/viewvc/template/\)\(newvc\|viewsvn\)[ \t]*$,\1default,' \
+	%{_sysconfdir}/viewvc.conf
+
+# 1.3 decodes content by locale, which is C under httpd
+grep -q '^[ \t]*default_encoding[ \t]*=' %{_sysconfdir}/viewvc.conf || \
+	sed -i -e '/^\[options\][ \t]*$/a default_encoding = utf-8' %{_sysconfdir}/viewvc.conf
+
+# a kept apache.conf from < 1.3 aliases template docroots that are gone
+for f in apache.conf httpd.conf; do
+	test -f %{_sysconfdir}/$f || continue
+	sed -i -e 's,%{_appdir}/templates/docroot,%{_appdir}/templates/default/docroot,' \
+		-e 's,%{_appdir}/templates-contrib/\(newvc\|viewsvn\)/templates/docroot,%{_appdir}/templates/default/docroot,' \
+		%{_sysconfdir}/$f
+done
+
 # ensure safe exit even if above move failed
 exit 0
 
@@ -233,93 +262,47 @@ exit 0
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGES COMMITTERS INSTALL
+%doc CHANGES COMMITTERS INSTALL README.md docs/upgrading-howto.html
 %dir %attr(755,root,http) %{_sysconfdir}
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
-#%%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+#%%attr(640,root,root) %%config(noreplace) %%verify(not md5 mtime size) %%{_sysconfdir}/lighttpd.conf
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cvsgraph.conf
 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/viewvc.conf
 %dir %{_appdir}
 %dir %{_appdir}/bin
 %attr(755,root,root) %{_appdir}/bin/standalone.py
-%attr(755,root,root) %{_appdir}/bin/loginfo-handler
-%attr(755,root,root) %{_appdir}/bin/cvsdbadmin
-%attr(755,root,root) %{_appdir}/bin/svndbadmin
-%attr(755,root,root) %{_appdir}/bin/make-database
+%dir %{_appdir}/bin/db
+%attr(755,root,root) %{_appdir}/bin/db/loginfo-handler
+%attr(755,root,root) %{_appdir}/bin/db/cvsdbadmin
+%attr(755,root,root) %{_appdir}/bin/db/svndbadmin
+%attr(755,root,root) %{_appdir}/bin/db/make-database
+%{_appdir}/bin/db/schema_*.sql
 %{_appdir}/viewvc.conf
 %{_appdir}/cvsgraph.conf
-%dir %{_appdir}/lib
-%{_appdir}/lib/PyFontify.py[co]
-%{_appdir}/lib/accept.py[co]
-%{_appdir}/lib/blame.py[co]
-%{_appdir}/lib/compat.py[co]
-%{_appdir}/lib/compat_difflib.py[co]
-%{_appdir}/lib/compat_ndiff.py[co]
-%{_appdir}/lib/config.py[co]
-%{_appdir}/lib/cvsdb.py[co]
-%{_appdir}/lib/dbi.py[co]
-%{_appdir}/lib/debug.py[co]
-%{_appdir}/lib/ezt.py[co]
-%{_appdir}/lib/idiff.py[co]
-%{_appdir}/lib/popen.py[co]
-%{_appdir}/lib/py2html.py[co]
-%{_appdir}/lib/query.py[co]
-%{_appdir}/lib/sapi.py[co]
-%dir %{_appdir}/lib/vcauth
-%dir %{_appdir}/lib/vcauth/forbidden
-%dir %{_appdir}/lib/vcauth/forbiddenre
-%dir %{_appdir}/lib/vcauth/svnauthz
-%{_appdir}/lib/vcauth/__init__.py[co]
-%{_appdir}/lib/vcauth/forbidden/__init__.py[co]
-%{_appdir}/lib/vcauth/forbiddenre/__init__.py[co]
-%{_appdir}/lib/vcauth/svnauthz/__init__.py[co]
-%dir %{_appdir}/lib/vclib
-%{_appdir}/lib/vclib/__init__.py[co]
-%dir %{_appdir}/lib/vclib/ccvs
-%{_appdir}/lib/vclib/ccvs/__init__.py[co]
-%{_appdir}/lib/vclib/ccvs/blame.py[co]
-%{_appdir}/lib/vclib/ccvs/bincvs.py[co]
-%{_appdir}/lib/vclib/ccvs/ccvs.py[co]
-%{_appdir}/lib/vclib/ccvs/rcsparse/parse_rcs_file.py[co]
-%{_appdir}/lib/vclib/ccvs/rcsparse/run-tests.py[co]
-%dir %{_appdir}/lib/vclib/ccvs/rcsparse
-%{_appdir}/lib/vclib/ccvs/rcsparse/__init__.py[co]
-%{_appdir}/lib/vclib/ccvs/rcsparse/common.py[co]
-%{_appdir}/lib/vclib/ccvs/rcsparse/debug.py[co]
-%{_appdir}/lib/vclib/ccvs/rcsparse/default.py[co]
-%{_appdir}/lib/vclib/ccvs/rcsparse/texttools.py[co]
-%dir %{_appdir}/lib/vclib/svn
-%{_appdir}/lib/vclib/svn/__init__.py[co]
-%{_appdir}/lib/vclib/svn/svn_ra.py[co]
-%{_appdir}/lib/vclib/svn/svn_repos.py[co]
-%{_appdir}/lib/viewvc.py[co]
+%{_appdir}/lib
 %{_appdir}/mimetypes.conf
-%dir %{_appdir}/templates-contrib
-%{_appdir}/templates-contrib/README
+%dir %{_appdir}/templates
 
 %files cgi
 %defattr(644,root,root,755)
 %dir %{_appdir}/bin/cgi
 %attr(755,root,root) %{_appdir}/bin/cgi/viewvc.cgi
-%attr(755,root,root) %{_appdir}/bin/cgi/query.cgi
 
-%files mod_python
+%files wsgi
 %defattr(644,root,root,755)
-%dir %{_appdir}/bin/mod_python
-%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_appdir}/bin/mod_python/.htaccess
-%{_appdir}/bin/mod_python/viewvc.py
-%{_appdir}/bin/mod_python/query.py
-%{_appdir}/bin/mod_python/handler.py
+%dir %{_appdir}/bin/wsgi
+%{_appdir}/bin/wsgi/viewvc.wsgi
 
-%files template-default
+%files fcgi
 %defattr(644,root,root,755)
-%{_appdir}/templates
+%dir %{_appdir}/bin/wsgi
+%attr(755,root,root) %{_appdir}/bin/wsgi/viewvc.fcgi
 
-%files template-newvc
+%files template-default
 %defattr(644,root,root,755)
-%{_appdir}/templates-contrib/newvc
+%{_appdir}/templates/default
 
-%files template-viewsvn
+%files template-classic
 %defattr(644,root,root,755)
-%{_appdir}/templates-contrib/viewsvn
+%{_appdir}/templates/classic
diff --git a/apache.conf b/apache.conf
index 30bfc4a..fa56b32 100644
--- a/apache.conf
+++ b/apache.conf
@@ -4,6 +4,7 @@
 	Options +FollowSymlinks
 
 	# You can override configuration file location using:
+	# (relative paths in it, like template_dir, are relative to its directory)
 	#SetEnv VIEWVC_CONF_PATHNAME /etc/viewvc.conf
 
 	# Apache 1.3, 2.x
@@ -20,52 +21,31 @@
 # Map paths to resources
 # Install appropriate package:
 # - viewvc-template-default
-# - viewvc-template-viewsvn
-# - viewvc-template-newvc
-Alias /viewvc/template/default /usr/share/viewvc/templates/docroot
-Alias /viewvc/template/viewsvn /usr/share/viewvc/templates-contrib/viewsvn/templates/docroot
-Alias /viewvc/template/newvc /usr/share/viewvc/templates-contrib/newvc/templates/docroot
+# - viewvc-template-classic
+Alias /viewvc/template/default /usr/share/viewvc/templates/default/docroot
+Alias /viewvc/template/classic /usr/share/viewvc/templates/classic/docroot
 
 # Version1 (default): under /cgi-bin/viewvc.cgi address
 ScriptAlias /cgi-bin/viewvc.cgi /usr/share/viewvc/bin/cgi/viewvc.cgi
-ScriptAlias /cgi-bin/viewvc-query.cgi /usr/share/viewvc/bin/cgi/query.cgi
 
-# if using apache2 mod_python:
-# Alias /viewvc	/usr/share/viewvc/bin/mod_python
+# if using viewvc-wsgi with apache-mod_wsgi-py3:
+# WSGIScriptAlias /viewvc /usr/share/viewvc/bin/wsgi/viewvc.wsgi
+# WSGIApplicationGroup %{GLOBAL}
 # <Location /viewvc>
-#	# Apache 1.3, 2.x
-#	<IfModule !mod_authz_core.c>
-#		Order allow,deny
-#		Allow from all
-#	</IfModule>
-#	# Apache 2.4
-#	<IfModule mod_authz_core.c>
-#		Require all granted
-#	</IfModule>
-#	<IfModule mod_python.c>
-#		AddHandler mod_python .py
-#		PythonPath "sys.path+['/usr/share/viewvc/bin/mod_python']"
-#		PythonHandler handler
-#		PythonDebug Off
-#	</IfModule>
+#	Require all granted
+# </Location>
+
+# if using viewvc-fcgi with apache-mod_fcgid:
+# ScriptAlias /viewvc /usr/share/viewvc/bin/wsgi/viewvc.fcgi
+# <Location /viewvc>
+#	SetHandler fcgid-script
+#	Require all granted
 # </Location>
 
 # Version 2: viewvc as handler to whole vhost:
 #<VirtualHost *:80>
 #	ServerName cvs
 #
-#	Alias /viewvc/ /usr/share/viewvc
-#	DocumentRoot /usr/share/viewvc/bin/cgi/viewvc.cgi
-#	<Location />
-#		Options ExecCGI
-#		# Apache 1.3, 2.x
-#		<IfModule !mod_authz_core.c>
-#			Order allow,deny
-#			Allow from all
-#		</IfModule>
-#		# Apache 2.4
-#		<IfModule mod_authz_core.c>
-#			Require all granted
-#		</IfModule>
-#	</Location>
+#	Alias /viewvc/template/default /usr/share/viewvc/templates/default/docroot
+#	ScriptAlias / /usr/share/viewvc/bin/cgi/viewvc.cgi/
 #</VirtualHost>
diff --git a/config.patch b/config.patch
index 975e8ff..15430bc 100644
--- a/config.patch
+++ b/config.patch
@@ -1,15 +1,17 @@
---- viewvc-1.1.24/conf/viewvc.conf.dist		2016-04-08 10:18:28.009824630 +0300
-+++ viewvc-1.1.24/conf/viewvc.conf.dist		2016-04-08 10:18:28.009824630 +0300
-@@ -389,7 +389,7 @@
- ##           | directory and its contents (recursively).
- ## ----------+---------------------------------------------------------
+# default_encoding: httpd runs CGI and WSGI without LANG; under the C locale
+# viewvc decodes content as ASCII and hides every non-ASCII file
+--- viewvc-1.3.0.orig/conf/viewvc.conf.dist	2026-05-26 22:15:51.000000000 +0200
++++ viewvc-1.3.0/conf/viewvc.conf.dist	2026-11-22 00:07:41.877446602 +0100
+@@ -473,7 +473,7 @@
+ ## be what the original author intended.  For this reason, ViewVC's
+ ## "co" view is disabled by default.
  ##
 -#allowed_views = annotate, diff, markup, roots
 +allowed_views = annotate, diff, markup, roots, co
  
- ## Comma-delimited list of MIME content types (with support for fnmatch-
- ## style glob characters) which are considered not-human-readable and for
-@@ -485,7 +485,7 @@
+ ## binary_mime_types: Comma-delimited list of MIME content types (with
+ ## support for fnmatch-style glob characters) which are always
+@@ -594,7 +594,7 @@
  ## ALSO NOTE: If you choose one of the "co" or "markup" views, be sure
  ## to enable it (via the allowed_views option)
  ##
@@ -18,7 +20,7 @@
  
  ## http_expiration_time: Expiration time (in seconds) for cacheable
  ## pages served by ViewVC.  Note that in most cases, a cache aware
-@@ -494,14 +494,14 @@
+@@ -603,14 +603,14 @@
  ## will also revalidate the page when the reload button is pressed.
  ## Set to 0 to disable the transmission of these caching headers.
  ##
@@ -35,16 +37,16 @@
  
  ## svn_ignore_mimetype: Don't consult the svn:mime-type property to
  ## determine how to display a file in the markup view.  This is
-@@ -576,7 +576,7 @@
+@@ -685,7 +685,7 @@
  ##   l      Long human readable (more context)
- ##   f      Full human readable (entire file)
+ ##   f      Full human readable (very large context, entire file in most cases)
  ##
 -#diff_format = h
 +diff_format = u
  
  ## hr_breakable: Diff view line breaks
  ##   1     lines break at spaces
-@@ -616,7 +616,7 @@
+@@ -725,7 +725,7 @@
  ## transfer size of ViewVC's responses to the client's request, but
  ## will do so with a speed penalty.
  ##
@@ -53,35 +55,32 @@
  
  ## template_dir: The directory which contains the EZT templates used by
  ## ViewVC to customize the display of the various output views.  ViewVC
-@@ -643,7 +643,15 @@
- ## SEE ALSO: the [templates] configuration section, where you can
- ## override templates on a per-view basis.
- ##
--#template_dir = templates
+@@ -743,8 +743,13 @@
+ ## template_dir = templates/classic
+ ## template_dir = templates/default
+ ## template_dir = /opt/custom-viewvc-templates/templates
 +## Install appropriate package:
 +## - viewvc-template-default
-+## - viewvc-template-viewsvn
-+## - viewvc-template-newvc
++## - viewvc-template-classic
 +## And be sure to adjust also 'docroot' parameter
-+#
-+template_dir = templates
-+#template_dir = templates-contrib/newvc/templates
-+#template_dir = templates-contrib/viewsvn/templates
+ #
+-#template_dir = templates/default
++template_dir = templates/default
++#template_dir = templates/classic
  
  ## docroot: Web path to a directory that contains ViewVC static files
  ## (stylesheets, images, etc.)  If set, static files will get
-@@ -658,7 +666,9 @@
+@@ -759,7 +764,8 @@
  ## still be based on the global default template set per 'template_dir'
  ## above, not on 'template_dir' as overridden for a given root.
  ##
 -#docroot = 
 +docroot = /viewvc/template/default
-+#docroot = /viewvc/template/newvc
-+#docroot = /viewvc/template/viewsvn
++#docroot = /viewvc/template/classic
  
  ## show_subdir_lastmod: Show last changelog message for CVS subdirectories
  ##
-@@ -692,11 +702,11 @@
+@@ -799,11 +805,11 @@
  
  ## use_localtime: Display dates as UTC or in local time zone.
  ##
@@ -95,7 +94,7 @@
  
  ## short_log_len: The length (in characters) to which the most recent
  ## log entry should be truncated when shown in the directory view.
-@@ -712,19 +722,19 @@
+@@ -819,13 +825,13 @@
  ## Use the 'mime_types_files' configuration option to specify MIME
  ## type mapping files useful for making that determination.
  ##
@@ -109,16 +108,25 @@
 -#tabsize = 8
 +tabsize = 0
  
- ## detect_encoding: Should we attempt to detect versioned file
- ## character encodings?  [Requires 'chardet' module, and is currently
- ## used only for the 'markup' and 'annotate' views.]
+ ## default_encoding: The default character encoding to assume for
+ ## repository content whose encoding is not dictated by the version
+@@ -836,13 +842,13 @@
+ ## If this is not specified, it is set to the encoding of the locale
+ ## specified by root_path_locale.
+ ##
+-#default_encoding =
++default_encoding = utf-8
+ 
+ ## detect_encoding: Should we attempt to automatically detect
+ ## versioned file character encodings?  [Requires 'chardet' module,
+ ## and is currently used only for the 'markup' and 'annotate' views.]
  ##
 -#detect_encoding = 0
 +detect_encoding = 1
  
  ## use_cvsgraph: Use CvsGraph to offer visual graphs of CVS revision history.
  ##
-@@ -750,7 +760,7 @@
+@@ -890,7 +896,7 @@
  ## period of time.  This option should only be used on sites with
  ## trusted users. It is highly inadvisable to use this on a public site.
  ##
diff --git a/cvsweb-compat.patch b/cvsweb-compat.patch
index 2164884..d638e0e 100644
--- a/cvsweb-compat.patch
+++ b/cvsweb-compat.patch
@@ -1,27 +1,33 @@
---- viewvc-1.1.23/lib/viewvc.py	2014-11-05 02:16:15.000000000 +0200
-+++ viewvc-1.1.23/lib/viewvc.py	2015-06-14 22:03:20.000000000 +0300
-@@ -683,6 +683,8 @@
-   'sortdir'       : _re_validate_alpha,
-   'logsort'       : _re_validate_alpha,
-   'diff_format'   : _re_validate_alpha,
-+  # old cvsweb for 'diff_format' option
-+  'f'             : _re_validate_alpha,
-   'pathrev'       : _re_validate_revnum,
-   'dir_pagestart' : _re_validate_number,
-   'log_pagestart' : _re_validate_number,
-@@ -2651,5 +2653,5 @@
+--- viewvc-1.3.0.orig/lib/viewvc.py	2026-05-26 22:15:51.000000000 +0200
++++ viewvc-1.3.0/lib/viewvc.py	2026-11-21 23:38:58.675681440 +0100
+@@ -752,6 +752,8 @@
+     "content-type": _validate_mimetype,
+     "diff_format": _re_validate_alpha,
+     "dir_pagestart": _re_validate_number,
++    # old cvsweb name of the 'diff_format' parameter
++    "f": _re_validate_alpha,
+     "graph": _re_validate_revnum,
+     "hideattic": _re_validate_boolint,
+     "limit_changes": _re_validate_number,
+@@ -2893,7 +2895,9 @@
  
  def view_log(request):
-   cfg = request.cfg
--  diff_format = request.query_dict.get('diff_format', cfg.options.diff_format)
-+  diff_format = request.query_dict.get('diff_format', request.query_dict.get('f', cfg.options.diff_format))
-   pathtype = request.pathtype
-@@ -3504,7 +3506,7 @@
-   diff_options = {}
-   human_readable = 0
+     cfg = request.cfg
+-    diff_format = request.query_dict.get("diff_format", cfg.options.diff_format)
++    diff_format = request.query_dict.get(
++        "diff_format", request.query_dict.get("f", cfg.options.diff_format)
++    )
+     pathtype = request.pathtype
  
--  format = query_dict.get('diff_format', cfg.options.diff_format)
-+  format = query_dict.get('diff_format', query_dict.get('f', cfg.options.diff_format))
-   if format == 'c':
-     diff_type = vclib.CONTEXT
-   elif format == 's':
+     if pathtype is vclib.DIR:
+@@ -3917,7 +3921,9 @@
+         cfg = request.cfg
+         query_dict = request.query_dict
+ 
+-        self.diff_format = query_dict.get("diff_format", cfg.options.diff_format)
++        self.diff_format = query_dict.get(
++            "diff_format", query_dict.get("f", cfg.options.diff_format)
++        )
+         self.human_readable = 0
+         self.hide_legend = 0
+         self.line_differ = None
diff --git a/error-status.patch b/error-status.patch
new file mode 100644
index 0000000..3cfd4ff
--- /dev/null
+++ b/error-status.patch
@@ -0,0 +1,34 @@
+# errors without an HTTP status, or failing to load the page template, were
+# sent as "200 OK"
+--- viewvc-1.3.0.orig/lib/common.py	2026-05-26 22:15:51.000000000 +0200
++++ viewvc-1.3.0/lib/common.py	2026-11-22 01:23:15.259641364 +0100
+@@ -105,7 +105,7 @@
+     exc_type, exc, exc_tb = sys.exc_info()
+ 
+     exc_dict = {
+-        "status": None,
++        "status": "500 Internal Server Error",
+         "msg": None,
+         "stacktrace": None,
+     }
+@@ -117,7 +117,7 @@
+ 
+         if isinstance(exc, ViewVCException):
+             exc_dict["msg"] = exc.msg
+-            exc_dict["status"] = exc.status
++            exc_dict["status"] = exc.status or exc_dict["status"]
+         formatted = traceback.format_exception(exc_type, exc, exc_tb)
+         if exc_tb is not None:
+             formatted = formatted[1:]
+--- viewvc-1.3.0.orig/lib/viewvc.py	2026-11-22 01:23:15.028344597 +0100
++++ viewvc-1.3.0/lib/viewvc.py	2026-11-22 01:23:15.344597796 +0100
+@@ -1042,8 +1042,8 @@
+ 
+ 
+ def generate_page(request, view_name, data, content_type=None):
+-    server_fp = get_writeready_server_file(request, content_type, "utf-8", is_text=True)
+     template = get_view_template(request.cfg, view_name, request.language)
++    server_fp = get_writeready_server_file(request, content_type, "utf-8", is_text=True)
+     template.generate(server_fp, data)
+ 
+ 
diff --git a/error-traceback.patch b/error-traceback.patch
new file mode 100644
index 0000000..181328c
--- /dev/null
+++ b/error-traceback.patch
@@ -0,0 +1,21 @@
+# with stacktraces = 0 there is no "Traceback" header, so the exception
+# line was dropped and the fallback error page crashed on write(None)
+--- viewvc-1.3.0.orig/lib/common.py	2026-11-22 01:17:54.044489965 +0100
++++ viewvc-1.3.0/lib/common.py	2026-11-22 01:18:00.509758227 +0100
+@@ -112,14 +112,14 @@
+ 
+     try:
+         # Build a string from the formatted exception, but skipping the
+-        # first line.
++        # "Traceback" header line (absent when sys.tracebacklimit is 0).
+         import traceback
+ 
+         if isinstance(exc, ViewVCException):
+             exc_dict["msg"] = exc.msg
+             exc_dict["status"] = exc.status or exc_dict["status"]
+         formatted = traceback.format_exception(exc_type, exc, exc_tb)
+-        if exc_tb is not None:
++        if formatted[:1] == ["Traceback (most recent call last):\n"]:
+             formatted = formatted[1:]
+         exc_dict["stacktrace"] = "".join(formatted) if formatted else None
+     finally:
diff --git a/fcgi-shebang.patch b/fcgi-shebang.patch
new file mode 100644
index 0000000..40e8b84
--- /dev/null
+++ b/fcgi-shebang.patch
@@ -0,0 +1,8 @@
+# mod_fcgid executes the wrapper directly, which needs an interpreter line
+--- viewvc-1.3.0.orig/bin/wsgi/viewvc.fcgi	2026-05-26 22:15:51.000000000 +0200
++++ viewvc-1.3.0/bin/wsgi/viewvc.fcgi	2026-11-22 01:34:40.898815655 +0100
+@@ -1,3 +1,4 @@
++#!/usr/bin/env python3
+ # -*-python-*-
+ #
+ # Copyright (C) 1999-2026 The ViewCVS Group. All Rights Reserved.
diff --git a/stream-close.patch b/stream-close.patch
new file mode 100644
index 0000000..d1dca83
--- /dev/null
+++ b/stream-close.patch
@@ -0,0 +1,21 @@
+# io.TextIOWrapper.closed is read-only: close() raised AttributeError and
+# logged an exception on every request
+# https://github.com/viewvc/viewvc/issues/408
+# https://github.com/viewvc/viewvc/pull/410 (merged as e4e6bf66b02f)
+--- viewvc-1.3.0.orig/lib/viewvc.py	2026-05-26 22:15:51.000000000 +0200
++++ viewvc-1.3.0/lib/viewvc.py	2026-11-21 23:42:41.447912514 +0100
+@@ -97,10 +97,11 @@
+     close() is called or this object is destroyed."""
+ 
+     def close(self):
+-        if not self.closed:
+-            self.closed = True
++        try:
+             self.flush()
+-            self.detach()
++        except Exception:
++            pass
++        self.detach()
+ 
+ 
+ class Request:
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/viewvc.git/commitdiff/44b98d539cc7ef6dfd88de22f6cd35d0fa45763f



More information about the pld-cvs-commit mailing list