diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 16:20:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 16:20:26 +0000 |
commit | 761d244245fbb10dcfd79208150b0b5f6b93cb04 (patch) | |
tree | 76d74cc10f18d2b67667eb004816a9e95f6e45f2 /urpm/util.pm | |
parent | 190ab2c006dd503413775aabd6af940a72df8239 (diff) | |
download | urpmi-761d244245fbb10dcfd79208150b0b5f6b93cb04.tar urpmi-761d244245fbb10dcfd79208150b0b5f6b93cb04.tar.gz urpmi-761d244245fbb10dcfd79208150b0b5f6b93cb04.tar.bz2 urpmi-761d244245fbb10dcfd79208150b0b5f6b93cb04.tar.xz urpmi-761d244245fbb10dcfd79208150b0b5f6b93cb04.zip |
create urpm::md5sum, move md5sum functions into it:
- urpm::util::md5sum() -> urpm::md5sum::compute()
- urpm::local_md5sum() -> urpm::md5sum::on_local_medium()
Diffstat (limited to 'urpm/util.pm')
-rw-r--r-- | urpm/util.pm | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/urpm/util.pm b/urpm/util.pm index b12c49a0..58922349 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -8,7 +8,7 @@ our @ISA = 'Exporter'; our @EXPORT = qw(quotespace unquotespace remove_internal_name reduce_pathname offset_pathname - md5sum untaint + untaint copy_and_own same_size_and_mtime difference2 member file_size cat_ dirname basename @@ -87,21 +87,6 @@ sub untaint { @r == 1 ? $r[0] : @r; } -sub md5sum { - my ($file) = @_; - eval { require Digest::MD5 }; - if ($@) { - #- Use an external command to avoid depending on perl - return (split ' ', `/usr/bin/md5sum '$file'`)[0]; - } else { - my $ctx = Digest::MD5->new; - open my $fh, $file or return ''; - $ctx->addfile($fh); - close $fh; - return $ctx->hexdigest; - } -} - sub copy { my ($file, $dest) = @_; !system("/bin/cp", "-p", "-L", "-R", $file, $dest); |