projects
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
578a487
)
add_underlay: avoid adding the same underlay twice
author
Joey Hess
<joey@kodama.kitenet.net>
Fri, 17 Oct 2008 23:53:04 +0000
(19:53 -0400)
committer
Joey Hess
<joey@kodama.kitenet.net>
Fri, 17 Oct 2008 23:53:04 +0000
(19:53 -0400)
IkiWiki.pm
patch
|
blob
|
history
diff --git
a/IkiWiki.pm
b/IkiWiki.pm
index 633c5138180a9f87f4a974bef3322492c1d08ada..edee8aacb707e93081b1dfdec7a21a1f04e361bb 100644
(file)
--- a/
IkiWiki.pm
+++ b/
IkiWiki.pm
@@
-681,11
+681,12
@@
sub srcfile ($;$) { #{{{
sub add_underlay ($) { #{{{
my $dir=shift;
- if ($dir
=~
/^\//) {
-
unshift @{$config{underlaydirs}}, $dir
;
+ if ($dir
!~
/^\//) {
+
$dir="$config{underlaydir}/../$dir"
;
}
- else {
- unshift @{$config{underlaydirs}}, "$config{underlaydir}/../$dir";
+
+ if (! grep { $_ eq $dir } @{$config{underlaydirs}}) {
+ unshift @{$config{underlaydirs}}, $dir;
}
return 1;