projects
/
koha-eprints
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
generate tsv with biblionumber -> eprintid mapping
[koha-eprints]
/
ffzg-search.pl
diff --git
a/ffzg-search.pl
b/ffzg-search.pl
index
553842c
..
8e3f77f
100755
(executable)
--- a/
ffzg-search.pl
+++ b/
ffzg-search.pl
@@
-11,10
+11,13
@@
use Storable;
use EPrints;
use EPrints;
+my $repository_name = shift @ARGV || 'ffzg';
+warn "# repository name: $repository_name";
+
my $stat;
my $ep = EPrints->new();
my $stat;
my $ep = EPrints->new();
-my $repo = $ep->repository(
'ffzg'
);
+my $repo = $ep->repository(
$repository_name
);
#$repo->{config}->{enable_file_imports} = 1;
#$repo->{config}->{enable_web_imports} = 1;
my $dataset = $repo->dataset( 'eprint' );
#$repo->{config}->{enable_file_imports} = 1;
#$repo->{config}->{enable_web_imports} = 1;
my $dataset = $repo->dataset( 'eprint' );
@@
-26,6
+29,8
@@
warn ref( $list );
warn "# ids = ",dump( $list->ids );
warn "# ids = ",dump( $list->ids );
+open(my $tsv_fh, '>', "/tmp/$repository_name.biblionumber.eprintid");
+
my $info = { count => 0 };
$list->map( sub {
my( $session, $dataset, $eprint, $info ) = @_;
my $info = { count => 0 };
$list->map( sub {
my( $session, $dataset, $eprint, $info ) = @_;
@@
-35,6
+40,9
@@
$list->map( sub {
if ($#{ $info->{biblionumber}->{$biblionumber} } >= 1 ) {
$eprint->delete;
warn "# DELETE duplicate $biblionumber ", $eprint->id;
if ($#{ $info->{biblionumber}->{$biblionumber} } >= 1 ) {
$eprint->delete;
warn "# DELETE duplicate $biblionumber ", $eprint->id;
+ } else {
+ print $tsv_fh "$biblionumber\t", $eprint->id, "\n";
+ $info->{have_biblionumber}++;
}
} else {
$info->{no_biblionumber}++;
}
} else {
$info->{no_biblionumber}++;
@@
-45,3
+53,5
@@
$list->map( sub {
warn "# map info ",dump( $info );
warn "# stat ", dump($stat);
warn "# map info ",dump( $info );
warn "# stat ", dump($stat);
+
+system "ls -alt /tmp/$repository_name*";