From 1532f02c0332e7b52515f8f1ed77c1a367720434 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 16 Dec 2010 22:27:52 +0000 Subject: [PATCH] Rename --- bin/irspy-delete-broken-records.pl | 31 ------------------------------- bin/zoom-delete-records.pl | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) delete mode 100755 bin/irspy-delete-broken-records.pl create mode 100755 bin/zoom-delete-records.pl diff --git a/bin/irspy-delete-broken-records.pl b/bin/irspy-delete-broken-records.pl deleted file mode 100755 index f6d5a67..0000000 --- a/bin/irspy-delete-broken-records.pl +++ /dev/null @@ -1,31 +0,0 @@ -#!/opt/local/bin/perl -# -# ./irspy-delete-broken-records.pl user=admin,password=fruitbat,localhost:8018/IR-Explain---1 'concat(count(irspy:status/irspy:probe[@ok=1]), "/", count(irspy:status/irspy:probe))' 'count(irspy:status/irspy:probe[@ok=1]) = 0 and count(irspy:status/irspy:probe) >= 10' - -use lib '../lib'; -use XML::LibXML; -use ZOOM; -use strict; -use warnings; - -die "Usage: $0 \n" if @ARGV != 3; -my($dbname, $displayXPath, $deleteXPath) = @ARGV; - -my $libxml = new XML::LibXML; -my $conn = new ZOOM::Connection($dbname); -my $rs = $conn->search(new ZOOM::Query::CQL("cql.allRecords=1")); -$rs->option(elementSetName => "zeerex"); - -my $n = $rs->size(); -foreach my $i (1 .. $n) { - my $xml = $rs->record($i-1)->render(); - my $rec = $libxml->parse_string($xml)->documentElement(); - my $xc = XML::LibXML::XPathContext->new($rec); - $xc->registerNs(zeerex => "http://explain.z3950.org/dtd/2.0/"); - $xc->registerNs(irspy => "http://indexdata.com/irspy/1.0"); - my $val = $xc->findvalue($displayXPath); - print "Record $i/$n: $val"; - $val = $xc->findvalue($deleteXPath); - print " DELETE" if $val eq "true"; - print "\n"; -} diff --git a/bin/zoom-delete-records.pl b/bin/zoom-delete-records.pl new file mode 100755 index 0000000..f6d5a67 --- /dev/null +++ b/bin/zoom-delete-records.pl @@ -0,0 +1,31 @@ +#!/opt/local/bin/perl +# +# ./irspy-delete-broken-records.pl user=admin,password=fruitbat,localhost:8018/IR-Explain---1 'concat(count(irspy:status/irspy:probe[@ok=1]), "/", count(irspy:status/irspy:probe))' 'count(irspy:status/irspy:probe[@ok=1]) = 0 and count(irspy:status/irspy:probe) >= 10' + +use lib '../lib'; +use XML::LibXML; +use ZOOM; +use strict; +use warnings; + +die "Usage: $0 \n" if @ARGV != 3; +my($dbname, $displayXPath, $deleteXPath) = @ARGV; + +my $libxml = new XML::LibXML; +my $conn = new ZOOM::Connection($dbname); +my $rs = $conn->search(new ZOOM::Query::CQL("cql.allRecords=1")); +$rs->option(elementSetName => "zeerex"); + +my $n = $rs->size(); +foreach my $i (1 .. $n) { + my $xml = $rs->record($i-1)->render(); + my $rec = $libxml->parse_string($xml)->documentElement(); + my $xc = XML::LibXML::XPathContext->new($rec); + $xc->registerNs(zeerex => "http://explain.z3950.org/dtd/2.0/"); + $xc->registerNs(irspy => "http://indexdata.com/irspy/1.0"); + my $val = $xc->findvalue($displayXPath); + print "Record $i/$n: $val"; + $val = $xc->findvalue($deleteXPath); + print " DELETE" if $val eq "true"; + print "\n"; +} -- 1.7.10.4