Joey Hess wrote: > Muharem Hrnjadovic wrote: >> sorry for not responding earlier. What would be the best way to perform >> the suggested full-archive test? > > * Clone pristine-tar git repo. > * git checkout origin/testsuite > * Use the testexternal target in the Makefile, which expects you to > provide it with `tars` file listing filenames of tar files to test. > (I use a local mirror to get those.) > > I'd run a test now, but my machine with the local mirror has had a disk > fail.
I have run the extension against appox. 1200 packages by now and fixed another few bugs (incremental diff enclosed). It will take some time to go through all of them .. will keep you posted. Best regards -- Muharem Hrnjadovic <muha...@ubuntu.com> Public key id : B2BBFCFC Key fingerprint : A5A3 CC67 2B87 D641 103F 5602 219F 6B60 B2BB FCFC
=== modified file 'Ptutils.pm' --- Ptutils.pm 2009-09-23 22:33:13 +0000 +++ Ptutils.pm 2009-09-24 13:16:55 +0000 @@ -44,12 +44,11 @@ use strict; use warnings; use Cwd qw(realpath); -use Encode qw(encode decode); use File::Find; use File::Spec::Functions qw(abs2rel canonpath catdir splitdir splitpath); use List::MoreUtils qw(zip); -my $debug=1; +my $debug=0; sub debug { message(@_) if $debug; @@ -76,6 +75,8 @@ chomp $_; # Strip off trailing slashes. s,/*$,,; + # Condense multiple slashes to one. + s,//+,/,; # Unicode code points (e.g. \201) are read as text i.e. as four # characters and *not* as a single byte. We convert them to bytes # here. @@ -84,6 +85,8 @@ } close IN; + # debug("\n\n\n-- TAR : $#manifest_entries", join(", ", @manifest_entries)); + # debug("\n\n\n-- DIR : $#paths_in_tree", join(", ", @paths_in_tree)); my @path_prefixes = normalizepaths(\...@paths_in_tree, \...@manifest_entries); if ($#path_prefixes < 0) { @@ -93,12 +96,14 @@ # Compare the paths found in the manifest with the ones in the local # local tree. + # debug("\n\n\n-- TAR : $#manifest_entries", join(", ", @manifest_entries)); + # debug("\n\n\n-- DIR : $#paths_in_tree", join(", ", @paths_in_tree)); my %seen; @seen {...@manifest_entries} = (); delete @seen {...@paths_in_tree}; @missing_in_tree = sort(keys %seen); - debug("Missing : $#missing_in_tree", join(", ", @missing_in_tree)); + # debug("Missing : $#missing_in_tree", join(", ", @missing_in_tree)); return \...@missing_in_tree; } @@ -135,8 +140,10 @@ my $paths_in_tree = shift; my $manifest_entries = shift; - # A list of all paths in local tree that are files. - my @local_files = grep { -f $_ } @$paths_in_tree; + # A list of all paths in local tree that are either files or links. The + # latter category is needed when packages don't contain a single proper + # file (example: binutils-z80_2.19.51.20090827-2). + my @local_files = grep { -f $_ || -l $_ } @$paths_in_tree; # Sort by base name frequency. sortbybasenamefrequency(\...@local_files); # The local path selected eventually. @@ -200,14 +207,16 @@ while(my ($prefix, $paths) = each(%pdata)) { # Do we need to strip off prefixes for this set of paths? if (length($prefix) > 0) { + # Escape regex meta chars in path prefixes (example: + # aptoncd-0.1.98+bzr112) + $prefix =~ s![+?*]!\\$&!g; + debug("\n\n\n## ", $prefix); map { $_ = canonpath($_); s,^$prefix/?,,; $_ } @$paths; - # Discard all paths that are substrings of the prefix. - @$paths = grep { index("$prefix/", $_) < 0 } @$paths; } } } - debug("\n** PPS: $#$prefixes", join(", ", @$prefixes)); + debug("\n\n\n** PPS: $#$prefixes", join(", ", @$prefixes)); return $prefixes; } === modified file 'pristine-tar' --- pristine-tar 2009-09-23 22:33:13 +0000 +++ pristine-tar 2009-09-23 23:06:08 +0000 @@ -205,17 +205,17 @@ my $source=shift; my %optio...@_; - my @manifest; - open (IN, "$tempdir/manifest") || die "$tempdir/manifest: $!"; - while (<IN>) { - chomp; + my @manifest; + open (IN, "$tempdir/manifest") || die "$tempdir/manifest: $!"; + while (<IN>) { + chomp; # Unicode code points (e.g. \201) are read as text i.e. as four # characters and *not* as a single byte. We convert them to bytes # here. s/\\(\d{3})/"chr(0$1)"/eeg; - push @manifest, $_; - } - close IN; + push @manifest, $_; + } + close IN; # The manifest and source should have the same filenames, # but the manifest probably has all the files under a common === modified file 't/gendelta.t' --- t/gendelta.t 2009-09-09 16:02:36 +0000 +++ t/gendelta.t 2009-09-24 12:43:41 +0000 @@ -98,8 +98,6 @@ # !! TEST SETUP !! # This mimics what would be found in the (pristine) tar file. my @manifest_entries = qw( - a/ - a/b/ a/b/apg-2.2.3.dfsg.1/ a/b/apg-2.2.3.dfsg.1/cast/ a/b/apg-2.2.3.dfsg.1/cast/cast.c
signature.asc
Description: OpenPGP digital signature