Lines 50-61
use constant ATOMICUPD_PREF => '_LocalAtomicUpdates';
Link Here
|
50 |
my $debug = 0; |
50 |
my $debug = 0; |
51 |
my $aupd = { #hash for atomic updates |
51 |
my $aupd = { #hash for atomic updates |
52 |
location => C4::Context->config('intranetdir')."/installer/data/mysql/atomicupdate", |
52 |
location => C4::Context->config('intranetdir')."/installer/data/mysql/atomicupdate", |
|
|
53 |
mode => C4::Context->config('devupdatecontrol') || 'PROD', |
53 |
remember => C4::Context->preference(ATOMICUPD_PREF)//'', |
54 |
remember => C4::Context->preference(ATOMICUPD_PREF)//'', |
54 |
skipfiles => { |
55 |
skipfiles => { |
55 |
'Bug-4246-Talking-Tech-itiva-phone-notifications.pl' => 1, |
56 |
'Bug-4246-Talking-Tech-itiva-phone-notifications.pl' => 1, |
56 |
'oai_sets.sql' => 1, |
57 |
'oai_sets.sql' => 1, |
57 |
}, |
58 |
}, |
58 |
}; |
59 |
}; |
|
|
60 |
# Short explanation of the various dev update control modes: |
61 |
# PROD: Only install official database revisions (default and fallback) |
62 |
# RESET: After an official database rev, reinstall all development updates |
63 |
# ALWAYS: When upgrading, reinstall all development updates |
64 |
# TRACK: Do not reinstall applied development updates |
59 |
|
65 |
|
60 |
my ( |
66 |
my ( |
61 |
$sth, $sti, |
67 |
$sth, $sti, |
Lines 9565-9571
sub RunRemainingAtomicUpdates {
Link Here
|
9565 |
if( exists $atomicupd->{skipfiles}->{$upd} ) { |
9571 |
if( exists $atomicupd->{skipfiles}->{$upd} ) { |
9566 |
next; # Skip official db revision |
9572 |
next; # Skip official db revision |
9567 |
} |
9573 |
} |
9568 |
if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
9574 |
if( $atomicupd->{mode} ne 'ALWAYS' && |
|
|
9575 |
$atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
9569 |
#Skip files that have recently been applied |
9576 |
#Skip files that have recently been applied |
9570 |
#Note that an official db rev erases this list |
9577 |
#Note that an official db rev erases this list |
9571 |
print "Skipping $upd as recently applied dev update\n"; |
9578 |
print "Skipping $upd as recently applied dev update\n"; |
Lines 9623-9629
sub ExecDBRev {
Link Here
|
9623 |
print "Dev upgrade $file done\n"; |
9630 |
print "Dev upgrade $file done\n"; |
9624 |
_atomic_memory( $atomicupd, $file ) if $rv; |
9631 |
_atomic_memory( $atomicupd, $file ) if $rv; |
9625 |
} else { |
9632 |
} else { |
9626 |
_atomic_memory( $atomicupd ); #Official db rev clears the atomic pref |
9633 |
_atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref |
9627 |
SetVersion($version); |
9634 |
SetVersion($version); |
9628 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
9635 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
9629 |
} |
9636 |
} |
Lines 9631-9636
sub ExecDBRev {
Link Here
|
9631 |
|
9638 |
|
9632 |
sub _atomic_memory { |
9639 |
sub _atomic_memory { |
9633 |
my ( $atomicupd, $upd ) = @_; |
9640 |
my ( $atomicupd, $upd ) = @_; |
|
|
9641 |
|
9642 |
return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref |
9643 |
return if !$upd && $atomicupd->{mode} eq 'TRACK'; # no reset |
9644 |
|
9634 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
9645 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
9635 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
9646 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
9636 |
} |
9647 |
} |
Lines 9744-9748
sub CheckVersion {
Link Here
|
9744 |
} |
9755 |
} |
9745 |
} |
9756 |
} |
9746 |
|
9757 |
|
9747 |
RunRemainingAtomicUpdates( $aupd ); |
9758 |
RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD'; |
9748 |
exit; |
9759 |
exit; |
9749 |
- |
|
|