Undo ZM_VERSION changes

This commit is contained in:
Rick Sayre 2015-05-18 21:55:00 -07:00
parent ffe46978d2
commit 8c7e633d8f
3 changed files with 7 additions and 16 deletions

View File

@ -165,7 +165,7 @@ if ( $check && $Config{ZM_CHECK_FOR_UPDATES} )
use LWP::UserAgent; use LWP::UserAgent;
my $ua = LWP::UserAgent->new; 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} ) { if ( $Config{ZM_UPDATE_CHECK_PROXY} ) {
$ua->proxy( "http", $Config{ZM_UPDATE_CHECK_PROXY} ); $ua->proxy( "http", $Config{ZM_UPDATE_CHECK_PROXY} );
} }
@ -374,13 +374,13 @@ if ( $version )
my ( $detaint_version ) = $version =~ /^([\w.]+)$/; my ( $detaint_version ) = $version =~ /^([\w.]+)$/;
$version = $detaint_version; $version = $detaint_version;
if ( $Config{ZM_VERSION} eq $version ) if ( ZM_VERSION eq $version )
{ {
print( "\nDatabase already at version $version, update aborted.\n\n" ); print( "\nDatabase already at version $version, update aborted.\n\n" );
exit( 0 ); 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 ( $interactive )
{ {
if ( $Config{ZM_DYN_DB_VERSION} && $Config{ZM_DYN_DB_VERSION} ne $version ) 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 # Update config first of all
loadConfigFromDB(); loadConfigFromDB();
@ -1050,7 +1050,7 @@ if ( $version )
if ( $cascade ) if ( $cascade )
{ {
my $installed_version = $Config{ZM_VERSION}; my $installed_version = ZM_VERSION;
my $sql = "update Config set Value = ? where Name = ?"; my $sql = "update Config set Value = ? where Name = ?";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() ); 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() ); my $res = $sth->execute( "$installed_version", "ZM_DYN_DB_VERSION" ) or die( "Can't execute: ".$sth->errstr() );
@ -1061,7 +1061,7 @@ if ( $version )
zmDbDisconnect(); zmDbDisconnect();
die( "Can't find upgrade from version '$version'" ); 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(); zmDbDisconnect();
exit( 0 ); exit( 0 );

View File

@ -22,6 +22,7 @@
// This section contains options substituted by the zmconfig.pl utility, do not edit these directly // 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_CONFIG", "@ZM_CONFIG@" ); // Path to config file
define( "ZM_VERSION", "@VERSION@" ); // Version
$configFile = ZM_CONFIG; $configFile = ZM_CONFIG;
$localConfigFile = basename($configFile); $localConfigFile = basename($configFile);
@ -47,13 +48,6 @@ while ( !feof($cfg) )
} }
fclose( $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 // This section is options normally derived from other options or configuration
// //

View File

@ -48,6 +48,3 @@ ZM_DB_PASS=@ZM_DB_PASS@
# Host of this machine # Host of this machine
ZM_SERVER_HOST= ZM_SERVER_HOST=
# Version of zoneminder - must be set
ZM_VERSION=1.28.1