]> sipb.mit.edu Git - ikiwiki.git/commitdiff
filecheck: Fix bug that prevented the pagespecs from matching when not called by...
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 25 Mar 2010 18:39:09 +0000 (14:39 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 25 Mar 2010 18:39:09 +0000 (14:39 -0400)
IkiWiki/Plugin/filecheck.pm
debian/changelog
doc/bugs/filecheck_failing_to_find_files.mdwn

index 0501ba99cb3e0a13c4b8a73204ee28bfeb785849..1549b82db75a9d5164c04b166a3d6d149bdb01dc 100644 (file)
@@ -75,9 +75,9 @@ sub match_maxsize ($$;@) {
        }
 
        my %params=@_;
        }
 
        my %params=@_;
-       my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page};
+       my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page});
        if (! defined $file) {
        if (! defined $file) {
-               return IkiWiki::ErrorReason->new("no file specified");
+               return IkiWiki::ErrorReason->new("file does not exist");
        }
 
        if (-s $file > $maxsize) {
        }
 
        if (-s $file > $maxsize) {
@@ -96,9 +96,9 @@ sub match_minsize ($$;@) {
        }
 
        my %params=@_;
        }
 
        my %params=@_;
-       my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page};
+       my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page});
        if (! defined $file) {
        if (! defined $file) {
-               return IkiWiki::ErrorReason->new("no file specified");
+               return IkiWiki::ErrorReason->new("file does not exist");
        }
 
        if (-s $file < $minsize) {
        }
 
        if (-s $file < $minsize) {
@@ -114,9 +114,9 @@ sub match_mimetype ($$;@) {
        my $wanted=shift;
 
        my %params=@_;
        my $wanted=shift;
 
        my %params=@_;
-       my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page};
+       my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page});
        if (! defined $file) {
        if (! defined $file) {
-               return IkiWiki::ErrorReason->new("no file specified");
+               return IkiWiki::ErrorReason->new("file does not exist");
        }
 
        # Use ::magic to get the mime type, the idea is to only trust
        }
 
        # Use ::magic to get the mime type, the idea is to only trust
@@ -147,9 +147,9 @@ sub match_virusfree ($$;@) {
        my $wanted=shift;
 
        my %params=@_;
        my $wanted=shift;
 
        my %params=@_;
-       my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page};
+       my $file=exists $params{file} ? $params{file} : IkiWiki::srcfile($IkiWiki::pagesources{$page});
        if (! defined $file) {
        if (! defined $file) {
-               return IkiWiki::ErrorReason->new("no file specified");
+               return IkiWiki::ErrorReason->new("file does not exist");
        }
 
        if (! exists $IkiWiki::config{virus_checker} ||
        }
 
        if (! exists $IkiWiki::config{virus_checker} ||
index 12dd0dc02bcc66b15afa04dafb5986cb70fb5965..7249cdfa49c9a2e9839efb53df9a7c300e2c926a 100644 (file)
@@ -15,6 +15,8 @@ ikiwiki (3.20100324) UNRELEASED; urgency=low
   * Allow wrappers to be built using tcc.
   * Add support for setup files written in YAML.
   * Add --set-yaml switch for setting more complex config file options.
   * Allow wrappers to be built using tcc.
   * Add support for setup files written in YAML.
   * Add --set-yaml switch for setting more complex config file options.
+  * filecheck: Fix bug that prevented the pagespecs from matching when
+    not called by attachment plugin.
 
  -- Joey Hess <joeyh@debian.org>  Sat, 13 Mar 2010 14:48:10 -0500
 
 
  -- Joey Hess <joeyh@debian.org>  Sat, 13 Mar 2010 14:48:10 -0500
 
index be6cdbb204931a2aa17310b969cf5ad35d34ff43..e896f2129d603e88b9667136d14ac1c1e4914962 100644 (file)
@@ -10,6 +10,11 @@ It turns out that the filecheck plugin couldn't find the file, because it was me
 >> But if it is given `/path/to/srcdir/foo/bar.gif` instead, then it *can* find the file, and returns the mime-type correctly.
 >> --[[KathrynAndersen]]
 
 >> But if it is given `/path/to/srcdir/foo/bar.gif` instead, then it *can* find the file, and returns the mime-type correctly.
 >> --[[KathrynAndersen]]
 
+>>> Ok, so it's not removal specific, can in fact be triggered by using
+>>> testpagespec (or really anything besides attachment, which passes
+>>> the filename parameter). Nor is it limited to mimetype, all the tests in 
+>>> filecheck have the problem. [[Fixed|done]] --[[Joey]] 
+
 The following patch fixes the problem:
 
        diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm
 The following patch fixes the problem:
 
        diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm