Newer
Older

Andre Maroneze
committed
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
my $Obj= getObjPkg($Root);
no strict 'refs';
for my $meth ( qw( new getObjPkg ) ) {
*{$Root."::".$meth} = \&{$meth};
*{$Obj ."::".$meth} = \&{$meth};
}
for my $meth ( qw(
Next Prev Reset Copy Base Diff
Same Items Range Min Max Get
_ChkPos _ChkSeq
) ) {
*{$Obj."::".$meth} = \&{$meth};
}
1;
# This version released by Tye McQueen (http://perlmonks.org/?node=tye).
#
# =head1 LICENSE
#
# Parts Copyright (c) 2000-2004 Ned Konz. All rights reserved.
# Parts by Tye McQueen.
#
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl.
#
# =head1 MAILING LIST
#
# Mark-Jason still maintains a mailing list. To join a low-volume mailing
# list for announcements related to diff and Algorithm::Diff, send an
# empty mail message to mjd-perl-diff-request@plover.com.
# =head1 CREDITS
#
# Versions through 0.59 (and much of this documentation) were written by:
#
# Mark-Jason Dominus, mjd-perl-diff@plover.com
#
# This version borrows some documentation and routine names from
# Mark-Jason's, but Diff.pm's code was completely replaced.
#
# This code was adapted from the Smalltalk code of Mario Wolczko
# <mario@wolczko.com>, which is available at
# ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st
#
# C<sdiff> and C<traverse_balanced> were written by Mike Schilli
# <m@perlmeister.com>.
#
# The algorithm is that described in
# I<A Fast Algorithm for Computing Longest Common Subsequences>,
# CACM, vol.20, no.5, pp.350-353, May 1977, with a few
# minor improvements to improve the speed.
#
# Much work was done by Ned Konz (perl@bike-nomad.com).
#
# The OO interface and some other changes are by Tye McQueen.
#
EOAlgDiff
# 2}}}
my $problems = 0;
$HAVE_Algorithm_Diff = 0;
my $dir = "";
if ($opt_sdir) {
++$TEMP_OFF;
$dir = "$opt_sdir/$TEMP_OFF";
File::Path::rmtree($dir) if is_dir($dir);
File::Path::mkpath($dir) unless is_dir($dir);
} else {
# let File::Temp create a suitable temporary directory
$dir = tempdir( CLEANUP => 1 ); # 1 = delete on exit
$TEMP_INST{ $dir } = "Algorithm::Diff";
}
print "Using temp dir [$dir] to install Algorithm::Diff\n" if $opt_v;
my $Algorithm_dir = "$dir/Algorithm";
my $Algorithm_Diff_dir = "$dir/Algorithm/Diff";
mkdir $Algorithm_dir ;
mkdir $Algorithm_Diff_dir;
my $OUT = open_file('>', "$dir/Algorithm/Diff.pm", 1);
if (defined $OUT) {
print $OUT $Algorithm_Diff_Contents;
$OUT->close;
} else {
warn "Failed to install Algorithm/Diff.pm\n";
$problems = 1;
}
push @INC, $dir; # between this & Regexp::Common only need to do once
eval "use Algorithm::Diff qw / sdiff /";
$HAVE_Algorithm_Diff = 1 unless $problems;
} # 1}}}
__END__
mode values (stat $item)[2]
Unix Windows
file: 33188 33206
dir : 16832 16895
link: 33261 33206
pipe: 4544 null