aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2011-01-07 20:04:45 +0000
committerSimon McVittie <smcv@debian.org>2011-01-07 20:04:45 +0000
commitdff44e4a6d98cccd2b4af56397a80dc127b0242b (patch)
tree0895f47621c7457fc00ea8fb4a2c1df40882a876 /IkiWiki.pm
parent44b0cea85f1641f33ccb305f9da6f96e812b84e9 (diff)
downloadikiwiki-dff44e4a6d98cccd2b4af56397a80dc127b0242b.tar
ikiwiki-dff44e4a6d98cccd2b4af56397a80dc127b0242b.tar.gz
Add add_literal_underlay and use it for the transient underlay
This means we don't need to import Cwd and use abs_path.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm16
1 files changed, 11 insertions, 5 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;
}