[vhffs-dev] [2166] updated Awstats patchs to make them work with the Debian Squeeze awstats binary |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 2166
Author: gradator
Date: 2012-04-30 19:30:44 +0200 (Mon, 30 Apr 2012)
Log Message:
-----------
updated Awstats patchs to make them work with the Debian Squeeze awstats binary
Modified Paths:
--------------
branches/vhffs-4.4/vhffs-robots/misc/awstats_6.95_vhffs.patch
branches/vhffs-4.4/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch
trunk/vhffs-robots/misc/awstats_6.95_vhffs.patch
trunk/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch
Modified: branches/vhffs-4.4/vhffs-robots/misc/awstats_6.95_vhffs.patch
===================================================================
--- branches/vhffs-4.4/vhffs-robots/misc/awstats_6.95_vhffs.patch 2012-04-30 15:04:56 UTC (rev 2165)
+++ branches/vhffs-4.4/vhffs-robots/misc/awstats_6.95_vhffs.patch 2012-04-30 17:30:44 UTC (rev 2166)
@@ -1,34 +1,41 @@
---- awstats.pl 2009-09-06 15:02:19.000000000 +0000
-+++ awstats.pl.web 2009-09-06 15:04:13.000000000 +0000
-@@ -1718,22 +1718,11 @@
+--- awstats.pl_ 2012-04-30 18:52:22.668828732 +0200
++++ awstats.pl 2012-04-30 18:56:16.064121136 +0200
+@@ -1716,29 +1716,12 @@
+ # Other possible directories : "/usr/local/etc/awstats", "/etc"
+ # FHS standard, Suse package : "/etc/opt/awstats"
my $configdir = shift;
- my @PossibleConfigDir = ();
-
+- my @PossibleConfigDir = (
+- "$DIR",
+- "/etc/awstats",
+- "/usr/local/etc/awstats", "/etc",
+- "/etc/opt/awstats"
+- );
+-
- if ($configdir) {
-- # If from CGI, overwriting of configdir is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
-- if ($ENV{'GATEWAY_INTERFACE'} && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"}) {
-- error("Sorry, to allow overwriting of configdir parameter from an AWStats CGI usage, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1");
+- # Check if configdir is outside default values.
+- my $outsidedefaultvalue=1;
+- foreach (@PossibleConfigDir) {
+- if ($_ eq $configdir) { $outsidedefaultvalue=0; last; }
- }
-- else {
-- @PossibleConfigDir = ("$configdir");
+
+- # If from CGI, overwriting of configdir with a value that differs from a default value
+- # is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
+- if ($ENV{'GATEWAY_INTERFACE'} && $outsidedefaultvalue && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"})
+- {
+- error("Sorry, to allow overwriting of configdir parameter, from an AWStats CGI page, with a non default value, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1. For example, by adding the line 'SetEnv AWSTATS_ENABLE_CONFIG_DIR 1' in your Apache config file or into a .htaccess file.");
- }
+-
+- @PossibleConfigDir = ("$configdir");
- }
-- else {
-- @PossibleConfigDir = (
-- "$DIR", "/etc/awstats",
-- "/usr/local/etc/awstats", "/etc",
-- "/etc/opt/awstats"
-- );
-- }
+ error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z\.\-]+$/ );
+ use Digest::MD5 qw(md5 md5_hex md5_base64);
+ my $vhffssitehash = md5_hex( $SiteConfig );
+ my $vhffsconfigdir = '/data/web/'.substr( $vhffssitehash, 0, 2 ).'/'.substr( $vhffssitehash, 2, 2 ).'/'.substr( $vhffssitehash, 4, 2 ).'/'.$SiteConfig.'/awstats';
-+ @PossibleConfigDir=("$vhffsconfigdir");
++ my @PossibleConfigDir = ( $vhffsconfigdir );
# Open config file
$FileConfig = $FileSuffix = '';
-@@ -10081,7 +10070,7 @@
+@@ -10111,7 +10094,7 @@
else { @DOWIndex = ( 0, 1, 2, 3, 4, 5, 6 ); }
# Should we link to ourselves or to a wrapper script
Modified: branches/vhffs-4.4/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch
===================================================================
--- branches/vhffs-4.4/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch 2012-04-30 15:04:56 UTC (rev 2165)
+++ branches/vhffs-4.4/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch 2012-04-30 17:30:44 UTC (rev 2166)
@@ -1,32 +1,39 @@
---- awstats.pl 2009-09-06 15:02:19.000000000 +0000
-+++ awstats.pl.downloads 2009-09-06 15:05:31.000000000 +0000
-@@ -1718,22 +1718,9 @@
+--- awstats.pl_ 2012-04-30 18:52:22.668828732 +0200
++++ awstats.pl 2012-04-30 18:58:32.599707630 +0200
+@@ -1716,29 +1716,10 @@
+ # Other possible directories : "/usr/local/etc/awstats", "/etc"
+ # FHS standard, Suse package : "/etc/opt/awstats"
my $configdir = shift;
- my @PossibleConfigDir = ();
-
+- my @PossibleConfigDir = (
+- "$DIR",
+- "/etc/awstats",
+- "/usr/local/etc/awstats", "/etc",
+- "/etc/opt/awstats"
+- );
+-
- if ($configdir) {
-- # If from CGI, overwriting of configdir is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
-- if ($ENV{'GATEWAY_INTERFACE'} && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"}) {
-- error("Sorry, to allow overwriting of configdir parameter from an AWStats CGI usage, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1");
+- # Check if configdir is outside default values.
+- my $outsidedefaultvalue=1;
+- foreach (@PossibleConfigDir) {
+- if ($_ eq $configdir) { $outsidedefaultvalue=0; last; }
- }
-- else {
-- @PossibleConfigDir = ("$configdir");
+
+- # If from CGI, overwriting of configdir with a value that differs from a default value
+- # is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
+- if ($ENV{'GATEWAY_INTERFACE'} && $outsidedefaultvalue && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"})
+- {
+- error("Sorry, to allow overwriting of configdir parameter, from an AWStats CGI page, with a non default value, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1. For example, by adding the line 'SetEnv AWSTATS_ENABLE_CONFIG_DIR 1' in your Apache config file or into a .htaccess file.");
- }
+-
+- @PossibleConfigDir = ("$configdir");
- }
-- else {
-- @PossibleConfigDir = (
-- "$DIR", "/etc/awstats",
-- "/usr/local/etc/awstats", "/etc",
-- "/etc/opt/awstats"
-- );
-- }
+ error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z]+$/ );
+ my $vhffsconfigdir = '/data/logs/repository/parsed/'.$SiteConfig.'/awstats';
-+ @PossibleConfigDir=("$vhffsconfigdir");
++ my @PossibleConfigDir = ($vhffsconfigdir );
# Open config file
$FileConfig = $FileSuffix = '';
-@@ -10081,7 +10068,7 @@
+@@ -10111,7 +10092,7 @@
else { @DOWIndex = ( 0, 1, 2, 3, 4, 5, 6 ); }
# Should we link to ourselves or to a wrapper script
Modified: trunk/vhffs-robots/misc/awstats_6.95_vhffs.patch
===================================================================
--- trunk/vhffs-robots/misc/awstats_6.95_vhffs.patch 2012-04-30 15:04:56 UTC (rev 2165)
+++ trunk/vhffs-robots/misc/awstats_6.95_vhffs.patch 2012-04-30 17:30:44 UTC (rev 2166)
@@ -1,34 +1,41 @@
---- awstats.pl 2009-09-06 15:02:19.000000000 +0000
-+++ awstats.pl.web 2009-09-06 15:04:13.000000000 +0000
-@@ -1718,22 +1718,11 @@
+--- awstats.pl_ 2012-04-30 18:52:22.668828732 +0200
++++ awstats.pl 2012-04-30 18:56:16.064121136 +0200
+@@ -1716,29 +1716,12 @@
+ # Other possible directories : "/usr/local/etc/awstats", "/etc"
+ # FHS standard, Suse package : "/etc/opt/awstats"
my $configdir = shift;
- my @PossibleConfigDir = ();
-
+- my @PossibleConfigDir = (
+- "$DIR",
+- "/etc/awstats",
+- "/usr/local/etc/awstats", "/etc",
+- "/etc/opt/awstats"
+- );
+-
- if ($configdir) {
-- # If from CGI, overwriting of configdir is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
-- if ($ENV{'GATEWAY_INTERFACE'} && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"}) {
-- error("Sorry, to allow overwriting of configdir parameter from an AWStats CGI usage, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1");
+- # Check if configdir is outside default values.
+- my $outsidedefaultvalue=1;
+- foreach (@PossibleConfigDir) {
+- if ($_ eq $configdir) { $outsidedefaultvalue=0; last; }
- }
-- else {
-- @PossibleConfigDir = ("$configdir");
+
+- # If from CGI, overwriting of configdir with a value that differs from a default value
+- # is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
+- if ($ENV{'GATEWAY_INTERFACE'} && $outsidedefaultvalue && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"})
+- {
+- error("Sorry, to allow overwriting of configdir parameter, from an AWStats CGI page, with a non default value, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1. For example, by adding the line 'SetEnv AWSTATS_ENABLE_CONFIG_DIR 1' in your Apache config file or into a .htaccess file.");
- }
+-
+- @PossibleConfigDir = ("$configdir");
- }
-- else {
-- @PossibleConfigDir = (
-- "$DIR", "/etc/awstats",
-- "/usr/local/etc/awstats", "/etc",
-- "/etc/opt/awstats"
-- );
-- }
+ error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z\.\-]+$/ );
+ use Digest::MD5 qw(md5 md5_hex md5_base64);
+ my $vhffssitehash = md5_hex( $SiteConfig );
+ my $vhffsconfigdir = '/data/web/'.substr( $vhffssitehash, 0, 2 ).'/'.substr( $vhffssitehash, 2, 2 ).'/'.substr( $vhffssitehash, 4, 2 ).'/'.$SiteConfig.'/awstats';
-+ @PossibleConfigDir=("$vhffsconfigdir");
++ my @PossibleConfigDir = ( $vhffsconfigdir );
# Open config file
$FileConfig = $FileSuffix = '';
-@@ -10081,7 +10070,7 @@
+@@ -10111,7 +10094,7 @@
else { @DOWIndex = ( 0, 1, 2, 3, 4, 5, 6 ); }
# Should we link to ourselves or to a wrapper script
Modified: trunk/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch
===================================================================
--- trunk/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch 2012-04-30 15:04:56 UTC (rev 2165)
+++ trunk/vhffs-robots/misc/repository.awstats_6.95_vhffs.patch 2012-04-30 17:30:44 UTC (rev 2166)
@@ -1,32 +1,39 @@
---- awstats.pl 2009-09-06 15:02:19.000000000 +0000
-+++ awstats.pl.downloads 2009-09-06 15:05:31.000000000 +0000
-@@ -1718,22 +1718,9 @@
+--- awstats.pl_ 2012-04-30 18:52:22.668828732 +0200
++++ awstats.pl 2012-04-30 18:58:32.599707630 +0200
+@@ -1716,29 +1716,10 @@
+ # Other possible directories : "/usr/local/etc/awstats", "/etc"
+ # FHS standard, Suse package : "/etc/opt/awstats"
my $configdir = shift;
- my @PossibleConfigDir = ();
-
+- my @PossibleConfigDir = (
+- "$DIR",
+- "/etc/awstats",
+- "/usr/local/etc/awstats", "/etc",
+- "/etc/opt/awstats"
+- );
+-
- if ($configdir) {
-- # If from CGI, overwriting of configdir is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
-- if ($ENV{'GATEWAY_INTERFACE'} && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"}) {
-- error("Sorry, to allow overwriting of configdir parameter from an AWStats CGI usage, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1");
+- # Check if configdir is outside default values.
+- my $outsidedefaultvalue=1;
+- foreach (@PossibleConfigDir) {
+- if ($_ eq $configdir) { $outsidedefaultvalue=0; last; }
- }
-- else {
-- @PossibleConfigDir = ("$configdir");
+
+- # If from CGI, overwriting of configdir with a value that differs from a default value
+- # is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
+- if ($ENV{'GATEWAY_INTERFACE'} && $outsidedefaultvalue && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"})
+- {
+- error("Sorry, to allow overwriting of configdir parameter, from an AWStats CGI page, with a non default value, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1. For example, by adding the line 'SetEnv AWSTATS_ENABLE_CONFIG_DIR 1' in your Apache config file or into a .htaccess file.");
- }
+-
+- @PossibleConfigDir = ("$configdir");
- }
-- else {
-- @PossibleConfigDir = (
-- "$DIR", "/etc/awstats",
-- "/usr/local/etc/awstats", "/etc",
-- "/etc/opt/awstats"
-- );
-- }
+ error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z]+$/ );
+ my $vhffsconfigdir = '/data/logs/repository/parsed/'.$SiteConfig.'/awstats';
-+ @PossibleConfigDir=("$vhffsconfigdir");
++ my @PossibleConfigDir = ($vhffsconfigdir );
# Open config file
$FileConfig = $FileSuffix = '';
-@@ -10081,7 +10068,7 @@
+@@ -10111,7 +10092,7 @@
else { @DOWIndex = ( 0, 1, 2, 3, 4, 5, 6 ); }
# Should we link to ourselves or to a wrapper script