summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2005-09-15 17:40:15 +0000
committerDaouda Lo <daouda@mandriva.com>2005-09-15 17:40:15 +0000
commit48da3a2e3ee946ed944d772c3a6919a8d3cab8df (patch)
tree8c8c3178c5e3def5a7649d003f785992cd40e284
parent1bf180ae62a2ad6c5e1d20bc5251d10ce4f2b5ff (diff)
downloadmgaonline-48da3a2e3ee946ed944d772c3a6919a8d3cab8df.tar
mgaonline-48da3a2e3ee946ed944d772c3a6919a8d3cab8df.tar.gz
mgaonline-48da3a2e3ee946ed944d772c3a6919a8d3cab8df.tar.bz2
mgaonline-48da3a2e3ee946ed944d772c3a6919a8d3cab8df.tar.xz
mgaonline-48da3a2e3ee946ed944d772c3a6919a8d3cab8df.zip
- satisfy ancient distros
-rw-r--r--mdkonline.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index 836a1fcf..aa460f56 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -14,7 +14,7 @@ use HTTP::Request;
use SOAP::Lite;
#For debugging
-use Data::Dumper;
+#use Data::Dumper;
my $release_file = find { -f $_ } '/etc/mandriva-release', '/etc/mandrakelinux-release', '/etc/mandrake-release', '/etc/redhat-release';
my $uri = 'https://my.mandriva.com/soap/';
@@ -29,6 +29,20 @@ sub is_proxy () {
return 1 if defined $ENV{http_proxy};
}
+sub md5file {
+ require Digest::MD5;
+ my @md5 = map {
+ my $sum;
+ if (open(my $FILE, $_)) {
+ binmode($FILE);
+ $sum = Digest::MD5->new->addfile($FILE)->hexdigest;
+ close($FILE);
+ }
+ $sum;
+ } @_;
+ return wantarray() ? @md5 : $md5[0];
+}
+
sub get_release() {
my ($release) = cat_($release_file) =~ /release\s+(\S+)/;
($release)