Upstream: https://anonscm.debian.org/cgit/collab-maint/tardiff.git/tree/debian/patches/fix-unique-uniquebase.diff
Patch to allow to compare to tar balls with the same base
directory. Also fixes an issue with listing a directory as present in
the wrong tar ball.
Author: Axel Beckert <abe@debian.org>
|
|
|
80 | 80 | sub analyzetar{ |
81 | 81 | my $filelist = shift(@_); |
82 | 82 | my $filehash = shift(@_); |
| 83 | my $tarball = shift(@_); |
83 | 84 | |
84 | 85 | my %files = %{$filehash}; |
85 | 86 | |
… |
… |
|
92 | 93 | if(!$uniquebase){ |
93 | 94 | $uniquebase = $base; |
94 | 95 | }else{ |
95 | | ($base eq $uniquebase) or die "$tarball1 contains different base dirs: $base and $uniquebase"; |
| 96 | ($base eq $uniquebase) or die "$tarball contains different base dirs: $base and $uniquebase"; |
96 | 97 | } |
97 | 98 | if($files{$remainder}){ |
98 | 99 | $files{$remainder} = "__both"; |
99 | 100 | }else{ |
100 | | $files{$remainder} = "$uniquebase"; |
| 101 | $files{$remainder} = "$tarball"; |
101 | 102 | } |
102 | 103 | } |
103 | 104 | |
… |
… |
|
174 | 175 | |
175 | 176 | my %files; |
176 | 177 | |
177 | | my ($base1, %files) = analyzetar($filelist1, \%files); |
178 | | my ($base2, %files) = analyzetar($filelist2, \%files); |
| 178 | my ($base1, %files) = analyzetar($filelist1, \%files, $tarball1); |
| 179 | my ($base2, %files) = analyzetar($filelist2, \%files, $tarball2); |
179 | 180 | |
180 | 181 | foreach my $file(sort(keys(%files))){ |
181 | 182 | next if $file eq ""; |
… |
… |
|
196 | 197 | if($opt_list and not $modified){ |
197 | 198 | print " $file\n"; |
198 | 199 | } |
199 | | }elsif($base eq $base1){ |
| 200 | }elsif($base eq $tarball1){ |
200 | 201 | print "- $file\n"; |
201 | | }elsif($base eq $base2){ |
| 202 | }elsif($base eq $tarball2){ |
202 | 203 | print "+ $file\n"; |
203 | 204 | }else{ |
204 | 205 | print "? $file\n"; |