Skip Menu |

This queue is for tickets about the Archive-Tar CPAN distribution.

Report information
The Basics
Id: 13658
Status: resolved
Priority: 0/
Queue: Archive-Tar

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] a "tardiff" program
Hi Kane, Here's a really useful short program that I always wanted to write and finally got around to. It lets me download a tarball, expand it and make changes, then diff the changes against the original tarball. It was really easy using Archive::Tar, so I thought I'd share it - I thought it might make a nice addition to the Archive::Tar distribution. --------------------------- #!/usr/bin/perl use strict; use Archive::Tar; use Text::Diff; my $tar = shift or die "Usage: $0 <tarfile>\n"; my $compressed = $tar =~ /\.t?gz$/; $tar = Archive::Tar->new($tar, $compressed) or die "Couldn't read tar file: $!"; my @files = $tar->get_files; foreach my $file (@files) { next unless $file->is_file; my $name = $file->name; diff( \($file->get_content), $name, {FILENAME_A => $name, MTIME_A => $file->mtime, OUTPUT => \*STDOUT} ); }
[KWILLIAMS - Tue Jul 12 09:23:51 2005]: Show quoted text
> Hi Kane, > > Here's a really useful short program that I always wanted to write and > finally got around to. It lets me download a tarball, expand it > and make changes, then diff the changes against the original > tarball. It was really easy using Archive::Tar, so I thought I'd > share it - I thought it might make a nice addition to the > Archive::Tar distribution.
That's a very nice idea indeed! And it works like a charm. I've added this program in a slightly modified for as @12172. I've also updated the Makefile.PL to accept a flag to add Text::Diff as a prereq if the user desires this, and made the diagnostics of 'ptardiff' (as it's dubbed) be informative on what to do when Text::Diff is missing. Thanks again for the idea, it's a very nice one indeed. Expect this to be part of Archive::Tar 1.25 (to be released soon)