SVN: toys/rsget.pl/RSGet: Curl.pm Main.pm
sparky
sparky at pld-linux.org
Sat Jul 17 21:55:13 CEST 2010
Author: sparky
Date: Sat Jul 17 21:55:12 2010
New Revision: 11680
Modified:
toys/rsget.pl/RSGet/Curl.pm
toys/rsget.pl/RSGet/Main.pm
Log:
- print workdir and outdir paths with --verbose=1 or above
Modified: toys/rsget.pl/RSGet/Curl.pm
==============================================================================
--- toys/rsget.pl/RSGet/Curl.pm (original)
+++ toys/rsget.pl/RSGet/Curl.pm Sat Jul 17 21:55:12 2010
@@ -57,7 +57,7 @@
);
-my $curl_multi = new WWW::Curl::Multi;
+my $curl_multi;
my $curl_headers = [
'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10',
@@ -106,6 +106,21 @@
}
}
+sub init
+{
+ $curl_multi = new WWW::Curl::Multi;
+ require Cwd;
+
+ if ( verbose( 1 ) ) {
+ p "Using paths:";
+ foreach ( qw(workdir outdir) ) {
+ my $dir = Cwd::abs_path( setting( $_ ) );
+ my $mkdir = "";
+ $mkdir = " (will be created)" unless -d $dir;
+ p " $_ => $dir$mkdir";
+ }
+ }
+}
sub new
{
Modified: toys/rsget.pl/RSGet/Main.pm
==============================================================================
--- toys/rsget.pl/RSGet/Main.pm (original)
+++ toys/rsget.pl/RSGet/Main.pm Sat Jul 17 21:55:12 2010
@@ -20,7 +20,6 @@
use RSGet::Tools;
use RSGet::Wait;
use Time::HiRes;
-use Cwd;
set_rev qq$Id$;
def_settings(
@@ -78,6 +77,7 @@
my $daemon = setting( "daemon" );
RSGet::Line::init( $daemon );
print_settings() if verbose( 1 );
+ RSGet::Curl::init();
RSGet::FileList::set_file();
set_interfaces( $ifs );
@@ -87,7 +87,8 @@
if ( $daemon == 2 ) {
- my $start_dir = getcwd();
+ require Cwd;
+ my $start_dir = Cwd::getcwd();
require Proc::Daemon;
print "starting rsget.pl daemon\n" if verbose( 1 );
Proc::Daemon::Init();
More information about the pld-cvs-commit
mailing list