diff options
author | Daouda Lo <daouda@mandriva.com> | 2002-02-05 07:35:29 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2002-02-05 07:35:29 +0000 |
commit | 5d0c71cf47d74cdba7dc6cb8cead45f7c6e1dd8e (patch) | |
tree | 144c847ef976b1b0b0da57b0b2fd9721bd198041 | |
parent | f3f0a366d6a66f651f849b7efa04b9371cf67675 (diff) | |
download | mgaonline-5d0c71cf47d74cdba7dc6cb8cead45f7c6e1dd8e.tar mgaonline-5d0c71cf47d74cdba7dc6cb8cead45f7c6e1dd8e.tar.gz mgaonline-5d0c71cf47d74cdba7dc6cb8cead45f7c6e1dd8e.tar.bz2 mgaonline-5d0c71cf47d74cdba7dc6cb8cead45f7c6e1dd8e.tar.xz mgaonline-5d0c71cf47d74cdba7dc6cb8cead45f7c6e1dd8e.zip |
- add mdkupdate automotical update
-rwxr-xr-x | mdkupdate | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/mdkupdate b/mdkupdate new file mode 100755 index 00000000..c47fe730 --- /dev/null +++ b/mdkupdate @@ -0,0 +1,77 @@ +#!/usr/bin/perl +################################################################################ +# Mdkupdate # +# # +# Copyright (C) 2002 MandrakeSoft # +# +# Daouda Lo <daouda@mandrakesoft.com> # +# # +# This program is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License Version 2 as # +# published by the Free Software Foundation. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # +################################################################################ + +use POSIX; +use Digest::MD5 qw(md5 md5_hex md5_base64); +use HTTP::Request; +use HTTP::Request::Common; +use LWP::UserAgent; +use MDK::Common; +use Locale::GetText; + +#- I18N. +setlocale (LC_ALL, ""); +Locale::GetText::textdomain ("mdkupdate"); + +sub _ { + my ($format, @params) = @_; + sprintf(Locale::GetText::I_($format), @params); +} + +my $VERSION = "0.16"; +my $security = 0; + +sub usage { + print STDERR _("mdkupdate version %s +Copyright (C) 2002 MandrakeSoft. +This is free software and may be redistributed under the terms of the GNU GPL. + +usage: +") . _(" --help - print this help message. +") . _(" --security - use only security media. +") . _(" -v - verbose mode. +", $VERSION ); + exit(0); +} + +sub parse_file { + my ($file)=@_; + my @list_hosts; + open( FILE, $file ) or die "load_text: missing file $file : $!"; + while (<FILE>) { + chomp; + unshift(@list_hosts,$_); + } + close( FILE ); + reverse @list_hosts; +} + +sub log_it { + local *LOG; + open LOG, ">>/var/log/mdkupdate.log" or die "can't output to log file\n"; + print LOG @_; +} + +sub fatal { + my ($comment)=@_; + printf STDERR "%s\n", $comment; exit($_[0]); +} |