]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Silence "used only once: possible typo" warnings for variables that are part of modul...
authorSimon McVittie <smcv@debian.org>
Mon, 18 Jan 2016 08:45:18 +0000 (08:45 +0000)
committerSimon McVittie <smcv@debian.org>
Tue, 19 Jan 2016 11:24:18 +0000 (11:24 +0000)
IkiWiki/CGI.pm
IkiWiki/Plugin/aggregate.pm
IkiWiki/Plugin/autoindex.pm
IkiWiki/Plugin/calendar.pm
IkiWiki/Plugin/highlight.pm
IkiWiki/Plugin/remove.pm
IkiWiki/Plugin/tag.pm
IkiWiki/Render.pm
IkiWiki/Setup/Standard.pm
IkiWiki/Setup/Yaml.pm
debian/changelog

index 1763828a4eef973fce3296e2ffdd452f22e0a058..cbc2fe8eb0c6ce8b0e2b6ac5089e42fdd79b7037 100644 (file)
@@ -416,7 +416,9 @@ sub cgi (;$$) {
 
        eval q{use CGI};
        error($@) if $@;
+       no warnings "once";
        $CGI::DISABLE_UPLOADS=$config{cgi_disable_uploads};
+       use warnings;
 
        if (! $q) {
                binmode(STDIN);
index fbf88c62738d783c210d27cf6aa57c1b81c71fef..be7da3a710ec66a6243f414d9de62a49580bf6ad 100644 (file)
@@ -571,7 +571,9 @@ sub aggregate (@) {
                        # XML::Feed doesn't work around XML::Atom's bizarre
                        # API, so we will. Real unicode strings? Yes please.
                        # See [[bugs/Aggregated_Atom_feeds_are_double-encoded]]
+                       no warnings 'once';
                        local $XML::Atom::ForceUnicode = 1;
+                       use warnings;
 
                        my $c=$entry->content;
                        # atom feeds may have no content, only a summary
index d5ee4b58f3422344a3debae53dd334366ad43e18..c443f01d241d056ca1939fdd5cbe948b2dfc2e58 100644 (file)
@@ -46,6 +46,7 @@ sub genindex ($) {
 
                        my $dir = $config{srcdir};
                        if (! $config{autoindex_commit}) {
+                               no warnings 'once';
                                $dir = $IkiWiki::Plugin::transient::transientdir;
                        }
 
@@ -80,6 +81,7 @@ sub refresh () {
                                $file=~s/^\.\/?//;
                                return unless length $file;
                                if (IkiWiki::file_pruned($file)) {
+                                       no warnings 'once';
                                        $File::Find::prune=1;
                                }
                                elsif (! -l $_) {
index c03b89667c39bb67feb94116c92892f1cab0d21c..45617afe82d9af5b8ce8c4632df02e8a6c827580 100644 (file)
@@ -141,7 +141,9 @@ sub autocreate {
        $template->param(month => $month) if defined $month;
        $template->param(pagespec => $config{archive_pagespec});
 
+       no warnings 'once';
        my $dir = $IkiWiki::Plugin::transient::transientdir;
+       use warnings;
 
        writefile($pagefile, $dir, $template->output);
 }
index ce919748a4d10c6308cea7c1ea6559c47c608534..f6908921ed6ec3ca770ffefa2f6e8f11a939d286 100644 (file)
@@ -201,7 +201,9 @@ sub highlight ($$) {
 
        my $gen;
        if (! exists $highlighters{$langfile}) {
+               no warnings 'once';
                $gen = highlight::CodeGenerator::getInstance($highlight::XHTML);
+               use warnings;
                $gen->setFragmentCode(1); # generate html fragment
                $gen->setHTMLEnclosePreTag(1); # include stylish <pre>
                if ($data_dir){
index 5c99b387e9c7ced1fd99518de3177033b29eeeaa..6875844a32fc61a67a7d6eae82c4ed684e2681df 100644 (file)
@@ -23,6 +23,7 @@ sub getsetup () {
 }
 
 sub allowed_dirs {
+       no warnings 'once';
        return grep { defined $_ } (
                $config{srcdir},
                $IkiWiki::Plugin::transient::transientdir,
index 605f415994e73bee121faab9fb7e5e64f1a02182..8a0859b5ca48d45f12ccde0f4c823bb5bed913c4 100644 (file)
@@ -120,6 +120,7 @@ sub gentag ($) {
 
                        my $dir = $config{srcdir};
                        if (! $config{tag_autocreate_commit}) {
+                               no warnings 'once';
                                $dir = $IkiWiki::Plugin::transient::transientdir;
                        }
 
index 4c998b15620783662cfe3f18585674821036e110..130257f718adc24be173008e1f550aa5b51502dd 100644 (file)
@@ -326,6 +326,7 @@ sub find_src_files (;$$$) {
                $page = pagename($file);
                if (! exists $pagesources{$page} &&
                    file_pruned($file)) {
+                       no warnings 'once';
                        $File::Find::prune=1;
                        return;
                }
index ea7d763bbd26435c9dfb9462e1930f4cf7920b7a..07a66f3db279eabf6907c842e986b4c35095d3d5 100644 (file)
@@ -33,6 +33,7 @@ sub dumpline ($$$$) {
        
        eval q{use Data::Dumper};
        error($@) if $@;
+       no warnings 'once';
        local $Data::Dumper::Terse=1;
        local $Data::Dumper::Indent=1;
        local $Data::Dumper::Pad="\t";
@@ -40,6 +41,7 @@ sub dumpline ($$$$) {
        local $Data::Dumper::Quotekeys=0;
        # only the perl version preserves utf-8 in output
        local $Data::Dumper::Useperl=1;
+       use warnings;
        
        my $dumpedvalue;
        if (($type eq 'boolean' || $type eq 'integer') && $value=~/^[0-9]+$/) {
index 6bf20f480d523ad5144dc6d1b61ec03d1f0118b5..8edd7126b0e33c2a8c07bfa329be72b997d0d81d 100644 (file)
@@ -35,7 +35,9 @@ sub dumpline ($$$$) {
        
        eval q{use YAML::XS};
        die $@ if $@;
+       no warnings 'once';
        $YAML::XS::QuoteNumericStrings=0;
+       use warnings;
 
        my $dump=decode_utf8(Dump({$key => $value}));
        $dump=~s/^---\n//; # yaml header, we don't want
index c72787f37834712a71f471ceab257c8a2cb8e83b..90d6aa626b93f2d5dd89f86bd650fcfe1788be2f 100644 (file)
@@ -34,6 +34,8 @@ ikiwiki (3.20150615) UNRELEASED; urgency=medium
   * d/control: remove leading article from Description
     (lintian: description-synopsis-starts-with-article)
   * d/control: Standards-Version: 3.9.6, no changes required
+  * Silence "used only once: possible typo" warnings for variables
+    that are part of modules' APIs
 
  -- Simon McVittie <smcv@debian.org>  Mon, 15 Jun 2015 18:13:23 +0100