r53583 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53582‎ | r53583 | r53584 >
Date:11:24, 21 July 2009
Author:avar
Status:deferred
Tags:
Comment:
more sanity option checking
Modified paths:
  • /trunk/tools/osm-tools/osm2pgsql-style/create-language-views.pl (modified) (history)

Diff [purge]

Index: trunk/tools/osm-tools/osm2pgsql-style/create-language-views.pl
@@ -60,12 +60,24 @@
6161
6262 help() if $help;
6363
 64+if (not defined $languages)
 65+{
 66+ warn "--languages must be supplied";
 67+ help();
 68+}
 69+
6470 unless (-r $languages)
6571 {
6672 warn "Can't read the file `$languages'";
6773 help();
6874 }
6975
 76+if (not defined $psql_user)
 77+{
 78+ warn "--psql-user must be supplied";
 79+ help();
 80+}
 81+
7082 #
7183 # Config
7284 #
@@ -73,6 +85,10 @@
7486 # The tables we're creating views for
7587 my @tables = split_query( "select table_name from information_schema.tables where table_name ~ '^planet_osm';" );
7688
 89+if (not @tables) {
 90+ die "There were no tables beginning with 'planet_osm' in your database, or perhaps the database connection failed";
 91+}
 92+
7793 # Columns in those tables
7894 my %columns;
7995

Status & tagging log