SVN: toys/rsget.pl/RSGet/Main.pm
sparky
sparky at pld-linux.org
Sun Dec 5 16:38:26 CET 2010
Author: sparky
Date: Sun Dec 5 16:38:26 2010
New Revision: 11946
Modified:
toys/rsget.pl/RSGet/Main.pm
Log:
- kill -HUP to reexecute rsget.pl
Modified: toys/rsget.pl/RSGet/Main.pm
==============================================================================
--- toys/rsget.pl/RSGet/Main.pm (original)
+++ toys/rsget.pl/RSGet/Main.pm Sun Dec 5 16:38:26 2010
@@ -71,18 +71,19 @@
}
my $http = undef;
+my $argv;
sub init
{
my $help = shift;
my $main_rev = shift;
- my $argv = shift;
+ $argv = shift;
my $ifs = shift;
set_rev $main_rev;
print_help() if $help;
$SIG{CHLD} = "IGNORE";
- maybe_update( $argv );
+ maybe_update();
check_settings( \%main::settings );
#read_userconfig();
@@ -158,7 +159,6 @@
sub maybe_update
{
- my $argv = shift;
if ( setting( "use_svn" ) eq "update" ) {
if ( RSGet::AutoUpdate::update() ) {
warn "Update successful, restarting\n";
@@ -168,6 +168,23 @@
}
}
+my $restart = 0;
+sub restart
+{
+ $restart = 1;
+ RSGet::Line::print_all_lines();
+ printf "\n\nRestarting at %s\n\n", scalar localtime;
+ exit 0;
+}
+
+END {
+ if ( $restart ) {
+ exec $0, @$argv;
+ }
+}
+
+$SIG{HUP} = \&restart;
+
sub check_settings
{
my $settings = shift;
More information about the pld-cvs-commit
mailing list