--- libdigest-perl-1.10.orig/debian/watch +++ libdigest-perl-1.10/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://www.cpan.org/modules/by-module/Digest/Digest-(.*)\.tar\.gz --- libdigest-perl-1.10.orig/debian/changelog +++ libdigest-perl-1.10/debian/changelog @@ -0,0 +1,41 @@ +libdigest-perl (1.10-1) unstable; urgency=low + + * New Upstream version. Closes: #303593. + * Updated watch file. + + -- Matthias Urlichs Thu, 14 Apr 2005 19:58:54 +0200 + +libdigest-perl (1.08-2) unstable; urgency=low + + * New maintainer. Closes: #274128. + * Fixed spelling errors in the description. + * Fixed dependency on debhelper (>=4.0). + * Added debian/watch file. + + -- Matthias Urlichs Sat, 2 Oct 2004 13:47:57 +0200 + +libdigest-perl (1.08-1) unstable; urgency=low + + * New upstream version. + * Update for later standards. + + -- Michael Alan Dorman Mon, 2 Aug 2004 16:16:24 -0400 + +libdigest-perl (1.00-3) unstable; urgency=low + + * Fix override disparity. + + -- Michael Alan Dorman Fri, 15 Aug 2003 18:47:01 -0400 + +libdigest-perl (1.00-2) unstable; urgency=low + + * Correct lack of references to licenses. (closes: bug#157576) + + -- Michael Alan Dorman Fri, 15 Aug 2003 15:42:23 -0400 + +libdigest-perl (1.00-1) unstable; urgency=low + + * Initial debianization. + + -- Michael Alan Dorman Wed, 18 Apr 2001 21:34:50 -0400 + --- libdigest-perl-1.10.orig/debian/rules +++ libdigest-perl-1.10/debian/rules @@ -0,0 +1,63 @@ +#!/usr/bin/make -f +# -*- Makefile -*- + +# Use debhelper V. 4 + +PERL ?= /usr/bin/perl + +b := $(shell pwd)/debian/libdigest-perl + +arrange: arrange-stamp +arrange-stamp: install + dh_testdir + dh_installdirs + touch arrange-stamp + +binary: binary-stamp +binary-stamp: binary-indep binary-arch + dh_testdir + touch binary-stamp + +binary-arch: binary-arch-stamp +binary-arch-stamp: arrange + dh_testdir + touch binary-arch-stamp + +binary-indep: binary-indep-stamp +binary-indep-stamp: arrange + dh_testdir + dh_testroot + dh_installdocs -n README + dh_installexamples + dh_installchangelogs Changes + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_perl + dh_gencontrol + dh_md5sums + dh_builddeb + touch binary-indep-stamp + +build: build-stamp +build-stamp: + dh_testdir + $(PERL) Makefile.PL INSTALLDIRS=vendor + $(MAKE) + $(MAKE) test + touch build-stamp + +clean: + dh_testdir + dh_testroot + if [ -e Makefile ]; then $(MAKE) -i distclean; fi + dh_clean arrange-stamp binary-stamp binary-arch-stamp binary-indep-stamp build-stamp install-stamp + +install: install-stamp +install-stamp: build + dh_testdir + $(MAKE) install PREFIX=$(b)/usr + touch install-stamp + +.PHONY: arrange binary binary-arch binary-indep build clean install --- libdigest-perl-1.10.orig/debian/compat +++ libdigest-perl-1.10/debian/compat @@ -0,0 +1 @@ +4 --- libdigest-perl-1.10.orig/debian/copyright +++ libdigest-perl-1.10/debian/copyright @@ -0,0 +1,25 @@ +This is Debian GNU/Linux's prepackaged version of Digest. This is a +perl library implementing a generic interface to message-digest +algorithms. + +This package was put together by Michael Alan Dorman . +It is now maintained by Matthias Urlichs . + +The original sources should always be available from the Comprehensive Perl +Archive Network (CPAN). Visit to find a CPAN +site near you. + +The only change for the Debian package was the addition of the debian/ +files. + +The Digest copright is as follows: + +Copyright 1998-2001 Gisle Aas. +Copyright 1995-1996 Neil Winton. + +This library is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +Larry Wall's "Artistic License" for perl can be found in +/usr/share/common-licenses/Artistic, and the GPL can be found in +/usr/share/common-licenses/GPL-2. --- libdigest-perl-1.10.orig/debian/control +++ libdigest-perl-1.10/debian/control @@ -0,0 +1,16 @@ +Source: libdigest-perl +Maintainer: Matthias Urlichs +Section: perl +Priority: optional +Build-Depends-Indep: debhelper (>= 4.0), perl (>= 5.6.0-17), libdigest-md5-perl | perl (>= 5.8) +Standards-Version: 3.6.1 + +Package: libdigest-perl +Section: perl +Priority: optional +Architecture: all +Depends: ${perl:Depends}, libdigest-md5-perl | perl (>= 5.8) +Description: generic interface to message digest modules + This is a simple frontend module for autoloading various Digest::* + modules. It also provides documentation of the interface that all + Digest::* modules should provide. --- libdigest-perl-1.10.orig/Changes +++ libdigest-perl-1.10/Changes @@ -1,3 +1,20 @@ +2004-11-08 Gisle Aas + + Release 1.10 + + Added Digest::file module which provide convenience functions + that calculate digests of files. + + + +2004-11-05 Gisle Aas + + Release 1.09 + + Fix trivial documentation typo. + + + 2004-04-29 Gisle Aas Release 1.08 --- libdigest-perl-1.10.orig/Digest.pm +++ libdigest-perl-1.10/Digest.pm @@ -3,7 +3,7 @@ use strict; use vars qw($VERSION %MMAP $AUTOLOAD); -$VERSION = "1.08"; +$VERSION = "1.10"; %MMAP = ( "SHA-1" => ["Digest::SHA1", ["Digest::SHA", 1], ["Digest::SHA2", 1]], --- libdigest-perl-1.10.orig/MANIFEST +++ libdigest-perl-1.10/MANIFEST @@ -1,9 +1,11 @@ Changes Digest.pm Digest/base.pm +Digest/file.pm digest-bench MANIFEST Makefile.PL README t/base.t t/digest.t +t/file.t --- libdigest-perl-1.10.orig/Digest/file.pm +++ libdigest-perl-1.10/Digest/file.pm @@ -0,0 +1,85 @@ +package Digest::file; + +use strict; + +use Exporter (); +use Carp qw(croak); +use Digest (); + +use vars qw($VERSION @ISA @EXPORT_OK); + +$VERSION = "0.01"; +@ISA = qw(Exporter); +@EXPORT_OK = qw(digest_file_ctx digest_file digest_file_hex digest_file_base64); + +sub digest_file_ctx { + my $file = shift; + croak("No digest algorithm specified") unless @_; + local *F; + open(F, $file) || croak("Can't open '$file': $!"); + binmode(F); + my $ctx = Digest->new(@_); + $ctx->addfile(*F); + close(F); + return $ctx; +} + +sub digest_file { + digest_file_ctx(@_)->digest; +} + +sub digest_file_hex { + digest_file_ctx(@_)->hexdigest; +} + +sub digest_file_base64 { + digest_file_ctx(@_)->b64digest; +} + +1; + +__END__ + +=head1 NAME + +Digest::file - Calculate digests of files + +=head1 SYNOPSIS + + # Poor mans "md5sum" command + use Digest::file qw(digest_file_hex); + for (@ARGV) { + print digest_file_hex($_, "MD5"), " $_\n";e + } + +=head1 DESCRIPTION + +This module provide 3 convenience functions to calculate the digest +of files. The following functions are provided: + +=over + +=item digest_file( $file, $algorithm, [$arg,...] ) + +This function will calculate and return the binary digest of the bytes +of the given file. The function will croak if it fails to open or +read the file. + +The $algorithm is a string like "MD2", "MD5", "SHA-1", "SHA-512". +Additional arguments are passed to the constructor for the +implementation of the given algorithm. + +=item digest_file_hex( $file, $algorithm, [$arg,...] ) + +Same as digest_file(), but return the digest in hex form. + +=item digest_file_base64( $file, $algorithm, [$arg,...] ) + +Same as digest_file(), but return the digest as a base64 encoded +string. + +=back + +=head1 SEE ALSO + +L --- libdigest-perl-1.10.orig/Digest/base.pm +++ libdigest-perl-1.10/Digest/base.pm @@ -72,7 +72,7 @@ Digest::base - Digest base class -=head1 SYNPOSIS +=head1 SYNOPSIS package Digest::Foo; use base 'Digest::base'; --- libdigest-perl-1.10.orig/t/file.t +++ libdigest-perl-1.10/t/file.t @@ -0,0 +1,46 @@ +#!perl -w + +use Test qw(plan ok); +plan tests => 5; + +{ + package Digest::Foo; + require Digest::base; + use vars qw(@ISA $VERSION); + @ISA = qw(Digest::base); + + sub new { + my $class = shift; + my $str = ""; + bless \$str, $class; + } + + sub add { + my $self = shift; + $$self .= join("", @_); + return $self; + } + + sub digest { + my $self = shift; + return sprintf "%04d", length($$self); + } +} + +use Digest::file qw(digest_file digest_file_hex digest_file_base64); + +my $file = "test-$$"; +die if -f $file; +open(F, ">$file") || die "Can't create '$file': $!"; +binmode(F); +print F "foo\0\n"; +close(F) || die "Can't write '$file': $!"; + +ok(digest_file($file, "Foo"), "0005"); +ok(digest_file_hex($file, "Foo"), "30303035"); +ok(digest_file_base64($file, "Foo"), "MDAwNQ"); + +unlink($file) || warn "Can't unlink '$file': $!"; + +ok(eval { digest_file("not-there.txt", "Foo") }, undef); +ok($@);