~ubuntu-branches/ubuntu/vivid/zoneminder/vivid-proposed

« back to all changes in this revision

Viewing changes to scripts/zmupdate.pl

  • Committer: Bazaar Package Importer
  • Author(s): Peter Howard
  • Date: 2009-11-14 15:02:10 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091114150210-d8721h9wm90cbaog
Tags: 1.24.2-2
* Remove custom perl parth from zmpkg.pl, fix location of manpages.
(closes: #551746, #553092)
* Fix GCC4.4 bug
(closes: #531717)
* Fix potential bug in postinst script

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# ==========================================================================
4
4
#
5
 
# ZoneMinder Update Script, $Date: 2009-02-23 20:54:36 +0000 (Mon, 23 Feb 2009) $, $Revision: 2788 $
 
5
# ZoneMinder Update Script, $Date: 2009-06-30 08:41:54 +0100 (Tue, 30 Jun 2009) $, $Revision: 2937 $
6
6
# Copyright (C) 2001-2008 Philip Coombes
7
7
#
8
8
# This program is free software; you can redistribute it and/or
45
45
#
46
46
# ==========================================================================
47
47
 
 
48
use lib '/home/stan/Work/Install/lib/perl5/site_perl/5.8.8'; # Include custom perl install path
48
49
use ZoneMinder::Base qw(:all);
49
50
use ZoneMinder::Config qw(:all);
50
51
use ZoneMinder::Debug qw(:all);
338
339
        print( "Please ensure that ZoneMinder is stopped on your system prior to upgrading the database.\nPress enter to continue or ctrl-C to stop : " );
339
340
        my $response = <STDIN>;
340
341
 
341
 
        print( "\nDo you wish to take a backup of your database prior to upgrading?\nThis may result in a large file if you have a lot of events.\nPress 'y' for a backup or 'n' to continue : " );
 
342
        print( "\nDo you wish to take a backup of your database prior to upgrading?\nThis may result in a large file in /tmp if you have a lot of events.\nPress 'y' for a backup or 'n' to continue : " );
342
343
        $response = <STDIN>;
343
344
        chomp( $response );
344
345
        while ( $response !~ /^[yYnN]$/ )
361
362
                    $command .= " -p".$db_pass;
362
363
                }
363
364
            }
364
 
            my $backup = ZM_DB_NAME."-".$version.".dump";
 
365
            my $backup = "/tmp/".ZM_DB_NAME."-".$version.".dump";
365
366
            $command .= " --add-drop-table --databases ".ZM_DB_NAME." > ".$backup;
366
367
            print( "Creating backup to $backup. This may take several minutes.\n" );
367
368
            print( "Executing '$command'\n" ) if ( DBG_LEVEL > 0 );
867
868
        patchDB( $dbh, "1.24.0" );
868
869
        $cascade = !undef;
869
870
    }
 
871
    if ( $cascade || $version eq "1.24.1" )
 
872
    {
 
873
        # Patch the database
 
874
        patchDB( $dbh, "1.24.1" );
 
875
        $cascade = !undef;
 
876
    }
870
877
    if ( $cascade )
871
878
    {
872
879
        my $installed_version = ZM_VERSION;