You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jh...@apache.org on 2021/02/20 23:56:17 UTC
svn commit: r1886729 - in /spamassassin/trunk/masses/rule-qa:
get-rulemetadata-for-revision import-logs
Author: jhardin
Date: Sat Feb 20 23:56:16 2021
New Revision: 1886729
URL: http://svn.apache.org/viewvc?rev=1886729&view=rev
Log:
Path and logic fixes for new masscheck VM
Modified:
spamassassin/trunk/masses/rule-qa/get-rulemetadata-for-revision
spamassassin/trunk/masses/rule-qa/import-logs
Modified: spamassassin/trunk/masses/rule-qa/get-rulemetadata-for-revision
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/get-rulemetadata-for-revision?rev=1886729&r1=1886728&r2=1886729&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/get-rulemetadata-for-revision (original)
+++ spamassassin/trunk/masses/rule-qa/get-rulemetadata-for-revision Sat Feb 20 23:56:16 2021
@@ -1,4 +1,4 @@
-#!/local/perl586/bin/perl
+#!/usr/bin/perl
# get-rulemetadata-for-revision -- find out metadata for a given
# rule revision, and store it in the filesystem for later access
Modified: spamassassin/trunk/masses/rule-qa/import-logs
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/rule-qa/import-logs?rev=1886729&r1=1886728&r2=1886729&view=diff
==============================================================================
--- spamassassin/trunk/masses/rule-qa/import-logs (original)
+++ spamassassin/trunk/masses/rule-qa/import-logs Sat Feb 20 23:56:16 2021
@@ -87,14 +87,19 @@ sub locate_and_link {
my @files = sort readdir(CORPUS);
closedir(CORPUS);
+ warn "found ", $#files + 1, " files in $opt_dir";
+
@files = grep {
- /^(?:spam|ham)-(?:net-)?[-\w]+\.log$/ && -f "$opt_dir/$_" && -M _ < 30
+ /^(?:spam|ham)-(?:net-)?[-\w.]+\.log$/ && -f "$opt_dir/$_" && -M _ < 30
} @files;
+ warn "kept ", $#files + 1, " files";
+
foreach my $file (@files) {
my $ftime;
my $frevision;
+ warn "Processing $opt_dir/$file\n";
open(FILE, "$opt_dir/$file") or warn "cannot read $opt_dir/$file";
while (my $line = <FILE>) {
last if $line !~ /^#/;
@@ -145,6 +150,8 @@ sub link_file {
print "ln $f $t\n";
(-f $t) and unlink $t;
- link $f, $t or die "cannot ln"; # preserves modtimes
+ # cannot hardlink unless we have ownership or RW perms on the file
+ symlink $f, $t or die "cannot ln";
+ system "/usr/bin/touch -h -r '$f' '$t'"; # preserve modtimes
}