|
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 9687-9693
sub RunRemainingAtomicUpdates {
Link Here
|
| 9687 |
if( exists $atomicupd->{skipfiles}->{$upd} ) { |
9693 |
if( exists $atomicupd->{skipfiles}->{$upd} ) { |
| 9688 |
next; # Skip official db revision |
9694 |
next; # Skip official db revision |
| 9689 |
} |
9695 |
} |
| 9690 |
if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
9696 |
if( $atomicupd->{mode} ne 'ALWAYS' && |
|
|
9697 |
$atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
| 9691 |
#Skip files that have recently been applied |
9698 |
#Skip files that have recently been applied |
| 9692 |
#Note that an official db rev erases this list |
9699 |
#Note that an official db rev erases this list |
| 9693 |
print "Skipping $upd as recently applied dev update\n"; |
9700 |
print "Skipping $upd as recently applied dev update\n"; |
|
Lines 9745-9751
sub ExecDBRev {
Link Here
|
| 9745 |
print "Dev upgrade $file done\n"; |
9752 |
print "Dev upgrade $file done\n"; |
| 9746 |
_atomic_memory( $atomicupd, $file ) if $rv; |
9753 |
_atomic_memory( $atomicupd, $file ) if $rv; |
| 9747 |
} else { |
9754 |
} else { |
| 9748 |
_atomic_memory( $atomicupd ); #Official db rev clears the atomic pref |
9755 |
_atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref |
| 9749 |
SetVersion($version); |
9756 |
SetVersion($version); |
| 9750 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
9757 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
| 9751 |
} |
9758 |
} |
|
Lines 9753-9758
sub ExecDBRev {
Link Here
|
| 9753 |
|
9760 |
|
| 9754 |
sub _atomic_memory { |
9761 |
sub _atomic_memory { |
| 9755 |
my ( $atomicupd, $upd ) = @_; |
9762 |
my ( $atomicupd, $upd ) = @_; |
|
|
9763 |
|
| 9764 |
return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref |
| 9765 |
return if !$upd && $atomicupd->{mode} eq 'TRACK'; # no reset |
| 9766 |
|
| 9756 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
9767 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
| 9757 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
9768 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
| 9758 |
} |
9769 |
} |
|
Lines 9866-9870
sub CheckVersion {
Link Here
|
| 9866 |
} |
9877 |
} |
| 9867 |
} |
9878 |
} |
| 9868 |
|
9879 |
|
| 9869 |
RunRemainingAtomicUpdates( $aupd ); |
9880 |
RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD'; |
| 9870 |
exit; |
9881 |
exit; |
| 9871 |
- |
|
|