Lines 50-55
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->preference('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, |
Lines 8838-8844
if ( CheckVersion($DBversion) ) {
Link Here
|
8838 |
# This point marks the end of the approved database revisions. |
8839 |
# This point marks the end of the approved database revisions. |
8839 |
# The following line runs proposed patches found in atomicupdate. On a |
8840 |
# The following line runs proposed patches found in atomicupdate. On a |
8840 |
# production system, it will [should] not find any. |
8841 |
# production system, it will [should] not find any. |
8841 |
RunRemainingAtomicUpdates( $aupd ); |
8842 |
RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD'; |
8842 |
|
8843 |
|
8843 |
=head1 FUNCTIONS |
8844 |
=head1 FUNCTIONS |
8844 |
|
8845 |
|
Lines 8862-8868
sub RunRemainingAtomicUpdates {
Link Here
|
8862 |
print "Skipping $upd as installed official db rev\n"; |
8863 |
print "Skipping $upd as installed official db rev\n"; |
8863 |
next; |
8864 |
next; |
8864 |
} |
8865 |
} |
8865 |
if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
8866 |
if( $atomicupd->{mode} ne 'ALWAYS' && |
|
|
8867 |
$atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
8866 |
#Skip files that have recently been applied |
8868 |
#Skip files that have recently been applied |
8867 |
#Note that an official db rev erases this list |
8869 |
#Note that an official db rev erases this list |
8868 |
print "Skipping $upd as recently applied dev update\n"; |
8870 |
print "Skipping $upd as recently applied dev update\n"; |
Lines 8920-8926
sub ExecDBRev {
Link Here
|
8920 |
print "Dev upgrade $file done\n"; |
8922 |
print "Dev upgrade $file done\n"; |
8921 |
_atomic_memory( $atomicupd, $file ) if $rv; |
8923 |
_atomic_memory( $atomicupd, $file ) if $rv; |
8922 |
} else { |
8924 |
} else { |
8923 |
_atomic_memory( $atomicupd ); #Official db rev clears the atomic pref |
8925 |
_atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref |
8924 |
SetVersion($version); |
8926 |
SetVersion($version); |
8925 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
8927 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
8926 |
} |
8928 |
} |
Lines 8928-8933
sub ExecDBRev {
Link Here
|
8928 |
|
8930 |
|
8929 |
sub _atomic_memory { |
8931 |
sub _atomic_memory { |
8930 |
my ( $atomicupd, $upd ) = @_; |
8932 |
my ( $atomicupd, $upd ) = @_; |
|
|
8933 |
|
8934 |
return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref |
8935 |
return if !$upd && $atomicupd->{mode} eq 'TRACK'; # no reset |
8936 |
|
8931 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
8937 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
8932 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
8938 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
8933 |
} |
8939 |
} |
8934 |
- |
|
|