|
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 8856-8862
if ( CheckVersion($DBversion) ) {
Link Here
|
| 8856 |
# This point marks the end of the approved database revisions. |
8857 |
# This point marks the end of the approved database revisions. |
| 8857 |
# The following line runs proposed patches found in atomicupdate. On a |
8858 |
# The following line runs proposed patches found in atomicupdate. On a |
| 8858 |
# production system, it will [should] not find any. |
8859 |
# production system, it will [should] not find any. |
| 8859 |
RunRemainingAtomicUpdates( $aupd ); |
8860 |
RunRemainingAtomicUpdates( $aupd ) if $aupd->{mode} ne 'PROD'; |
| 8860 |
|
8861 |
|
| 8861 |
=head1 FUNCTIONS |
8862 |
=head1 FUNCTIONS |
| 8862 |
|
8863 |
|
|
Lines 8880-8886
sub RunRemainingAtomicUpdates {
Link Here
|
| 8880 |
print "Skipping $upd as installed official db rev\n"; |
8881 |
print "Skipping $upd as installed official db rev\n"; |
| 8881 |
next; |
8882 |
next; |
| 8882 |
} |
8883 |
} |
| 8883 |
if( $atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
8884 |
if( $atomicupd->{mode} ne 'ALWAYS' && |
|
|
8885 |
$atomicupd->{remember} =~ /(^|;)$upd;/ ) { |
| 8884 |
#Skip files that have recently been applied |
8886 |
#Skip files that have recently been applied |
| 8885 |
#Note that an official db rev erases this list |
8887 |
#Note that an official db rev erases this list |
| 8886 |
print "Skipping $upd as recently applied dev update\n"; |
8888 |
print "Skipping $upd as recently applied dev update\n"; |
|
Lines 8938-8944
sub ExecDBRev {
Link Here
|
| 8938 |
print "Dev upgrade $file done\n"; |
8940 |
print "Dev upgrade $file done\n"; |
| 8939 |
_atomic_memory( $atomicupd, $file ) if $rv; |
8941 |
_atomic_memory( $atomicupd, $file ) if $rv; |
| 8940 |
} else { |
8942 |
} else { |
| 8941 |
_atomic_memory( $atomicupd ); #Official db rev clears the atomic pref |
8943 |
_atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref |
| 8942 |
SetVersion($version); |
8944 |
SetVersion($version); |
| 8943 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
8945 |
print "Upgrade to $version done (Bug $bugno - $descr)\n"; |
| 8944 |
} |
8946 |
} |
|
Lines 8946-8951
sub ExecDBRev {
Link Here
|
| 8946 |
|
8948 |
|
| 8947 |
sub _atomic_memory { |
8949 |
sub _atomic_memory { |
| 8948 |
my ( $atomicupd, $upd ) = @_; |
8950 |
my ( $atomicupd, $upd ) = @_; |
|
|
8951 |
|
| 8952 |
return if $atomicupd->{mode} eq 'ALWAYS'; # ignores the pref |
| 8953 |
return if !$upd && $atomicupd->{mode} eq 'TRACK'; # no reset |
| 8954 |
|
| 8949 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
8955 |
$atomicupd->{remember}= $upd? $atomicupd->{remember}."$upd;": ''; |
| 8950 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
8956 |
C4::Context->set_preference( ATOMICUPD_PREF, $atomicupd->{remember} ); |
| 8951 |
} |
8957 |
} |
| 8952 |
- |
|
|