--- trunk/make_config.pl 2004/03/17 12:19:42 66 +++ trunk/make_config.pl 2004/03/17 12:22:26 67 @@ -17,7 +17,7 @@ my $title = join(" ",@ARGV); if (!$name || !$url) { - print "Usage: $0 [--stripurl=path] name URL title\n"; + print "Usage: $0 [--stripurl=path] name URL|path title\n"; exit; } @@ -37,6 +37,9 @@ } else { $stripurl = $host; } +} elsif (-d $url && $url =~ m#.+?(/references/)#) { + $stripurl = $1; + $host = ""; } else { print "Can't parse URL $url into host and path!\n"; exit 1; @@ -45,20 +48,29 @@ my $baseurl = $url; $baseurl =~ s#/[^/]+$#/#g; -print "Config name: $name\nCrawling url: $url [strip $stripurl]\n"; +print "Config name: $name\nCrawling: $url [strip $stripurl]\n"; print "Title: $title\n" if ($title); - -my $config = <<"EOF"; - -################################################### +my $indexer_config = << "EOF"; IncludeConfigFile $dir/common.config # this is a cludge to implement no parent URL feature in swish indexer IndexDir "$baseurl $url" ReplaceRules replace "$baseurl " "" ReplaceRules replace "${stripurl}" "" +EOF +$indexer_config = << "EOF" if (-d $url); +IncludeConfigFile $dir/common-progspider.config +IndexDir $dir/spider/progspider +SwishProgParameters $url +ReplaceRules replace "/rest/references/" "/" +EOF + +my $config = <<"EOF"; + +################################################### +$indexer_config IndexFile $dir/index/$name StoreDescription HTML 500