Show
Ignore:
Timestamp:
05/11/08 17:04:41 (4 years ago)
Author:
dom
Message:

fix much tab/whitespace damage; no functional changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/Makefile.PL

    r430 r431  
    1515if ($Wiki::Toolkit::TestConfig::configured 
    1616    and not (@ARGV and $ARGV[0] eq '-s') 
    17     and not $ENV{WIKI_TOOLKIT_RERUN_CONFIG} 
    18    ) { 
     17    and not $ENV{WIKI_TOOLKIT_RERUN_CONFIG}) { 
    1918    print "\nFor the test suite, we use the database and user info\n" 
    2019        . "specified during the previous run.  If you want to change\n" 
     
    3231        . "preferably relevant to the backend(s) you intend to use live.\n" 
    3332        . "Running the tests under every possible backend combination is\n" 
    34         . "recommended.  To enter an undefined value, accept the empty\n" 
     33        . "recommended.  To enter an undefined value, accept the empty\n" 
    3534        . "string or explicitly enter 'undef'.\n\n" 
    3635        . "****        THESE TESTS ARE DESTRUCTIVE.         ****\n" 
     
    5352    foreach my $store (qw(MySQL Pg)) { 
    5453        my $dbname = $ENV{"WIKI_TOOLKIT_".uc($store)."_DBNAME"}; 
    55         if ($dbname and $dbname ne "undef") { 
    56             $config{$store}{dbname} = $dbname; 
     54        if ($dbname and $dbname ne "undef") { 
     55            $config{$store}{dbname} = $dbname; 
    5756            foreach my $var (qw(dbuser dbpass dbhost)) { 
    5857                my $value = $ENV{"WIKI_TOOLKIT_".uc($store)."_".uc($var)}; 
    59                 if ($value and $value ne "undef") {                 $config{$store}{$var} = $value; 
    60                 } elsif ($value eq "undef") { 
    61                     $config{$store}{$var} = undef; 
    62                 } 
    63             } 
    64         } elsif ($dbname eq "undef") { 
    65             $config{$store}{dbname} = undef; 
    66         } 
     58                if ($value and $value ne "undef") { 
     59                    $config{$store}{$var} = $value; 
     60                } elsif ($value eq "undef") { 
     61                    $config{$store}{$var} = undef; 
     62                } 
     63            } 
     64        } elsif ($dbname eq "undef") { 
     65            $config{$store}{dbname} = undef; 
     66        } 
    6767    } 
    6868 
     
    7676    # Finally ask questions; then check the settings work. 
    7777    my %driver = ( MySQL => "DBD::mysql", 
    78                    Pg    => "DBD::Pg" ); 
     78                   Pg    => "DBD::Pg" ); 
    7979    foreach my $store_type (qw(MySQL Pg)) { 
    8080        # See whether we have the driver installed. 
     
    8282        if ($@) { 
    8383            print "\n$driver{$store_type} not installed... skipping...\n"; 
    84             $config{$store_type}{dbname} = undef; 
    85             next; 
    86         } 
     84            $config{$store_type}{dbname} = undef; 
     85            next; 
     86        } 
    8787 
    8888        # Prompt for the options. 
     
    9090        my $pad = ' ' x (7-length $store_type); 
    9191        $dbname = prompt "\n${pad}Database name for $store_type: ", 
    92                          $config{$store_type}{dbname}; 
     92                         $config{$store_type}{dbname}; 
    9393        undef $dbname unless ($dbname and $dbname ne "undef"); 
    9494        if ($dbname and $dbname ne "undef") { 
    95             $dbuser = prompt "            Database user: ", 
    96                              $config{$store_type}{dbuser}; 
     95            $dbuser = prompt "            Database user: ", 
     96                             $config{$store_type}{dbuser}; 
    9797            undef $dbuser unless ($dbuser and $dbuser ne "undef"); 
    98             $dbpass = prompt "        Database password: ", 
    99                              $config{$store_type}{dbpass}; 
     98            $dbpass = prompt "        Database password: ", 
     99                             $config{$store_type}{dbpass}; 
    100100            undef $dbpass unless ($dbpass and $dbpass ne "undef"); 
    101             $dbhost = prompt "Database host (if needed): ", 
    102                              $config{$store_type}{dbhost}; 
     101            $dbhost = prompt "Database host (if needed): ", 
     102                             $config{$store_type}{dbhost}; 
    103103            undef $dbhost unless ($dbhost and $dbhost ne "undef"); 
    104104 
     
    107107            $config{$store_type}{dbpass} = $dbpass; 
    108108            $config{$store_type}{dbhost} = $dbhost; 
    109         } else { 
     109        } else { 
    110110            print "\nNo database name supplied... skipping...\n"; 
    111             $config{$store_type}{dbname} = undef; 
    112         } 
     111            $config{$store_type}{dbname} = undef; 
     112        } 
    113113    } 
    114114 
     
    121121# If we have a MySQL store configured, we can test the DBIx::FullTextSearch 
    122122# search backend. 
    123 eval { require DBIx::FullTextSearch; 
    124        require Lingua::Stem; 
     123eval { 
     124    require DBIx::FullTextSearch; 
     125    require Lingua::Stem; 
    125126}; 
    126127my $fts_inst = $@ ? 0 : 1; 
     
    172173# Write out the config for next run. 
    173174open OUT, ">lib/Wiki/Toolkit/TestConfig.pm" 
    174   or die "Couldn't open lib/Wiki/Toolkit/TestConfig.pm for writing: $!"; 
     175    or die "Couldn't open lib/Wiki/Toolkit/TestConfig.pm for writing: $!"; 
    175176# warning - blind copy and paste follows.  FIXME. 
    176177print OUT Data::Dumper->new([ \%Wiki::Toolkit::TestConfig::config ], 
    177                             [ '*Wiki::Toolkit::TestConfig::config' ] 
    178                            )->Dump, 
    179   "\$Wiki::Toolkit::TestConfig::configured = 1;\n1;\n"; 
     178                            [ '*Wiki::Toolkit::TestConfig::config' ] 
     179                           )->Dump, 
     180          "\$Wiki::Toolkit::TestConfig::configured = 1;\n1;\n"; 
    180181close OUT; 
    181182 
     
    202203# Write the Makefile. 
    203204WriteMakefile( NAME         => "Wiki::Toolkit", 
    204                VERSION_FROM => "lib/Wiki/Toolkit.pm", 
    205                PREREQ_PM    => { 'Text::WikiFormat' => '0.78', #earlier's buggy 
    206                                  'HTML::PullParser' => 0, 
    207                                  'Digest::MD5' => 0, 
    208                                  'Test::More' => 0, 
    209                                  'Time::Piece' => 0, 
    210                                  %extras }, 
     205               VERSION_FROM => "lib/Wiki/Toolkit.pm", 
     206               PREREQ_PM    => { 'Text::WikiFormat' => '0.78', #earlier's buggy 
     207                                 'HTML::PullParser' => 0, 
     208                                 'Digest::MD5' => 0, 
     209                                 'Test::More' => 0, 
     210                                 'Time::Piece' => 0, 
     211                                 %extras 
     212                               }, 
    211213               EXE_FILES => [ "bin/wiki-toolkit-setupdb", 
    212214                              "bin/wiki-toolkit-rename-node", 
    213215                              "bin/wiki-toolkit-delete-node", 
    214                               "bin/wiki-toolkit-revert-to-date" ], 
    215                clean => { FILES => "Config lib/Wiki/Toolkit/TestConfig.pm " 
    216                                  . "t/sqlite-test.db t/sii-db-file-test.db " 
     216                              "bin/wiki-toolkit-revert-to-date" 
     217                            ], 
     218               clean => { FILES => "Config lib/Wiki/Toolkit/TestConfig.pm " 
     219                                 . "t/sqlite-test.db t/sii-db-file-test.db " 
    217220                                 . "t/node.db t/plucene" 
    218221                        } 
    219              ); 
     222             );