diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-07-18 10:22:25 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-07-18 10:22:25 +0000 |
commit | c370ecb4e00dba76401c2369e9342bafa534bd69 (patch) | |
tree | abc3a0902ce38c2164559fb5b90bee8ea37f67c6 | |
parent | 7ecdbcfdf1ef841842489456649d0787d978a6e1 (diff) | |
download | drakx-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.pm | 14 |
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; |