aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-03-25 14:39:09 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-03-25 14:39:09 -0400
commit3d671ea8c1df4534d8ffa59b235dd6ded99bb13f (patch)
tree32f3d7f75a7422a8c6867d93ce4c7db933624268
parentb19fb349f57e7dd9914aae728c5243dc6640026f (diff)
downloadikiwiki-3d671ea8c1df4534d8ffa59b235dd6ded99bb13f.tar
ikiwiki-3d671ea8c1df4534d8ffa59b235dd6ded99bb13f.tar.gz
filecheck: Fix bug that prevented the pagespecs from matching when not called by attachment plugin.
-rw-r--r--IkiWiki/Plugin/filecheck.pm16
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/filecheck_failing_to_find_files.mdwn5
3 files changed, 15 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm
index 0501ba99c..1549b82db 100644
--- a/IkiWiki/Plugin/filecheck.pm
+++ b/IkiWiki/Plugin/filecheck.pm
@@ -75,9 +75,9 @@ sub match_maxsize ($$;@) {
}
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) {
- return IkiWiki::ErrorReason->new("no file specified");
+ return IkiWiki::ErrorReason->new("file does not exist");
}
if (-s $file > $maxsize) {
@@ -96,9 +96,9 @@ sub match_minsize ($$;@) {
}
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) {
- return IkiWiki::ErrorReason->new("no file specified");
+ return IkiWiki::ErrorReason->new("file does not exist");
}
if (-s $file < $minsize) {
@@ -114,9 +114,9 @@ sub match_mimetype ($$;@) {
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) {
- 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
@@ -147,9 +147,9 @@ sub match_virusfree ($$;@) {
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) {
- return IkiWiki::ErrorReason->new("no file specified");
+ return IkiWiki::ErrorReason->new("file does not exist");
}
if (! exists $IkiWiki::config{virus_checker} ||
diff --git a/debian/changelog b/debian/changelog
index 12dd0dc02..7249cdfa4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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.
+ * 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
diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn
index be6cdbb20..e896f2129 100644
--- a/doc/bugs/filecheck_failing_to_find_files.mdwn
+++ b/doc/bugs/filecheck_failing_to_find_files.mdwn
@@ -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]]
+>>> 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