Thread: [Codestriker-commits] CVS update: codestriker/bin checksetup.pl
Brought to you by:
sits
From: <si...@us...> - 2004-11-22 11:07:13
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=3782741&action=view&brmode=1&fview=-1 User: sits Date: 04/11/22 03:06:54 Modified: bin checksetup.pl Log: Fixed broken upgrade code, and enabled taint mode for UNIX. Index: checksetup.pl =================================================================== RCS file: /cvsroot/codestriker/codestriker/bin/checksetup.pl,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- checksetup.pl 21 Nov 2004 05:00:06 -0000 1.61 +++ checksetup.pl 22 Nov 2004 11:06:52 -0000 1.62 @@ -624,13 +624,13 @@ print "Detected old version of commentdata table, migrating...\n"; # Need to migrate the data to the new style of the table data. - move_old_table("commentdata", undef); - move_old_table("commentstate", "topicid, line") if $old_commentstate_table; my $stmt; if ($old_commentstate_table) { print "Detected old version of commentstate table, migrating...\n"; # Update the commentstate table. + move_old_table($commentstate_table, "topicid, line"); + move_old_table($commentdata_table, undef); $stmt = $dbh->prepare_cached("SELECT topicid, state, line, version " . "FROM commentstate_old"); @@ -642,11 +642,11 @@ } $stmt->finish(); $dbh->do('DROP TABLE commentstate_old'); - } else { + } else { # Version of codestriker which didn't have a commentstate table. # Need to create new commentstate rows for each distinct comment # first, then update each individual comment row appropriately. - move_old_table("commentdata", undef); + move_old_table($commentdata_table, undef); $stmt = $dbh->prepare_cached('SELECT DISTINCT topicid, line ' . 'FROM commentdata_old'); @@ -932,7 +932,7 @@ if ($windows) { print CODESTRIKER_PL '#!perl.exe -w' . "\n"; } else { - print CODESTRIKER_PL '#!/usr/bin/perl -w' . "\n"; + print CODESTRIKER_PL '#!/usr/bin/perl -wT' . "\n"; } my $codestriker_lib = 'use lib \'' . cwd() . '/../lib\';'; for (my $i = 0; <CODESTRIKER_BASE>; $i++) { |
From: <si...@us...> - 2005-01-31 06:01:11
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=5271893&action=view User: sits Date: 05/01/30 22:00:52 Modified: bin checksetup.pl Log: Set the has_rss variable correctly. Index: checksetup.pl =================================================================== RCS file: /cvsroot/codestriker/codestriker/bin/checksetup.pl,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- checksetup.pl 21 Dec 2004 23:02:53 -0000 1.63 +++ checksetup.pl 31 Jan 2005 06:00:49 -0000 1.64 @@ -963,7 +963,7 @@ $template_vars->{codestriker_conf} = '\'' . cwd() . '/..\''; -$template_vars->{has_rss} = exists($missing_optional{'XML::RSS'}); +$template_vars->{has_rss} = !exists($missing_optional{'XML::RSS'}); $template_vars->{scary_warning} = "# !!!! THIS FILE IS AUTO-GENERATED by bin/checksetup.pl !!!\n". |
From: <si...@us...> - 2005-02-14 21:18:14
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=7368712&action=view User: sits Date: 05/02/14 13:17:58 Modified: bin checksetup.pl Log: Initial changes to checksetup for automated module installs, not complete. Index: checksetup.pl =================================================================== RCS file: /cvsroot/codestriker/codestriker/bin/checksetup.pl,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- checksetup.pl 31 Jan 2005 06:00:49 -0000 1.64 +++ checksetup.pl 14 Feb 2005 21:17:55 -0000 1.65 @@ -24,6 +24,7 @@ # doesn't try to grab this during compile time, otherwise nasty-looking # error messages will appear to the user. eval("use Cwd"); +eval("use CPAN"); eval("use File::Path"); eval("use lib '../lib'"); eval("use Codestriker"); @@ -44,6 +45,16 @@ # Initialise Codestriker, load up the configuration file. Codestriker->initialise(cwd() . '/..'); +# Make sure the $db configuration variable has been set, and if not +# complain and exit. +if (! defined $Codestriker::db) { + print STDERR + "The database configuration variable \$db has not been set.\n"; + print STDERR + "Please edit the codestriker.conf file and run this command again.\n"; + exit -1; +} + # Indicate which modules are required for codestriker (this code is # completely stolen more-or-less verbatim from Bugzilla) my $modules = [ @@ -64,6 +75,10 @@ version => '1.13' }, { + name => 'HTML::Mason', + version => '0' + }, + { name => 'Template', version => '2.07' }, @@ -233,7 +248,44 @@ print "\n"; print "Modules can also be downloaded from http://www.cpan.org.\n\n"; } - exit; + + if ($windows) { + # Need to find out how to do automatic installs with PPM. + exit -1; + } + + # Check we are running as root so the Perl modules can be properly + # installed. + print "\n"; + + if ($< != 0) { + print "Execute this script as root so I can install these modules "; + print "automatically.\n\n"; + exit -1; + } + + print "Shall I try to download and install these modules for you? (y/n): "; + flush STDOUT; + + my $answer = <STDIN>; + chop $answer; + if ($answer =~ /^y/i) { + # Try to install the modules using CPAN. + foreach my $module (keys %missing) { + my $obj = CPAN::Shell->expand('Module', $module); + + if (! $obj->install) { + print STDERR "\n\nFailed to install module: $module.\n"; + print STDERR "Try to install this module manually, " . + "and run this script again.\n\n"; + exit(1); + } + } + + } else { + # User decided to bail out. + exit -1; + } } |
From: <si...@us...> - 2005-02-14 21:52:59
|
Created Codestriker topic at: http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=4326698&action=view User: sits Date: 05/02/14 13:52:17 Modified: bin checksetup.pl Log: Testing code removed Index: checksetup.pl =================================================================== RCS file: /cvsroot/codestriker/codestriker/bin/checksetup.pl,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- checksetup.pl 14 Feb 2005 21:17:55 -0000 1.65 +++ checksetup.pl 14 Feb 2005 21:52:15 -0000 1.66 @@ -75,10 +75,6 @@ version => '1.13' }, { - name => 'HTML::Mason', - version => '0' - }, - { name => 'Template', version => '2.07' }, |