--- trunk/perl/scripts/est-spider 2005/09/17 23:43:20 28
+++ trunk/perl/scripts/est-spider 2005/09/17 23:55:09 29
@@ -18,6 +18,7 @@
#$verbose = 1;
my $debug = 0;
+my $force = 0;
my $result = GetOptions(
"collection=s" => \$collection,
@@ -26,6 +27,7 @@
"debug!" => \$debug,
"exclude=s" => \$exclude,
"node=s" => \$node_url,
+ "force!" => \$force,
);
my $dir = shift @ARGV || die "usage: $0 [dir]";
@@ -99,7 +101,7 @@
# create a document object
my $doc = HyperEstraier::Document->new;
- my $title = $1 if ($contents =~ m#
(.+)#is);
+ my $title = $1 if ($contents =~ m#(.+?)#is);
# chop long titles to 100 chars
$title = substr($title, 0, 100) . '...' if ($title && length($title) > 100);
@@ -134,14 +136,14 @@
my $path = $_;
my $contents;
- return if (-l $path || $path =~ m#/.svn# || $path =~ m/(~|.bak)$/);
+ return if (! $force && -l $path || $path =~ m#/.svn# || $path =~ m/(~|.bak)$/);
my $mtime = (stat($path))[9];
my $mtime_db = $db->get_doc_attr_by_uri("file:///$path", '@mtime') || -2;
if ($mtime == $mtime_db) {
print STDERR "# same: $path $mtime\n" if ($verbose);
- return;
+ return unless($force);
} else {
print STDERR "# changed: $path $mtime != $mtime_db\n" if ($debug);
}