Author: kake Date: 2008-06-21 18:15:43 +0100 (Sat, 21 Jun 2008) New Revision: 1171
Modified: branches/new-install-process/SETUP branches/new-install-process/bin/openguides-install Log: Make it clear in SETUP that the script_url needs an http
Modified: branches/new-install-process/SETUP =================================================================== --- branches/new-install-process/SETUP 2008-06-21 17:13:23 UTC (rev 1170) +++ branches/new-install-process/SETUP 2008-06-21 17:15:43 UTC (rev 1171) @@ -173,7 +173,8 @@ "What URL does the install directory map to?"
Give the full address needed to access the installation directory with -a web browser - for example http://london.openguides.org/ +a web browser, including the "http://" prefix - for example, +http://london.openguides.org/
"Do you want me to munge a custom lib path into the scripts?"
Modified: branches/new-install-process/bin/openguides-install =================================================================== --- branches/new-install-process/bin/openguides-install 2008-06-21 17:13:23 UTC (rev 1170) +++ branches/new-install-process/bin/openguides-install 2008-06-21 17:15:43 UTC (rev 1171) @@ -78,9 +78,6 @@ $targets{"$label.cgi"} = find_script( "openguides-$label-script" ); }
-# The database setup script. -my $setup = find_script( "wiki-toolkit-setupdb" ); - my $force; GetOptions('force' => $force); unless ($force) { @@ -116,6 +113,9 @@ content_above_navbar_in_html show_gmap_in_node_display force_wgs84 send_moderation_notifications);
+my %blank_ok = map { $_ => 1 } + qw( dbpass dbhost ); + my $skip_config = $force ? 'y' : prompt( "y", "Skip OpenGuides configuration?", "y or n", "n" ); @@ -166,7 +166,8 @@ sqlite => "DBD::SQLite", ); eval "require $drivers{$dbtype}"; -warn "$drivers{$dbtype} is needed to run a $dbtype database" if $@; +die "\nSorry; $drivers{$dbtype} is needed to run a $dbtype database - please " + . "install this\nmodule and try again.\n\n" if $@;
push @answers, { question => $dbtype_qu, variable => "dbtype", @@ -205,13 +206,12 @@ ) ) { my $q_method = $var . "__qu"; my $qu = $existing_config->$q_method; - my $type = $yn_vars{$var} ? "y_n" : ""; my $def = $existing_config->$var || ""; my $val = $def;
# Override dbname question for SQLite only. if ( $dbtype eq "sqlite" and $var eq "dbname" ) { - $qu = "what's the full filename of the SQLite database this site runs on?"; + $qu = "What's the full filename of the SQLite database this site runs on?"; }
if ( $dbtype eq "sqlite" and @@ -322,12 +322,17 @@
# Here is where we actually ask the questions. unless ( $skip_config ) { - if ( $type eq "y_n" ) { +print $var . "\n"; + if ( $yn_vars{$var} ) { # may be stored as true/false integer value if ( $def =~ /^\d+$/ ) { $def = $def ? "y" : "n"; } $val = prompt( "y", $qu, "y or n", $def ); + } elsif ( $blank_ok{$var} ) { +print "boo!\n"; + $val = prompt( "s", $qu, "optional", $def, + sub { print "hello!\n"; return 1; } ); } else { $val = prompt( "x", $qu, "", $def ); }