summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-07-18 10:22:25 +0000
committerOlivier Blin <oblin@mandriva.org>2005-07-18 10:22:25 +0000
commitc370ecb4e00dba76401c2369e9342bafa534bd69 (patch)
treeabc3a0902ce38c2164559fb5b90bee8ea37f67c6
parent7ecdbcfdf1ef841842489456649d0787d978a6e1 (diff)
downloaddrakx-c370ecb4e00dba76401c2369e9342bafa534bd69.tar
drakx-c370ecb4e00dba76401c2369e9342bafa534bd69.tar.gz
drakx-c370ecb4e00dba76401c2369e9342bafa534bd69.tar.bz2
drakx-c370ecb4e00dba76401c2369e9342bafa534bd69.tar.xz
drakx-c370ecb4e00dba76401c2369e9342bafa534bd69.zip
import md5file from net_applet/mdkonline/userdrake
-rw-r--r--perl-install/common.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index d05c1afd9..3ce56f91f 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -297,4 +297,18 @@ sub unpack_with_refs {
@r;
}
+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];
+}
+
1;