version 1.2, 2006/06/16 19:38:10
|
version 1.6, 2024/07/08 22:06:15
|
Line 1
|
Line 1
|
<!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" |
<!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" |
"http://lpml.sourceforge.net/DTD/piml.dtd"> |
"http://lpml.sourceforge.net/DTD/piml.dtd"> |
<!-- accesscount_seed.piml --> |
<!-- update_queue_slots.piml --> |
<!-- Matthew Hall --> |
<!-- Matthew Hall --> |
|
|
<!-- $Id$ --> |
<!-- $Id$ --> |
Line 80 sub process_gradingqueue_file {
|
Line 80 sub process_gradingqueue_file {
|
my $backup = "\b"x(8+$count2+14+$count+6); |
my $backup = "\b"x(8+$count2+14+$count+6); |
$updated++; |
$updated++; |
print($backup."Updated $last directories, $updated files"); |
print($backup."Updated $last directories, $updated files"); |
my $prefix = $_; |
my $db = &LONCAPA::locking_hash_tie($_,&GDBM_WRCREAT()); |
$prefix =~s/\.db$//; |
|
my $db = &LONCAPA::_locking_hash_tie($prefix,'nohist_',&GDBM_WRCREAT()); |
|
if ($type eq 'queue') { |
if ($type eq 'queue') { |
foreach my $key (keys(%{$db})) { |
foreach my $key (keys(%{$db})) { |
my $real_key = &unescape($key); |
my $real_key = &unescape($key); |
Line 128 sub process_gradingqueue_file {
|
Line 126 sub process_gradingqueue_file {
|
} else { |
} else { |
print("$type unsupported\n"); |
print("$type unsupported\n"); |
} |
} |
&untie_user_hash($db); |
&LONCAPA::locking_hash_untie($db); |
|
|
} |
} |
|
|
|
|
sub main { |
sub main { |
print("Updating grading queue and slot definitions\n"); |
my $doupdate; |
my $perlvar=LONCAPA::Configuration::read_conf('loncapa.conf'); |
if (-e '/etc/loncapa-release') { |
find( |
if (open(PIPE,"cat /etc/loncapa-release.prev |grep '^LON-CAPA release' |")) { |
{ |
if (<PIPE> =~ /^\QLON-CAPA release \E(CVS_HEAD|\d+\.\d+\.\d+\.?\w*)\-\d+$/) { |
no_chdir => 1, |
my $previous = $1; |
wanted => \&process_gradingqueue_file, |
unless ($previous eq 'CVS_HEAD') { |
}, |
my ($major,$minor) = ($previous =~ /^(\d+)\.(\d+)\./); |
$perlvar->{'lonUsersDir'}); |
if (($major ne '') && ($minor ne '')) { |
print("\n"); |
if (($major == 2) && ($minor < 10)) { |
|
$doupdate = 1; |
|
} |
|
} |
|
} |
|
} |
|
close(PIPE); |
|
} |
|
} |
|
|
|
if ($doupdate) { |
|
print("Updating grading queue and slot definitions\n"); |
|
my $perlvar=LONCAPA::Configuration::read_conf('loncapa.conf'); |
|
find( |
|
{ |
|
no_chdir => 1, |
|
wanted => \&process_gradingqueue_file, |
|
}, |
|
$perlvar->{'lonUsersDir'}); |
|
print("\n"); |
|
} else { |
|
print("Update of grading queue and slot definitions not required.\n"); |
|
} |
} |
} |
|
|
&main(); |
&main(); |