\n";
my %done;
my $count = 0;
foreach my $f (@files) {
next if ($done{$f->{'file'}});
print &ui_table_start("$f->{'file'}", "width=100%", 2);
print "
";
if (-d $f->{'file'} || $f->{'type'} == 1) {
# Is a directory
print &text('rollback_isdir');
}
elsif (-l $f->{'file'} && $f->{'type'} == 2 ||
!-e $f->{'file'} && $f->{'type'} == 2) {
# Was a link, and is one now
my $lnk = readlink($f->{'file'});
if (!-e $f->{'file'}) {
print &text('rollback_clink', "$f->{'data'}");
$count++;
}
elsif ($lnk ne $f->{'data'}) {
print &text('rollback_link', "$f->{'data'}", "$lnk");
$count++;
}
else {
print &text('rollback_nolink');
}
}
elsif (-e $f->{'file'} && -l $f->{'file'} &&
$f->{'type'} == 0) {
# Was a file, but is now a link
my $lnk = readlink($f->{'file'});
print &text('rollback_makefile', "$lnk");
print "$f->{'data'}";
$count++;
}
elsif (!-l $f->{'file'} && $f->{'type'} == 2) {
# Was a link, but is now a file
print &text('rollback_makelink', "$f->{'data'}");
$count++;
}
elsif ($f->{'type'} == -1) {
# Was created
if (-e $f->{'file'}) {
print &text('rollback_delete',
"$f->{'file'}");
$count++;
}
else {
print &text('rollback_nodelete',
"$f->{'file'}");
}
}
elsif (!-e $f->{'file'}) {
# No longer exists
print $text{'rollback_fillfile'};
print "$f->{'data'}";
$count++;
}
else {
# Was a file, and is one now
my $qnew = quotemeta($f->{'file'});
my $temp = &transname();
open(TEMP, ">$temp");
print TEMP $f->{'data'};
close(TEMP);
my $out = &backquote_command("diff $qnew $temp");
if ($out) {
print $text{'rollback_changes'};
print "$out ";
$count++;
}
else {
print $text{'rollback_nochanges'};
}
}
$done{$f->{'file'}}++;
print " |
\n";
print &ui_table_end();
print "