X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=bin%2Freindex.pl;h=9328c72ce86877d57b3c50db332ed40a9db2949b;hp=36fa799ef7f5b6a920980f060f580a87f0ec81ac;hb=bede31050ee10e9a8a3dd20f91ab9d62e0f5af66;hpb=74fb413c94ff739130cbe59e20467ab2a5a598c6 diff --git a/bin/reindex.pl b/bin/reindex.pl index 36fa799..9328c72 100755 --- a/bin/reindex.pl +++ b/bin/reindex.pl @@ -36,14 +36,17 @@ foreach my $i (1..$n) { print " $i/$n (", int($i*100/$n), "%)\n" if $i % 50 == 0; my $rec = $rs->record($i-1); my $xml = $rec->render(); - if ($xml !~ /<\/(e:)?host>/) { - # There is an undeletable phantom record: ignore it - next; - } if ($setUdb) { - my $udb = qq[irspy-$i]; - $xml =~ s/<\/(e:)?host>/$1$udb/; + my $udb; + if ($xml !~ /<(e:)?databaseInfo.*?>/) { + $udb = qq[irspy-a$i]; + $xml =~ s/\/serverInfo>/$&$udb<\/databaseInfo>/; + print "x"; + } else { + $udb = qq[irspy-$i]; + $xml =~ s/<(e:)?databaseInfo.*?>/$&$udb/; + } } update($conn, $xml);