mvhub-dev team mailing list archive
-
mvhub-dev team
-
Mailing list archive
-
Message #00509
[Merge] lp:~reddy22222/mvhub/perltidy_doesnt_check_with_big_diff into lp:mvhub
Srihari Reddy has proposed merging lp:~reddy22222/mvhub/perltidy_doesnt_check_with_big_diff into lp:mvhub.
Requested reviews:
MVHub devs with commit rights (mvhub-commit)
perltidied all remaining perl files
also added -b arg to /usr/bin/file
--
https://code.launchpad.net/~reddy22222/mvhub/perltidy_doesnt_check_with_big_diff/+merge/31338
Your team MVHub Developers is subscribed to branch lp:mvhub.
=== modified file 'app-mvhub/bin/rm_session_files'
--- app-mvhub/bin/rm_session_files 2010-07-05 15:55:35 +0000
+++ app-mvhub/bin/rm_session_files 2010-07-29 22:33:46 +0000
@@ -7,8 +7,8 @@
use MVHub::Utils::ConfigSimple;
my $config_file = $ARGV[0] || $ENV{MV_CONFIG_FILE};
-my $CFG = MVHub::Utils::ConfigSimple::create_config_from($config_file);
+my $CFG = MVHub::Utils::ConfigSimple::create_config_from($config_file);
my $TMP_DIR = $CFG->param('ABSOLUTE_PATH.tmp_dir');
-my $cmd="find $TMP_DIR -mtime +1 -exec rm {} \\;";
+my $cmd = "find $TMP_DIR -mtime +1 -exec rm {} \\;";
system($cmd);
=== modified file 'app-mvhub/bin/run_external_reports'
--- app-mvhub/bin/run_external_reports 2010-06-30 16:25:51 +0000
+++ app-mvhub/bin/run_external_reports 2010-07-29 22:33:46 +0000
@@ -15,11 +15,10 @@
my $config_file = $ARGV[0] || $ENV{MV_CONFIG_FILE};
my $CFG = MVHub::Utils::ConfigSimple::create_config_from($config_file);
-my $LOG_DIR = $CFG->param('ABSOLUTE_PATH.log_dir');
-my $TMP_DIR = $CFG->param('ABSOLUTE_PATH.tmp_dir');
+my $LOG_DIR = $CFG->param('ABSOLUTE_PATH.log_dir');
+my $TMP_DIR = $CFG->param('ABSOLUTE_PATH.tmp_dir');
my $SITE_URL = $CFG->param('SITE.website_name');
-
# analog also keeps a log for each site
# this log is for this script
my $LOGFILE = "$LOG_DIR/run_external_reports.log";
@@ -48,8 +47,8 @@
. "/visitors/visitors.html";
run_visitors_report( $processed_log, $output_file );
- $output_file = $CFG->param('ABSOLUTE_PATH.reports_dir')
- . "/analog/analog.html";
+ $output_file
+ = $CFG->param('ABSOLUTE_PATH.reports_dir') . "/analog/analog.html";
run_analog_report( $processed_log, $output_file );
logentry("finished run");
@@ -135,12 +134,13 @@
logentry("start analog report for $in");
_generate_analog_conf_file();
-
- my $cmd = "/usr/bin/analog -G +g$LOG_DIR/analog.conf +O$out $in 2>/dev/null";
+
+ my $cmd
+ = "/usr/bin/analog -G +g$LOG_DIR/analog.conf +O$out $in 2>/dev/null";
if ( -e '/var/cache/analog/dnsfile.txt.Lock' ) {
- my $error_msg =
-"leftover analog lock file present: /var/cache/analog/dnsfile.txt.Lock";
+ my $error_msg
+ = "leftover analog lock file present: /var/cache/analog/dnsfile.txt.Lock";
fatal_logentry($error_msg);
}
@@ -151,7 +151,8 @@
}
sub _generate_analog_conf_file {
- open my $outfile, ">", "$LOG_DIR/analog.conf" or croak "Cannot open $LOG_DIR/analog.conf\n";
+ open my $outfile, ">", "$LOG_DIR/analog.conf"
+ or croak "Cannot open $LOG_DIR/analog.conf\n";
my $analog_conf = <<"END";
# Configuration file for analog 4.01
HOSTNAME "Debian Linux System"
=== modified file 'app-mvhub/project-tools/bin/mv_db_clean'
--- app-mvhub/project-tools/bin/mv_db_clean 2009-12-18 18:09:42 +0000
+++ app-mvhub/project-tools/bin/mv_db_clean 2010-07-29 22:33:46 +0000
@@ -5,18 +5,18 @@
use MVHub::Utils::DB qw/get_dbh /;
-{ # main
-die "MV_CONFIG_FILE env var not set "
- if not $ENV{MV_CONFIG_FILE};
-
-my $dbh=MVHub::Utils::DB::get_dbh($ENV{MV_CONFIG_FILE});
-
-my $sql= << "SQL";
+{ # main
+ die "MV_CONFIG_FILE env var not set "
+ if not $ENV{MV_CONFIG_FILE};
+
+ my $dbh = MVHub::Utils::DB::get_dbh( $ENV{MV_CONFIG_FILE} );
+
+ my $sql = << "SQL";
DELETE FROM
agency
WHERE
agency_name LIKE '0000%Testing Group'
SQL
-$dbh->do($sql);
+ $dbh->do($sql);
}
=== modified file 'app-mvhub/project-tools/bin/mv_devcover'
--- app-mvhub/project-tools/bin/mv_devcover 2009-09-01 14:49:59 +0000
+++ app-mvhub/project-tools/bin/mv_devcover 2010-07-29 22:33:46 +0000
@@ -1,34 +1,34 @@
#!/usr/bin/perl -w
-use strict;
+use strict;
my $sub_dir = $ARGV[0] || '';
-my $original_working_directory=`pwd`;
+my $original_working_directory = `pwd`;
chdir "/var/www/mvhub/$ENV{USER}/";
-my $test_dir='link-to-live-code/lib-mvhub/t/';
+my $test_dir = 'link-to-live-code/lib-mvhub/t/';
-die "FATAL ERROR: $test_dir/$sub_dir doesn't exist\n"
- if not -e "$test_dir/$sub_dir";
+die "FATAL ERROR: $test_dir/$sub_dir doesn't exist\n"
+ if not -e "$test_dir/$sub_dir";
# delete old coverage databsae
-my $cmd='cover -delete';
-(system($cmd)==0) or warn "failed: $cmd";
+my $cmd = 'cover -delete';
+( system($cmd) == 0 ) or warn "failed: $cmd";
# tell perl to run Devel::Cover when perl programs are run
-$ENV{PERL5OPT}='-MDevel::Cover=-ignore,Build,t/.*t,/usr/bin/prove';
+$ENV{PERL5OPT} = '-MDevel::Cover=-ignore,Build,t/.*t,/usr/bin/prove';
# run our tests
-$cmd="prove -r $test_dir/$sub_dir";
-(system($cmd)==0) or warn "failed: $cmd";
+$cmd = "prove -r $test_dir/$sub_dir";
+( system($cmd) == 0 ) or warn "failed: $cmd";
# We don't want to run Devel::Cover with every
# program going forward, it is slooow
-$ENV{PERL5OPT}='';
+$ENV{PERL5OPT} = '';
# generate the reports from the coverage database
-$cmd="cover -report html";
-(system($cmd)==0) or warn "failed: $cmd";
+$cmd = "cover -report html";
+( system($cmd) == 0 ) or warn "failed: $cmd";
chdir $original_working_directory;
=== modified file 'app-mvhub/project-tools/bin/mv_etail'
--- app-mvhub/project-tools/bin/mv_etail 2010-01-15 20:01:33 +0000
+++ app-mvhub/project-tools/bin/mv_etail 2010-07-29 22:33:46 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use warnings;
+use warnings;
my $USAGE = <<"USAGE";
@@ -20,10 +20,10 @@
my $user = $ARGV[0];
$user = $ENV{USER}
- if not $user;
-
-
-my $cmd = "tail -f /var/www/mvhub/$user/log/$site/error.log | perl -p -i -e 's/\n/\n\n/;' ";
-(system($cmd) == 0)
- or die "command failed : $cmd";
+ if not $user;
+
+my $cmd
+ = "tail -f /var/www/mvhub/$user/log/$site/error.log | perl -p -i -e 's/\n/\n\n/;' ";
+( system($cmd) == 0 )
+ or die "command failed : $cmd";
=== modified file 'app-mvhub/project-tools/bin/mv_get_active'
--- app-mvhub/project-tools/bin/mv_get_active 2009-09-21 13:49:26 +0000
+++ app-mvhub/project-tools/bin/mv_get_active 2010-07-29 22:33:46 +0000
@@ -3,19 +3,19 @@
use strict;
use warnings;
-my $USER = $ENV{USER};
-my $LINK_PATH = "/var/www/mvhub/$USER";
-my $USAGE = "Usage: mv_get_active\n";
+my $USER = $ENV{USER};
+my $LINK_PATH = "/var/www/mvhub/$USER";
+my $USAGE = "Usage: mv_get_active\n";
{ # main
- print $USAGE if @ARGV > 0;
-
- my $link_target = readlink("$LINK_PATH/link-to-live-code")
- or die "failed to read $LINK_PATH/link-to-live-code because: $!";
-
- my $active_branch = ( split '/', $link_target )[-1];
-
- print "$active_branch\n";
+ print $USAGE if @ARGV > 0;
+
+ my $link_target = readlink("$LINK_PATH/link-to-live-code")
+ or die "failed to read $LINK_PATH/link-to-live-code because: $!";
+
+ my $active_branch = ( split '/', $link_target )[-1];
+
+ print "$active_branch\n";
}
=== modified file 'app-mvhub/project-tools/bin/mv_set_active'
--- app-mvhub/project-tools/bin/mv_set_active 2009-12-23 19:20:20 +0000
+++ app-mvhub/project-tools/bin/mv_set_active 2010-07-29 22:33:46 +0000
@@ -31,11 +31,11 @@
sub build_prompt_from {
my ( $exit_str, $link_path ) = @_;
-
- my $link_target= readlink("$link_path/link-to-live-code")
- or die "failed to read $link_path/link-to-live-code because: $!";
-
- my $current_branch = ( split '/',$link_target )[-1];
+
+ my $link_target = readlink("$link_path/link-to-live-code")
+ or die "failed to read $link_path/link-to-live-code because: $!";
+
+ my $current_branch = ( split '/', $link_target )[-1];
my $prompt = << "HERE";
@@ -70,7 +70,8 @@
@branches = grep { !/release/ } @branches;
@branches = sort(@branches);
-# unshift( @branches, $exit_str );
+
+ # unshift( @branches, $exit_str );
return @branches;
}
@@ -80,14 +81,14 @@
my $cmd = "ln -nfs $branch_path/$branch $link_path/link-to-live-code";
( system($cmd) == 0 )
- or die "command failed : $cmd";
+ or die "command failed : $cmd";
}
sub print_results {
( system('clear') == 0 )
- or warn "cls failed";
+ or warn "cls failed";
my $pwd = `pwd`;
print << "MSG";
Link set to branch:
=== modified file 'app-mvhub/project-tools/bin/mv_su_test'
--- app-mvhub/project-tools/bin/mv_su_test 2010-04-18 20:31:28 +0000
+++ app-mvhub/project-tools/bin/mv_su_test 2010-07-29 22:33:46 +0000
@@ -10,7 +10,7 @@
{ # main
my $user = $ARGV[0]
- or die "Usage: \n\t su_test <username> \n";
+ or die "Usage: \n\t su_test <username> \n";
die_on_bad($user);
su_to($user);
@@ -24,7 +24,7 @@
# run tests
my $cmd = "mv_prove app-mvhub/t/ lib-mvhub/t/ -r";
( system($cmd) == 0 ) or die "Failed: $cmd \n";
-} #main
+} #main
sub die_on_bad {
my $user = shift;
@@ -55,28 +55,29 @@
$ENV{USER} = $user;
$uid = getpwnam($user)
- or die "UNEXPECTED bad uid: '$uid' ";
+ or die "UNEXPECTED bad uid: '$uid' ";
$REAL_USER_ID = $uid;
die "Failed to set Real User Id: $!"
- if $!;
+ if $!;
$EFFECTIVE_USER_ID = $uid;
die "Failed to set Effective User Id: $!"
- if $!;
+ if $!;
}
sub get_env_from {
my ( $user, $vars_file ) = @_;
my %env;
my $base_dir = "/var/www/mvhub";
- my $mv_path = "$base_dir/$user/link-to-live-code/app-mvhub/project-tools/bin/";
+ my $mv_path
+ = "$base_dir/$user/link-to-live-code/app-mvhub/project-tools/bin/";
my $perl5lib = "$base_dir/$user/link-to-live-code/lib-mvhub/lib/";
- $perl5lib.= ":$base_dir/$user/link-to-live-code/app-mvhub/t/lib";
- $perl5lib.= ":$base_dir/$user/link-to-live-code/lib-mvhub/t/lib";
+ $perl5lib .= ":$base_dir/$user/link-to-live-code/app-mvhub/t/lib";
+ $perl5lib .= ":$base_dir/$user/link-to-live-code/lib-mvhub/t/lib";
open my $IN, $vars_file
- or die "error: $! failed to open $vars_file";
+ or die "error: $! failed to open $vars_file";
while ( my $line = <$IN> ) {
next if $line !~ m/^\s*export/;
@@ -89,11 +90,11 @@
# check if we need another subsitution
# like $SITE or $USER
- if ($line =~ m/(\$\w+)/){
- die "found unexpected $1 in \n $line \n ";
+ if ( $line =~ m/(\$\w+)/ ) {
+ die "found unexpected $1 in \n $line \n ";
}
die "line does not match regex:\n $line"
- if $line !~ m/
+ if $line !~ m/
^\s*export\s+ # line starts with: export
(\w+) # key
= # delimiter
=== modified file 'app-mvhub/project-tools/bin/mv_tidy'
--- app-mvhub/project-tools/bin/mv_tidy 2009-09-01 14:49:59 +0000
+++ app-mvhub/project-tools/bin/mv_tidy 2010-07-29 22:33:46 +0000
@@ -2,7 +2,7 @@
use warnings;
use strict;
-use Test::More qw/no_plan/;
+use Test::More qw/no_plan/;
use HTML::Template;
use Data::Dumper;
@@ -22,9 +22,9 @@
{ # main
my ( $in_filename, $out_filename, $original_filename );
- $in_filename = $ARGV[0] || die "usage: mv_tidy <filename>\n";
- $original_filename=$in_filename;
- $out_filename = "$in_filename.1.lc_tmpl_tags";
+ $in_filename = $ARGV[0] || die "usage: mv_tidy <filename>\n";
+ $original_filename = $in_filename;
+ $out_filename = "$in_filename.1.lc_tmpl_tags";
process_step( \&lc_tmpl_tag_line, $in_filename, $out_filename );
$in_filename = $out_filename;
@@ -34,14 +34,15 @@
$in_filename = $out_filename;
$out_filename = "$out_filename.3.tided";
my $cmd = "tidy -f tidy-errors-01.txt '$in_filename' > '$out_filename'";
+
# not checking return on purpose
# because warnings return non-success
# and we are too lazy to deal with
# mere warnings now
system($cmd);
-# diag "testing tidy step";
-# test_cleaned_template( $in_filename, $out_filename );
+ # diag "testing tidy step";
+ # test_cleaned_template( $in_filename, $out_filename );
$in_filename = $out_filename;
$out_filename = "$out_filename.4.replace_lt_gt";
@@ -49,7 +50,6 @@
diag "testing replace lt gt step";
test_cleaned_template( $original_filename, $out_filename );
-
} # main
sub process_step {
@@ -97,7 +97,7 @@
}
sub lc_tmpl_tag_line {
-my $line = shift;
+ my $line = shift;
# make everything lower case
if ( $line =~ /(TMPL_\w+)/ ) {
@@ -143,10 +143,10 @@
"same number of elements in original and tidied"
);
- is_deeply( \@original, \@tidied,
+ is_deeply( \@original, \@tidied,
"tidied template matches original template" );
-my @sorted_original = sort @original;
+ my @sorted_original = sort @original;
my @sorted_tidied = sort @tidied;
is_deeply( \@sorted_original, \@sorted_tidied,
"if sorted tidied template matches original template" );
=== modified file 'app-mvhub/project-tools/bin/mv_update_development'
--- app-mvhub/project-tools/bin/mv_update_development 2010-07-08 22:37:52 +0000
+++ app-mvhub/project-tools/bin/mv_update_development 2010-07-29 22:33:46 +0000
@@ -29,9 +29,9 @@
chomp $hostname;
Getopt::Long::GetOptions(
- 'prompt' => \$interactive,
+ 'prompt' => \$interactive,
'overwrite' => \$overwrite,
- 'help|?' => \$usage
+ 'help|?' => \$usage
) or die "GetOptions failed";
if ($usage) {
@@ -84,7 +84,8 @@
$prompt = "Update config files for $USERNAME? (Y/N):";
if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::make_config_files_for( $USERNAME, $cfg, $overwrite );
+ MVHub::Utils::Setup::make_config_files_for( $USERNAME, $cfg,
+ $overwrite );
$cfg = MVHub::Utils::ConfigSimple::create_config_from(
$ENV{MV_CONFIG_FILE} );
=== modified file 'app-mvhub/project-tools/bin/mv_update_production'
--- app-mvhub/project-tools/bin/mv_update_production 2010-07-08 22:37:52 +0000
+++ app-mvhub/project-tools/bin/mv_update_production 2010-07-29 22:33:46 +0000
@@ -22,7 +22,7 @@
use MVHub::Utils::Setup;
my @ALLOWED_HOSTS = qw/ parrot /;
-my $USERNAME = 'www-data';
+my $USERNAME = 'www-data';
my $CFG_PATH = '/var/www/mvhub/www-data/conf/nsp.conf';
@@ -30,56 +30,59 @@
# environment correctly. This should be fixed by a massive refactoring
# in how we create our config objects
$ENV{MV_CONFIG_FILE} = '/var/www/mvhub/www-data/conf/nsp.conf';
-$ENV{SUDO_USER} = 'www-data';
+$ENV{SUDO_USER} = 'www-data';
{ # main
- my $interactive = 0;
- my $overwrite = 0;
- my $usage = 0;
- my $hostname = `hostname`;
+ my $interactive = 0;
+ my $overwrite = 0;
+ my $usage = 0;
+ my $hostname = `hostname`;
chomp $hostname;
-
- Getopt::Long::GetOptions( 'prompt' => \$interactive,
- 'overwrite' => \$overwrite,
- 'help|?' => \$usage )
- or die "GetOptions failed";
+
+ Getopt::Long::GetOptions(
+ 'prompt' => \$interactive,
+ 'overwrite' => \$overwrite,
+ 'help|?' => \$usage
+ ) or die "GetOptions failed";
if ($usage) {
print usage();
exit 0;
}
- die usage() if $ENV{USER} ne 'root' || !( grep /^$hostname$/, @ALLOWED_HOSTS );
+ die usage()
+ if $ENV{USER} ne 'root' || !( grep /^$hostname$/, @ALLOWED_HOSTS );
local $OUTPUT_AUTOFLUSH = 1;
- my $cfg =
- MVHub::Utils::ConfigSimple::create_config_from( $CFG_PATH, $USERNAME );
+ my $cfg = MVHub::Utils::ConfigSimple::create_config_from( $CFG_PATH,
+ $USERNAME );
system('clear');
my $base_dir = $cfg->param('BASE.dir');
my @dirs = MVHub::Utils::Setup::get_dirs_with( "$base_dir", $USERNAME );
-
+
my $prompt = "Create $USERNAME directory structure? (Y/N):";
if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::make_dirs_from( \@dirs );
- }
-
- $prompt = "Update config files for $USERNAME? (Y/N):";
- if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::make_config_files_for( $USERNAME, $cfg, $overwrite );
- $cfg = MVHub::Utils::ConfigSimple::create_config_from( $CFG_PATH );
- }
-
- $prompt = "Apply database updates for $USERNAME? (Y/N):";
- if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::apply_database_updates_for( $USERNAME, $cfg );
- }
+ MVHub::Utils::Setup::make_dirs_from( \@dirs );
+ }
+
+ $prompt = "Update config files for $USERNAME? (Y/N):";
+ if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
+ MVHub::Utils::Setup::make_config_files_for( $USERNAME, $cfg,
+ $overwrite );
+ $cfg = MVHub::Utils::ConfigSimple::create_config_from($CFG_PATH);
+ }
+
+ $prompt = "Apply database updates for $USERNAME? (Y/N):";
+ if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
+ MVHub::Utils::Setup::apply_database_updates_for( $USERNAME, $cfg );
+ }
$prompt = "Update contents of /etc? (Y/N):";
if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::update_etc_files( $cfg );
+ MVHub::Utils::Setup::update_etc_files($cfg);
MVHub::Utils::Setup::restart_services();
- }
+ }
}
=== modified file 'app-mvhub/project-tools/bin/mv_update_staging'
--- app-mvhub/project-tools/bin/mv_update_staging 2010-07-08 22:37:52 +0000
+++ app-mvhub/project-tools/bin/mv_update_staging 2010-07-29 22:33:46 +0000
@@ -22,7 +22,7 @@
use MVHub::Utils::Setup;
my @ALLOWED_HOSTS = qw/ penguin /;
-my $USERNAME = 'www-data';
+my $USERNAME = 'www-data';
my $CFG_PATH = '/var/www/mvhub/www-data/conf/nsp.conf';
@@ -30,70 +30,74 @@
# environment correctly. This should be fixed by a massive refactoring
# in how we create our config objects
$ENV{MV_CONFIG_FILE} = '/var/www/mvhub/www-data/conf/nsp.conf';
-$ENV{SUDO_USER} = 'www-data';
+$ENV{SUDO_USER} = 'www-data';
{ # main
- my $interactive = 0;
- my $overwrite = 0;
- my $usage = 0;
- my $hostname = `hostname`;
+ my $interactive = 0;
+ my $overwrite = 0;
+ my $usage = 0;
+ my $hostname = `hostname`;
chomp $hostname;
-
- Getopt::Long::GetOptions( 'prompt' => \$interactive,
- 'overwrite' => \$overwrite,
- 'help|?' => \$usage )
- or die "GetOptions failed";
-
- if ( $usage ) {
+
+ Getopt::Long::GetOptions(
+ 'prompt' => \$interactive,
+ 'overwrite' => \$overwrite,
+ 'help|?' => \$usage
+ ) or die "GetOptions failed";
+
+ if ($usage) {
print usage();
exit 0;
}
- die usage() if $ENV{USER} ne 'root' || !( grep /^$hostname$/, @ALLOWED_HOSTS );
+ die usage()
+ if $ENV{USER} ne 'root' || !( grep /^$hostname$/, @ALLOWED_HOSTS );
local $OUTPUT_AUTOFLUSH = 1;
- my $cfg =
- MVHub::Utils::ConfigSimple::create_config_from( $CFG_PATH, $USERNAME );
+ my $cfg = MVHub::Utils::ConfigSimple::create_config_from( $CFG_PATH,
+ $USERNAME );
system('clear');
my $base_dir = $cfg->param('BASE.dir');
my @dirs = MVHub::Utils::Setup::get_dirs_with( "$base_dir", $USERNAME );
-
+
my $prompt = "Recreate $USERNAME directory structure? (Y/N):";
if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::make_dirs_from( \@dirs );
- }
-
- $prompt = "Update config files? (Y/N):";
- if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::make_config_files_for( $USERNAME, $cfg, $overwrite );
- $cfg = MVHub::Utils::ConfigSimple::create_config_from( $CFG_PATH, $USERNAME );
- }
-
- $prompt = "Reload databases with recent production data? (Y/N):";
- if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::get_production_data( $cfg );
+ MVHub::Utils::Setup::make_dirs_from( \@dirs );
+ }
+
+ $prompt = "Update config files? (Y/N):";
+ if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
+ MVHub::Utils::Setup::make_config_files_for( $USERNAME, $cfg,
+ $overwrite );
+ $cfg = MVHub::Utils::ConfigSimple::create_config_from( $CFG_PATH,
+ $USERNAME );
+ }
+
+ $prompt = "Reload databases with recent production data? (Y/N):";
+ if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
+ MVHub::Utils::Setup::get_production_data($cfg);
MVHub::Utils::Setup::make_databases_for( $USERNAME, $cfg );
- MVHub::Utils::Setup::load_production_data( $USERNAME, $cfg );
- }
-
+ MVHub::Utils::Setup::load_production_data( $USERNAME, $cfg );
+ }
+
$prompt = "Apply database updates for $USERNAME? (Y/N):";
if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::apply_database_updates_for( $USERNAME, $cfg );
- }
+ MVHub::Utils::Setup::apply_database_updates_for( $USERNAME, $cfg );
+ }
- $prompt = "Update contents of /etc? (Y/N):";
+ $prompt = "Update contents of /etc? (Y/N):";
if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::update_etc_files( $cfg );
+ MVHub::Utils::Setup::update_etc_files($cfg);
MVHub::Utils::Setup::restart_services();
MVHub::Utils::Setup::remove_cron_jobs();
- }
+ }
$prompt = "Run tests? (Y/N):";
if ( !($interactive) || IO::Prompt::prompt( $prompt, -YN ) ) {
- MVHub::Utils::Setup::run_tests( $USERNAME, $cfg );
- }
+ MVHub::Utils::Setup::run_tests( $USERNAME, $cfg );
+ }
}
sub usage {
=== modified file 'app-mvhub/setup/install.pl.old_but_good'
--- app-mvhub/setup/install.pl.old_but_good 2009-03-04 18:11:56 +0000
+++ app-mvhub/setup/install.pl.old_but_good 2010-07-29 22:33:46 +0000
@@ -13,6 +13,7 @@
use strict;
use MVHub::Utils;
+
# use MVHub::DBHCache;
use File::Basename;
use Config::IniFiles;
=== modified file 'app-mvhub/t/perltidy.t'
--- app-mvhub/t/perltidy.t 2010-07-05 18:12:08 +0000
+++ app-mvhub/t/perltidy.t 2010-07-29 22:33:46 +0000
@@ -6,6 +6,7 @@
use Carp;
use Test::More;
use File::Temp;
+use Params::Validate;
use TestHelper;
@@ -65,16 +66,26 @@
sub _get_uncommitted_perl_files {
my @perl_files = `bzr status`;
+ my @all_files = get_files_from( '.', q{'*'} );
chomp @perl_files;
- @perl_files = map { s# +##; $_; } @perl_files;
- @perl_files = grep { m/(pl|pm|t)$/; } @perl_files;
+
+ # @perl_files = map { s# +##; $_; } @perl_files;
+ foreach my $file (@all_files) {
+ my $result = `/usr/bin/file -b $file`;
+ push @perl_files, $file if $result =~ m/perl/i;
+ }
return @perl_files;
}
sub _get_all_perl_files {
+ my @perl_files;
+ my @all_files = get_files_from( '.', q{'*'} );
+ foreach my $file (@all_files) {
+ my $result = `/usr/bin/file -b $file`;
+ push @perl_files, $file if $result =~ m/perl/i;
+ }
- my @perl_files = get_files_from( '.', qw/*.pl *.pm *.t / );
@perl_files = map { s#^.*lib-mvhub/t/\.\.#lib-mvhub#; $_; } @perl_files;
@perl_files = map { s#^.*app-mvhub/t/\.\.#app-mvhub/#; $_; } @perl_files;
@perl_files = map { s#^\./##; $_; } @perl_files;
@@ -82,6 +93,12 @@
return @perl_files;
}
+sub _is_perl {
+ Validate::Params::validate_pos( @_, 1 );
+ my $file = shift;
+ my $result = `file $file`;
+}
+
sub _build_fix_msg {
my $perltidyrc = shift or croak 'missing pararm: $perltidyrc';
my @files = @_ or die 'missing parameter: @files';