--- loncom/metadata_database/searchcat.pl 2001/04/16 13:16:10 1.9 +++ loncom/metadata_database/searchcat.pl 2001/04/16 13:48:14 1.12 @@ -18,7 +18,7 @@ require "find.pl"; sub wanted { (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _ && - /^.*\.meta$/ && !/^.+\.\d+\.[^\.]+\.meta$/ + /^.*\.meta$/ && !/^.+\.\d+\.[^\.]+\.meta$/ && push(@metalist,"$dir/$_"); } @@ -57,16 +57,17 @@ foreach my $user (@homeusers) { # -- process each file to get metadata and put into search catalog SQL database # Also, check to see if already there. -# I could not search first and just delete, but this works for now. +# I could just delete (without searching first), but this works for now. foreach my $m (@metalist) { my $ref=&metadata($m); - my $m2=&declutter($m); - my $q2="select * from metadata where url like '$m2'"; + my $m2='/res/'.&declutter($m); + $m2=~s/\.meta$//; + my $q2="select * from metadata where url like binary '$m2'"; my $sth = $dbh->prepare($q2); $sth->execute(); my $r1=$sth->fetchall_arrayref; if (@$r1) { - $sth=$dbh->prepare("delete from metadata where url like '$m2'"); + $sth=$dbh->prepare("delete from metadata where url like binary '$m2'"); $sth->execute(); } $sth=$dbh->prepare('insert into metadata values ('.