From 5933d98a86fff195883d6311e0ee3e5d170ffffb Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Fri, 11 Feb 2011 18:01:23 -0700 Subject: [PATCH] Added module installer to ./install. --- doc/CHANGELOG | 1 + install | 5 +++++ lib/Lib/Install.pm | 20 +++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 43278e0..3877d68 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Added module installer to ./install. * Added a module buildsys. * Added a QDB module. * SIGHUP now triggers a rehash. diff --git a/install b/install index 6fe2569..f8ff9e7 100755 --- a/install +++ b/install @@ -131,6 +131,11 @@ if (!-e "$Bin/build/ver") { } build($features); +println 'Done.'; + +println q{}; +installmods(); +println q{}; # Success! println "Done. Auto successfully installed."; diff --git a/lib/Lib/Install.pm b/lib/Lib/Install.pm index 9336509..13c1a1f 100644 --- a/lib/Lib/Install.pm +++ b/lib/Lib/Install.pm @@ -11,7 +11,7 @@ our $Bin = $Bin; our $VERSION = 1.00; our @ISA = qw(Exporter); -our @EXPORT = qw(println modfind build checkver checkcore); +our @EXPORT = qw(println modfind build checkver checkcore installmods); sub println { @@ -111,3 +111,21 @@ sub checkcore modfind('POSIX'); modfind('Time::Local'); } + +sub installmods +{ + print 'Would you like to install any official modules? [y/n] '; + my $response = ; + chomp $response; + if (lc $response eq 'y') { + println 'What modules would you like to install? (separate by commas)'; + println 'Available modules: Badwords, Bitly, Calc, EightBall, FML, HelloChan, IsItUp, QDB, SASLAuth, Weather'; + print '> '; + my $modules = ; chomp $modules; + $modules =~ s/ //g; + my @modst = split ',', $modules; + foreach (@modst) { + system "$Bin/bin/buildmod $_"; + } + } +}