summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-11 06:07:48 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-11 06:09:34 -0400
commit4e1d7d8ff281777c53805072978d4718b8532863 (patch)
treea901c9933bfd7b014186059ce8d54aab973502a8
parent598a8ce1f7827fa18b288a1aee57967a39fcd36a (diff)
fix use ordering
The recent setup revamp exposed some latent bugs in use/package ordering that caused some symbols to not the exported into the correct scope.
-rw-r--r--IkiWiki/CGI.pm4
-rw-r--r--IkiWiki/Rcs/Stub.pm4
-rw-r--r--IkiWiki/Rcs/bzr.pm4
-rw-r--r--IkiWiki/Rcs/git.pm4
-rw-r--r--IkiWiki/Rcs/mercurial.pm4
-rw-r--r--IkiWiki/Rcs/monotone.pm5
-rw-r--r--IkiWiki/Rcs/svn.pm4
-rw-r--r--IkiWiki/Rcs/tla.pm4
-rw-r--r--IkiWiki/Setup.pm2
-rw-r--r--IkiWiki/Setup/Standard.pm6
-rw-r--r--IkiWiki/UserInfo.pm4
-rw-r--r--IkiWiki/Wrapper.pm4
12 files changed, 25 insertions, 24 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 2a847eb17..6770f6feb 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -1,5 +1,7 @@
#!/usr/bin/perl
+package IkiWiki;
+
use warnings;
use strict;
use IkiWiki;
@@ -7,8 +9,6 @@ use IkiWiki::UserInfo;
use open qw{:utf8 :std};
use Encode;
-package IkiWiki;
-
sub printheader ($) { #{{{
my $session=shift;
diff --git a/IkiWiki/Rcs/Stub.pm b/IkiWiki/Rcs/Stub.pm
index a460f29a2..6b69e65dc 100644
--- a/IkiWiki/Rcs/Stub.pm
+++ b/IkiWiki/Rcs/Stub.pm
@@ -1,12 +1,12 @@
#!/usr/bin/perl
# Stubs for no revision control.
+package IkiWiki;
+
use warnings;
use strict;
use IkiWiki;
-package IkiWiki;
-
sub rcs_update () {
# Update working directory to current version.
# (May be more complex for distributed RCS.)
diff --git a/IkiWiki/Rcs/bzr.pm b/IkiWiki/Rcs/bzr.pm
index af311fab8..0dc456de2 100644
--- a/IkiWiki/Rcs/bzr.pm
+++ b/IkiWiki/Rcs/bzr.pm
@@ -1,13 +1,13 @@
#!/usr/bin/perl
+package IkiWiki;
+
use warnings;
use strict;
use IkiWiki;
use Encode;
use open qw{:utf8 :std};
-package IkiWiki;
-
sub bzr_log ($) { #{{{
my $out = shift;
my @infos = ();
diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm
index 036900887..425536f62 100644
--- a/IkiWiki/Rcs/git.pm
+++ b/IkiWiki/Rcs/git.pm
@@ -1,13 +1,13 @@
#!/usr/bin/perl
+package IkiWiki;
+
use warnings;
use strict;
use IkiWiki;
use Encode;
use open qw{:utf8 :std};
-package IkiWiki;
-
my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums
my $dummy_commit_msg = 'dummy commit'; # message to skip in recent changes
diff --git a/IkiWiki/Rcs/mercurial.pm b/IkiWiki/Rcs/mercurial.pm
index a042f4a45..bfe6ba49c 100644
--- a/IkiWiki/Rcs/mercurial.pm
+++ b/IkiWiki/Rcs/mercurial.pm
@@ -1,13 +1,13 @@
#!/usr/bin/perl
+package IkiWiki;
+
use warnings;
use strict;
use IkiWiki;
use Encode;
use open qw{:utf8 :std};
-package IkiWiki;
-
sub mercurial_log($) {
my $out = shift;
my @infos;
diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm
index 6931fd36b..ce4a2a3ed 100644
--- a/IkiWiki/Rcs/monotone.pm
+++ b/IkiWiki/Rcs/monotone.pm
@@ -1,4 +1,7 @@
#!/usr/bin/perl
+
+package IkiWiki;
+
use warnings;
use strict;
use IkiWiki;
@@ -6,8 +9,6 @@ use Monotone;
use Date::Parse qw(str2time);
use Date::Format qw(time2str);
-package IkiWiki;
-
my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate sha1sums
sub check_config() { #{{{
diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm
index ea193e08f..6a822e896 100644
--- a/IkiWiki/Rcs/svn.pm
+++ b/IkiWiki/Rcs/svn.pm
@@ -1,12 +1,12 @@
#!/usr/bin/perl
+package IkiWiki::Rcs::svn;
+
use warnings;
use strict;
use IkiWiki;
use POSIX qw(setlocale LC_CTYPE);
-package IkiWiki::Rcs::svn;
-
sub import { #{{{
if (exists $IkiWiki::config{svnpath}) {
# code depends on the path not having extraneous slashes
diff --git a/IkiWiki/Rcs/tla.pm b/IkiWiki/Rcs/tla.pm
index 47579c15b..e7fed9ad8 100644
--- a/IkiWiki/Rcs/tla.pm
+++ b/IkiWiki/Rcs/tla.pm
@@ -1,11 +1,11 @@
#!/usr/bin/perl
+package IkiWiki;
+
use warnings;
use strict;
use IkiWiki;
-package IkiWiki;
-
sub quiet_system (@) {
# See Debian bug #385939.
open (SAVEOUT, ">&STDOUT");
diff --git a/IkiWiki/Setup.pm b/IkiWiki/Setup.pm
index a37264cd7..2b76efc16 100644
--- a/IkiWiki/Setup.pm
+++ b/IkiWiki/Setup.pm
@@ -8,9 +8,11 @@
# IkiWiki::Setup::$raw_setup, to pass it back to this module.
package IkiWiki::Setup;
+
use warnings;
use strict;
use IkiWiki;
+use IkiWiki::Wrapper;
use open qw{:utf8 :std};
our $raw_setup;
diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm
index 693c4fe60..f67c3829b 100644
--- a/IkiWiki/Setup/Standard.pm
+++ b/IkiWiki/Setup/Standard.pm
@@ -3,12 +3,10 @@
# Parameters to import should be all the standard ikiwiki config stuff,
# plus an array of wrappers to set up.
+package IkiWiki::Setup::Standard;
+
use warnings;
use strict;
-use IkiWiki::Wrapper;
-use IkiWiki::Render;
-
-package IkiWiki::Setup::Standard;
sub import {
$IkiWiki::Setup::raw_setup=$_[1];
diff --git a/IkiWiki/UserInfo.pm b/IkiWiki/UserInfo.pm
index a0b1327b4..109a6cb5f 100644
--- a/IkiWiki/UserInfo.pm
+++ b/IkiWiki/UserInfo.pm
@@ -1,12 +1,12 @@
#!/usr/bin/perl
+package IkiWiki;
+
use warnings;
use strict;
use Storable;
use IkiWiki;
-package IkiWiki;
-
sub userinfo_retrieve () { #{{{
my $userinfo=eval{ Storable::lock_retrieve("$config{wikistatedir}/userdb") };
return $userinfo;
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index d2cc0a69e..79b9eb3e3 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -1,13 +1,13 @@
#!/usr/bin/perl
+package IkiWiki;
+
use warnings;
use strict;
use Cwd q{abs_path};
use Data::Dumper;
use IkiWiki;
-package IkiWiki;
-
sub gen_wrapper () { #{{{
$config{srcdir}=abs_path($config{srcdir});
$config{destdir}=abs_path($config{destdir});