diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2008-10-24 16:50:28 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2008-10-24 16:50:28 +0000 |
commit | 4d4b42276fd25bb4bb1b24a896a1d806d10f10e2 (patch) | |
tree | cd0a29aea496df30a820391cbebc677616e94db5 | |
parent | bf4fbd9a9c359b0e45dbe70f13de1e2f4c18a573 (diff) |
tweak compute_digest so that it `defaults' if invoked without a 2nd argument.
switch the default digest to sha256.
It's been there for a few weeks, all package tools cope with both formats,
now is the time for the switch.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 3 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Replace.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_create | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 8a6c007d6b7..e9b7ec20c8e 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.150 2008/10/20 10:25:16 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.151 2008/10/24 16:50:27 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -254,6 +254,7 @@ sub compute_digest { my ($self, $filename, $class) = @_; require OpenBSD::md5; + $class = 'OpenBSD::sha' if !defined $class; return $class->new($filename); } diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm index ee7cba234c9..a3270f913c1 100644 --- a/usr.sbin/pkg_add/OpenBSD/Replace.pm +++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Replace.pm,v 1.46 2008/10/07 06:29:36 espie Exp $ +# $OpenBSD: Replace.pm,v 1.47 2008/10/24 16:50:27 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -452,7 +452,7 @@ sub save_old_libraries close $descr; my $f = OpenBSD::PackingElement::FDESC->add($stub_list, DESC); $f->{ignore} = 1; - $f->add_digest($f->compute_digest($dest.DESC, 'OpenBSD::md5')); + $f->add_digest($f->compute_digest($dest.DESC)); $stub_list->to_installation; $o->{plist}->to_installation; } diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create index 0343fb4dc90..ceec40fe428 100644 --- a/usr.sbin/pkg_add/pkg_create +++ b/usr.sbin/pkg_add/pkg_create @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_create,v 1.118 2008/10/06 09:36:17 espie Exp $ +# $OpenBSD: pkg_create,v 1.119 2008/10/24 16:50:27 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -93,7 +93,7 @@ sub compute_checksum $result->make_hardlink($stash->{"$dev/$ino"}); } else { $stash->{"$dev/$ino"} = $name; - $result->add_digest($self->compute_digest($fname, 'OpenBSD::md5')); + $result->add_digest($self->compute_digest($fname)); $result->add_size($size); } } else { |