summaryrefslogtreecommitdiffstats
path: root/mdkonline.pm
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2004-11-04 19:00:11 +0000
committerDaouda Lo <daouda@mandriva.com>2004-11-04 19:00:11 +0000
commit206eb7008f39d733222a1a89703ca64c0f2b0bf7 (patch)
treeed708558a990fc5ac483a24d725bd315cafe8077 /mdkonline.pm
parent7ae1fd8e63cf72813b9013964617d49cc5f58201 (diff)
downloadmgaonline-206eb7008f39d733222a1a89703ca64c0f2b0bf7.tar
mgaonline-206eb7008f39d733222a1a89703ca64c0f2b0bf7.tar.gz
mgaonline-206eb7008f39d733222a1a89703ca64c0f2b0bf7.tar.bz2
mgaonline-206eb7008f39d733222a1a89703ca64c0f2b0bf7.tar.xz
mgaonline-206eb7008f39d733222a1a89703ca64c0f2b0bf7.zip
merge changes from MNF, MDK-10-update
Diffstat (limited to 'mdkonline.pm')
-rw-r--r--mdkonline.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index ac235e4c..994aaee5 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -13,13 +13,21 @@ use HTTP::Request::Common;
use HTTP::Request;
#Don't change version manually
-$::VERSION = '1.1-13mdk';
+$::VERSION = '1.1-20mdk';
+
+my $release_file = find { -f $_ } '/etc/mandrakelinux-release', '/etc/mandrake-release', '/etc/redhat-release';
sub get_release() {
- my ($release) = cat_('/etc/mandrake-release') =~ /release\s+(\S+)/;
+ my ($release) = cat_($release_file) =~ /release\s+(\S+)/;
($release)
}
+sub get_distro_type() {
+ my $d;
+ cat_($release_file) =~ /(corporate|mnf)/i, and $d = $1;
+ $d
+}
+
sub get_from_URL {
my ($link, $agent_name) = @_;
my $ua = LWP::UserAgent->new;
@@ -133,10 +141,9 @@ sub header { "
* $_[0]
********************************************************************************";
}
-my $releasefile = find { -f $_ } '/etc/mandrakelinux-release', '/etc/mandrake-release', '/etc/redhat-release';
output($file, map { chomp; "$_\n" }
header("rpm -qa"), join('', sort `rpm -qa`),
- header("mandrake version"), cat_($releasefile));
+ header("mandrake version"), cat_($release_file));
system("/usr/bin/bzip2 -f $file");
open(my $F, $file . ".bz2") or die "Cannot open file : $!";
my ($chunk, $buffer);