summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki.pm16
-rw-r--r--IkiWiki/Plugin/transient.pm8
2 files changed, 15 insertions, 9 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 799236f35..7d1f5c401 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -810,17 +810,23 @@ sub srcfile ($;$) {
return (srcfile_stat(@_))[0];
}
-sub add_underlay ($) {
+sub add_literal_underlay ($) {
my $dir=shift;
- if ($dir !~ /^\//) {
- $dir="$config{underlaydirbase}/$dir";
- }
-
if (! grep { $_ eq $dir } @{$config{underlaydirs}}) {
unshift @{$config{underlaydirs}}, $dir;
}
+}
+
+sub add_underlay ($) {
+ my $dir = shift;
+
+ if ($dir !~ /^\//) {
+ $dir="$config{underlaydirbase}/$dir";
+ }
+ add_literal_underlay($dir);
+ # why does it return 1? we just don't know
return 1;
}
diff --git a/IkiWiki/Plugin/transient.pm b/IkiWiki/Plugin/transient.pm
index c482b8552..9811aa010 100644
--- a/IkiWiki/Plugin/transient.pm
+++ b/IkiWiki/Plugin/transient.pm
@@ -25,10 +25,10 @@ sub getsetup () {
our $transientdir;
sub checkconfig () {
- eval q{use Cwd 'abs_path'};
- error($@) if $@;
- $transientdir = abs_path($config{wikistatedir})."/transient";
- add_underlay($transientdir);
+ $transientdir = $config{wikistatedir}."/transient";
+ # add_underlay treats relative underlays as relative to the installed
+ # location, not the cwd. That's not what we want here.
+ IkiWiki::add_literal_underlay($transientdir);
}
sub change (@) {