~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to tests/libtest/test613.pl

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-02-08 11:20:41 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20080208112041-hed7sb5r6ghmjf8v
Tags: upstream-7.18.0
ImportĀ upstreamĀ versionĀ 7.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                # the one generated on a typical Linux installation):
70
70
                # -r-?r-?r-?   12 U         U              47 Dec 31  2000 rofile.txt
71
71
 
72
 
                my $newfile = $logfile . ".new";
 
72
                my @canondir;
73
73
                open(IN, "<$logfile") || die "$!";
74
 
                open(OUT, ">$newfile") || die "$!";
75
74
                while (<IN>) {
76
75
                        /^(.)(..).(..).(..).\s*(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+\s+\S+\s+\S+)(.*)$/;
77
76
                        if ($1 eq "d") {
78
77
                                # Erase all directory metadata except for the name, as it is not
79
78
                                # consistent for across all test systems and filesystems
80
 
                                print OUT "d?????????    N U         U               N ???  N NN:NN$8\n";
 
79
                                push @canondir, "d?????????    N U         U               N ???  N NN:NN$8\n";
81
80
                        } elsif ($1 eq "-") {
82
81
                                # Erase user and group names, as they are not consistent across
83
82
                                # all test systems
84
 
                                printf OUT "%s%s?%s?%s?%5d U         U %15d %s%s\n", $1,$2,$3,$4,$5,$6,$7,$8;
 
83
                                my $line = sprintf("%s%s?%s?%s?%5d U         U %15d %s%s\n", $1,$2,$3,$4,$5,$6,$7,$8);
 
84
                                push @canondir, $line;
85
85
                        } else {
86
86
                                # Unexpected format; just pass it through and let the test fail
87
 
                                print OUT $_;
 
87
                                push @canondir, $_;
88
88
                        }
89
89
                }
 
90
                close(IN);
90
91
 
 
92
                @canondir = sort {substr($a,57) cmp substr($b,57)} @canondir;
 
93
                my $newfile = $logfile . ".new";
 
94
                open(OUT, ">$newfile") || die "$!";
 
95
                print OUT join('', @canondir);
91
96
                close(OUT);
92
 
                close(IN);
93
97
 
94
98
                unlink $logfile;
95
99
                rename $newfile, $logfile;