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 8818-8824
if ( CheckVersion($DBversion) ) {
Link Here
|
8818 |
# This point marks the end of the approved database revisions. |
8819 |
# This point marks the end of the approved database revisions. |
8819 |
# The following line runs proposed patches found in atomicupdate. On a |
8820 |
# The following line runs proposed patches found in atomicupdate. On a |
8820 |
# production system, it will [should] not find any. |
8821 |
# production system, it will [should] not find any. |
8821 |
RunRemainingAtomicUpdates( $aupd ); |
8822 |
RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD'; |
8822 |
|
8823 |
|
8823 |
=head1 FUNCTIONS |
8824 |
=head1 FUNCTIONS |
8824 |
|
8825 |
|
Lines 8842-8848
sub RunRemainingAtomicUpdates {
Link Here
|
8842 |
print "Skipping $upd as installed official db rev\n"; |
8843 |
print "Skipping $upd as installed official db rev\n"; |
8843 |
next; |
8844 |
next; |
8844 |
} |
8845 |
} |
8845 |
if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
8846 |
if( $atomicupd->{mode} ne 'ALWAYS' && |
|
|
8847 |
$atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
8846 |
#Skip files that have recently been applied |
8848 |
#Skip files that have recently been applied |
8847 |
#Note that an official db rev erases this list |
8849 |
#Note that an official db rev erases this list |
8848 |
print "Skipping $upd as recently applied dev update\n"; |
8850 |
print "Skipping $upd as recently applied dev update\n"; |
Lines 8900-8906
sub ExecDBRev {
Link Here
|
8900 |
print "Dev upgrade $file done\n"; |
8902 |
print "Dev upgrade $file done\n"; |
8901 |
_atomic_memory( $atomicupd, $file ) if $rv; |
8903 |
_atomic_memory( $atomicupd, $file ) if $rv; |
8902 |
} else { |
8904 |
} else { |
8903 |
_atomic_memory( $atomicupd ); #Official db rev clears the atomic pref |
8905 |
_atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref |
8904 |
SetVersion($version); |
8906 |
SetVersion($version); |
8905 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
8907 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
8906 |
} |
8908 |
} |
Lines 8908-8913
sub ExecDBRev {
Link Here
|
8908 |
|
8910 |
|
8909 |
sub _atomic_memory { |
8911 |
sub _atomic_memory { |
8910 |
my ( $atomicupd, $upd ) = @_; |
8912 |
my ( $atomicupd, $upd ) = @_; |
|
|
8913 |
|
8914 |
return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref |
8915 |
return if !$upd && $atomicupd->{mode} eq 'TRACK'; # no reset |
8916 |
|
8911 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
8917 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
8912 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
8918 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
8913 |
} |
8919 |
} |
8914 |
- |
|
|