koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/misc/cronjobs build_tags.pl [rel_3_0]


From: paul poulain
Subject: [Koha-cvs] koha/misc/cronjobs build_tags.pl [rel_3_0]
Date: Thu, 11 Jan 2007 14:36:28 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     paul poulain <tipaul>   07/01/11 14:36:28

Removed files:
        misc/cronjobs  : build_tags.pl 

Log message:
        useless : replaced by build_browser_and_tag.pl script

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/misc/cronjobs/build_tags.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.1&r2=0

Patches:
Index: build_tags.pl
===================================================================
RCS file: build_tags.pl
diff -N build_tags.pl
--- build_tags.pl       20 Dec 2006 10:39:23 -0000      1.1.2.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,93 +0,0 @@
-#!/usr/bin/perl
-# small script that rebuilds the non-MARC DB
-
-use strict;
-
-# Koha modules used
-# use MARC::File::USMARC;
-# use MARC::Record;
-# use MARC::Batch;
-use C4::Koha;
-use C4::Context;
-use C4::Biblio;
-use Date::Calc;
-use Time::HiRes qw(gettimeofday);
-use ZOOM;
-use MARC::File::USMARC;
-use Getopt::Long;
-my ( $input_marc_file, $number) = ('',0);
-my ($version, $confirm,$test_parameter);
-GetOptions(
-       'c' => \$confirm,
-       'h' => \$version,
-       't' => \$test_parameter,
-);
-
-if ($version || (!$confirm)) {
-       print <<EOF
-    TO BE WRITTEN
-EOF
-;
-die;
-}
-
-##################################
-#
-# MAIN PARAMETERS
-#
-###################################
-
-my $tag = '606';
-my $subfield = 'a';
-
-my $verbose = 0;
-
-my $dbh = C4::Context->dbh;
-my $starttime = time();
-
-my $i=0;
-$|=1; # flushes output
-my $starttime = gettimeofday;
-
-##################################
-#
-# Parse all the database.
-#
-###################################
-#FIXME : could be improved to get directly only biblios that have to be 
updated.
-
-my $sth = $dbh->prepare("select biblionumber from biblioitems");
-$sth->execute;
-my %result;
-while ((my ($biblionumber)= $sth->fetchrow)) {
-    $i++;
-    print ".";
-    #now, parse the record, extract the item fields, and store them in 
somewhere else.
-    my $Koharecord = GetMarcBiblio($biblionumber);
-#     warn $Koharecord->as_formatted;
-    foreach ($Koharecord->field($tag)) {
-        my $line;
-        foreach ($_->subfields()) {
-            next if $_->[0]=~ /\d/;
-            $line .= $_->[1].' -- ';
-        }
-        $line =~ s/ -- $//;
-        $result{$line}++;
-    }
-       my $timeneeded = gettimeofday - $starttime;
-       print "$i in $timeneeded s\n" unless ($i % 50);
-}
-# use Data::Dumper;
-# print "==> ".Dumper(%result);
-# die;
-
-$dbh->do("truncate tags");
-my $sth = $dbh->prepare("insert into tags (entry,weight) values (?,?)");
-foreach (keys %result) {
-#     warn "insert";
-    $sth->execute($_,$result{$_});
-}
-
-# $dbh->do("unlock tables");
-my $timeneeded = time() - $starttime;
-print "$i MARC record done in $timeneeded seconds\n";




reply via email to

[Prev in Thread] Current Thread [Next in Thread]