]> git.cworth.org Git - ikiwiki-bootstrap/commitdiff
Add a BEGIN block so that the gitrepo and checkout variables actually work
authorCarl Worth <cworth@cworth.org>
Fri, 15 Jun 2007 17:18:12 +0000 (10:18 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 15 Jun 2007 17:18:12 +0000 (10:18 -0700)
The trick here is that the hash containing configuration settings is
being passed to a perl module's import method with a use statement.
That use statement includes an implicit BEGIN statement which makes
the import function get called at compile-time. So our settings for
gitrepo and checkout don't take effect unless we also put them in
their own BEGIN block.

ikiwiki.setup

index 180bb8e1b3b69d58c7657cce40dd954c0ff76b03..2e417179b02317a21ddde985f9ab1bf2935744e0 100644 (file)
 # Also, see the destdir and url parameters below which must also be
 # configured before things will work at all.
 
 # Also, see the destdir and url parameters below which must also be
 # configured before things will work at all.
 
-my gitrepo = '/path/to/bare/git/repo';
-my checkout = "$gitrepo/ikiwiki-checkout";
+our ($gitrepo, $checkout);
+
+BEGIN {
+       $gitrepo = '/path/to/bare/git/repo';
+       $checkout = "$gitrepo/ikiwiki-checkout";
+}
 
 use IkiWiki::Setup::Standard {
 
 
 use IkiWiki::Setup::Standard {