From: Mike Taylor Date: Wed, 17 Dec 2014 15:38:23 +0000 (+0000) Subject: Back to IR-367 *sigh* X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=367903f741d94d2fa1af75702803870a9fdb2654;p=irspy-moved-to-github.git Back to IR-367 *sigh* Extend reindex.pl so that if it's asked to set UDB in a record with no databaseInfo, it makes that section. This can now be used to fix up the 35 records in the master IRSpy database that still hgave no UDBs. --- diff --git a/bin/reindex.pl b/bin/reindex.pl index 54dfa62..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:)?databaseInfo.*?>/) { - # There is an undeletable phantom record: ignore it - next; - } if ($setUdb) { - my $udb = qq[irspy-$i]; - $xml =~ s/<(e:)?databaseInfo.*?>/$&$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);