[LON-CAPA-cvs] cvs: loncom /metadata_database searchcat.pl

www lon-capa-cvs@mail.lon-capa.org
Tue, 07 Oct 2003 17:51:38 -0000


www		Tue Oct  7 13:51:38 2003 EDT

  Modified files:              
    /loncom/metadata_database	searchcat.pl 
  Log:
  lonmeta.pm has a display problem, but I ran several "before/after" tests
  directly on nohist_resevaldata, and this version of searchcat.pl seems to
  work. Need to make sure we start from the backup versions of nohist_resevaldata
  and then run this version of searchcat.pl.
  
  
Index: loncom/metadata_database/searchcat.pl
diff -u loncom/metadata_database/searchcat.pl:1.40 loncom/metadata_database/searchcat.pl:1.41
--- loncom/metadata_database/searchcat.pl:1.40	Thu Sep 25 20:23:09 2003
+++ loncom/metadata_database/searchcat.pl	Tue Oct  7 13:51:38 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # searchcat.pl "Search Catalog" batch script
 #
-# $Id: searchcat.pl,v 1.40 2003/09/26 00:23:09 www Exp $
+# $Id: searchcat.pl,v 1.41 2003/10/07 17:51:38 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -138,6 +138,8 @@
        my %cnt=();
        my %listitems=('count'        => 'add',
                       'course'       => 'add',
+		      'goto'         => 'add',
+		      'comefrom'     => 'add',
                       'avetries'     => 'avg',
                       'stdno'        => 'add',
                       'difficulty'   => 'avg',
@@ -307,11 +309,11 @@
     foreach my $m (@metalist) {
         print LOG "- ".$m."\n";
         my $ref=&metadata($m);
- 	if ($ref->{'obsolete'}) { print LOG "obsolete\n"; next; }
-	if ($ref->{'copyright'} eq 'private') { print LOG "private\n"; next; }
         my $m2='/res/'.&declutter($m);
         $m2=~s/\.meta$//;
-#        &dynamicmeta($m2);
+        &dynamicmeta($m2);
+ 	if ($ref->{'obsolete'}) { print LOG "obsolete\n"; next; }
+	if ($ref->{'copyright'} eq 'private') { print LOG "private\n"; next; }
 	&count($m2);
         $delete_sth->execute($m2);
         $insert_sth->execute($ref->{'title'},
@@ -340,27 +342,10 @@
         
     # ------------------------------------------- Copy over the new db-files
     #
-    # Check the size of nohist_new_resevaldata.db compared to 
-    # nohist_resevaldata.db
-#    my @stat_result = stat($prodir.'/nohist_new_resevaldata.db');
-#    my $new_size = $stat_result[7];
-#    @stat_result = stat($prodir.'/nohist_resevaldata.db');
-#    my $old_size = $stat_result[7];
-#    if ($old_size) {
-#	if ($new_size/$old_size > 0.15 ) {
-#	    system('mv '.$prodir.'/nohist_new_resevaldata.db '.
-#		   $prodir.'/nohist_resevaldata.db');
-#	} else {
-#	    print LOG "Size of '$user' old nohist_reseval: $old_size ".
-#		"Size of new: $new_size.  Not overwriting.\n";
-#	    my $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";
-#	    my $subj="LON: $perlvar{'lonHostID'} searchcat.pl $user reseval ".
-#		"modification error.";
-#	    system("echo ".
-#		"'See /home/httpd/perl/logs/searchcat.txt for information.' ".
-#		   "| mailto $emailto -s '$subj' > /dev/null");
-#	}
-#    }   
+
+	    system('mv '.$prodir.'/nohist_new_resevaldata.db '.
+		   $prodir.'/nohist_resevaldata.db');
+
 }
 # --------------------------------------------------- Close database connection
 $dbh->disconnect;