git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/6] gitweb: Add mod_perl version string to "generator" meta header

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 27, 2006, 22:59 UTC
Message-ID
<200612272359.51960.jnareb@gmail.com>
In-Reply-To
<200612272355.31923.jnareb@gmail.com>

Add mod_perl version string (the value of $ENV{'MOD_PERL'} if it is set) to "generator" meta header.

The purpose of this is to identify version of gitweb, now that codepath may differ for gitweb run as CGI script, run under mod_perl 1.0 and run under mod_perl 2.0.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
For example mod_perl 2.0 sets MOD_PERL to something like
"mod_perl/2.0.1".

This patch was created because further patches make gitweb to have different codepath for mod_perl; so mod_perl version string was added to "generator" meta header in HTML header.

 gitweb/gitweb.perl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index aaee217..bb1d66c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1724,6 +1724,8 @@ sub git_header_html {
 		-charset => 'utf-8',
 		-status => $status,
 		-expires => $expires);
+	# the environmental variable MOD_PERL has 'mod_perl/VERSION' value if set
+	my $mod_perl_version = $ENV{'MOD_PERL'} ? " $ENV{'MOD_PERL'}" : '';
 	print <<EOF;
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -1732,7 +1734,7 @@ sub git_header_html {
 <!-- git core binaries version $git_version -->
 <head>
 <meta http-equiv="content-type" content="$content_type; charset=utf-8"/>
-<meta name="generator" content="gitweb/$version git/$git_version"/>
+<meta name="generator" content="gitweb/$version git/$git_version$mod_perl_version"/>
 <meta name="robots" content="index, nofollow"/>
 <title>$title</title>
 EOF
-- 
1.4.4.3
Previous: Shawn PearceNext: Jakub Narebski
Message 5 of 11 in “gitweb: Some mod_perl specific support (but not only)”
  1. 0/6 gitweb: Some mod_perl specific support (but not only)Jakub Narebski, Dec 27, 2006
  2. 1/6 gitweb: Separate HTTP header outputJakub Narebski, Dec 27, 2006
  3. Junio C HamanoDec 28, 2006
  4. Shawn PearceDec 28, 2006
  5. 2/6 gitweb: Add mod_perl version string to "generator" meta headerJakub Narebski, Dec 27, 2006
  6. 3/6 gitweb: Precompile CGI routines for mod_perlJakub Narebski, Dec 27, 2006
  7. 4/6 gitweb: Prepare for mod_perl specific supportJakub Narebski, Dec 27, 2006
  8. 5/6 gitweb: Make possible to run under mod_perl without SetupEnvJakub Narebski, Dec 27, 2006
  9. 6/6 gitweb: Make possible to run under mod_perl without ParseHeadersJakub Narebski, Dec 28, 2006
  10. Robert FitzsimonsDec 28, 2006
  11. Jakub NarebskiDec 28, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.