From 5e842de96d3f757573d02667e38056a4f5b618fc Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 13 Apr 2010 17:07:17 +0100 Subject: [PATCH] New script irspy-rewrite-records.pl that rewrites all the records in an IRSpy database, causing reliability information to be set into them. --- bin/irspy-rewrite-records.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 bin/irspy-rewrite-records.pl diff --git a/bin/irspy-rewrite-records.pl b/bin/irspy-rewrite-records.pl new file mode 100644 index 0000000..bcc58e7 --- /dev/null +++ b/bin/irspy-rewrite-records.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl -w + +# perl -I ../lib irspy-rewrite-records.pl localhost:8018/IR-Explain---1 + +use strict; +use warnings; +use ZOOM::IRSpy; +use ZOOM::IRSpy::Utils qw(render_record); + +my($dbname) = @ARGV; +die "$0 no database name specified" if !defined $dbname; +my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat"); +my $rs = $spy->{conn}->search(new ZOOM::Query::CQL("cql.allRecords=1")); +print STDERR "rewriting ", $rs->size(), " target records"; + +foreach my $i (1 .. $rs->size()) { + my $xml = render_record($rs, $i-1, "zeerex"); + my $rec = $spy->{libxml}->parse_string($xml)->documentElement(); + ZOOM::IRSpy::_rewrite_zeerex_record($spy->{conn}, $rec); + print STDERR "."; +} +print STDERR "\nDone\n"; -- 1.7.10.4