From 8c7e633d8f70030f2b389f12bc4525c473b64af8 Mon Sep 17 00:00:00 2001 From: Rick Sayre Date: Mon, 18 May 2015 21:55:00 -0700 Subject: [PATCH] Undo ZM_VERSION changes --- scripts/zmupdate.pl.in | 12 ++++++------ web/includes/config.php.in | 8 +------- zm.conf.in | 3 --- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/scripts/zmupdate.pl.in b/scripts/zmupdate.pl.in index e5b8e3d0d..75ac52fa0 100644 --- a/scripts/zmupdate.pl.in +++ b/scripts/zmupdate.pl.in @@ -165,7 +165,7 @@ if ( $check && $Config{ZM_CHECK_FOR_UPDATES} ) use LWP::UserAgent; my $ua = LWP::UserAgent->new; - $ua->agent( "ZoneMinder Update Agent/".$Config{ZM_VERSION} ); + $ua->agent( "ZoneMinder Update Agent/".ZM_VERSION ); if ( $Config{ZM_UPDATE_CHECK_PROXY} ) { $ua->proxy( "http", $Config{ZM_UPDATE_CHECK_PROXY} ); } @@ -374,13 +374,13 @@ if ( $version ) my ( $detaint_version ) = $version =~ /^([\w.]+)$/; $version = $detaint_version; - if ( $Config{ZM_VERSION} eq $version ) + if ( ZM_VERSION eq $version ) { print( "\nDatabase already at version $version, update aborted.\n\n" ); exit( 0 ); } - print( "\nInitiating database upgrade to version ".$Config{ZM_VERSION}." from version $version\n" ); + print( "\nInitiating database upgrade to version ".ZM_VERSION." from version $version\n" ); if ( $interactive ) { if ( $Config{ZM_DYN_DB_VERSION} && $Config{ZM_DYN_DB_VERSION} ne $version ) @@ -489,7 +489,7 @@ if ( $version ) } - print( "\nUpgrading database to version ".$Config{ZM_VERSION}."\n" ); + print( "\nUpgrading database to version ".ZM_VERSION."\n" ); # Update config first of all loadConfigFromDB(); @@ -1050,7 +1050,7 @@ if ( $version ) if ( $cascade ) { - my $installed_version = $Config{ZM_VERSION}; + my $installed_version = ZM_VERSION; my $sql = "update Config set Value = ? where Name = ?"; my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); my $res = $sth->execute( "$installed_version", "ZM_DYN_DB_VERSION" ) or die( "Can't execute: ".$sth->errstr() ); @@ -1061,7 +1061,7 @@ if ( $version ) zmDbDisconnect(); die( "Can't find upgrade from version '$version'" ); } - print( "\nDatabase upgrade to version ".$Config{ZM_VERSION}." successful.\n\n" ); + print( "\nDatabase upgrade to version ".ZM_VERSION." successful.\n\n" ); } zmDbDisconnect(); exit( 0 ); diff --git a/web/includes/config.php.in b/web/includes/config.php.in index 54257fc16..b2adc8969 100644 --- a/web/includes/config.php.in +++ b/web/includes/config.php.in @@ -22,6 +22,7 @@ // This section contains options substituted by the zmconfig.pl utility, do not edit these directly // define( "ZM_CONFIG", "@ZM_CONFIG@" ); // Path to config file +define( "ZM_VERSION", "@VERSION@" ); // Version $configFile = ZM_CONFIG; $localConfigFile = basename($configFile); @@ -47,13 +48,6 @@ while ( !feof($cfg) ) } fclose( $cfg ); -// Define, and override any given in config file -// to override, must be done AFTER asignment, cripes -// @VERSION@ hasn't been defined in tests, perhaps configure.ac needs fix? -if (!defined("ZM_VERSION")) { // avoid double definition warning - define( "ZM_VERSION", "@VERSION@" ); // Version -} - // // This section is options normally derived from other options or configuration // diff --git a/zm.conf.in b/zm.conf.in index f3bdb0471..9cc3d42de 100644 --- a/zm.conf.in +++ b/zm.conf.in @@ -48,6 +48,3 @@ ZM_DB_PASS=@ZM_DB_PASS@ # Host of this machine ZM_SERVER_HOST= - -# Version of zoneminder - must be set -ZM_VERSION=1.28.1