View | Details | Raw Unified
Collapse All | Expand All

(-) g-cpan.pl (-8 / +11 lines)
 Lines 5-10    Link Here 
#
#
# History: 
# History: 
# 01/08/03: jrray@gentoo.org: remove dependency on Digest::MD5
#
# 01/07/03: jrray@gentoo.org: getting the way subroutines are fed variables
# 01/07/03: jrray@gentoo.org: getting the way subroutines are fed variables
#	    sorted out (they're in @_)
#	    sorted out (they're in @_)
#	    Clean out module_check, unnecessary temp variables are evil.
#	    Clean out module_check, unnecessary temp variables are evil.
 Lines 47-53    Link Here 
use File::Spec;
use File::Spec;
use File::Path;
use File::Path;
use CPAN;
use CPAN;
use Digest::MD5;
eval 'use Digest::MD5;';
my $have_digestmd5 = $@ ? 0 : 1;
# output error if no arguments
# output error if no arguments
unless (@ARGV) {
unless (@ARGV) {
 Lines 241-256    Link Here 
    my $localfile = $pack->{localfile};
    my $localfile = $pack->{localfile};
    ( my $base = $file ) =~ s/.*\/(.*)/$1/;
    ( my $base = $file ) =~ s/.*\/(.*)/$1/;
    my $md5digest;
    if ($have_digestmd5) {
    open( DIGIFILE, $localfile ) or die "Can't open '$file': $!";
    open( DIGIFILE, $localfile ) or die "Can't open '$file': $!";
    binmode(DIGIFILE);
    binmode(DIGIFILE);
	    $md5digest = Digest::MD5->new->addfile(*DIGIFILE)->hexdigest;
    my $md5digest = Digest::MD5->new;
    while (<DIGIFILE>) {
        $md5digest->add($_);
    }
    close(DIGIFILE);
    close(DIGIFILE);
    } else {
    	    ($md5digest = qx(/usr/bin/md5sum $localfile)) =~ s/^(.*?)\s.*$/$1/s;
    }
    my $md5string = sprintf "MD5 %s %s %d", $md5digest->hexdigest, $base,
    my $md5string = sprintf "MD5 %s %s %d", $md5digest, $base,
      -s $localfile;
      -s $localfile;
    # make ebuilds for all the prereqs
    # make ebuilds for all the prereqs
 Lines 260-266    Link Here 
    create_ebuild( $obj, $dir, $file, $prereq_pm, $md5string );
    create_ebuild( $obj, $dir, $file, $prereq_pm, $md5string );
    push @ebuild_list, $dir;
    push @ebuild_list, $dir;
}
}
sub clean_up {
sub clean_up {