The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Test::Smoke::Syncer::Snapshot

This handles syncing from a snapshot with the Net::FTP module. It should only be visible from the "parent-package" so no direct user-calls on this.

Test::Smoke::Syncer::Snapshot->new( %args )

This crates the new object. Keys for %args:

  * ddir:    destination directory ( ./perl-current )
  * server:  the server to get the snapshot from ( public.activestate.com )
  * sdir:    server directory ( /pub/apc/perl-current-snap )
  * snapext: the extension used for snapdhots ( tgz )
  * tar:     howto untar ( Archive::Tar or 'gzip -d -c %s | tar x -' )
  * v:       verbose

$syncer->sync( )

Make a connection to the ftp server, change to the {sdir} directory. Get the list of snapshots (/^perl@\d+\.tgz$/) and determin the highest patchlevel. Fetch this file. Remove the current source-tree and extract the snapshot.

$syncer->_fetch_snapshot( )

_fetch_snapshot() checks to see if $self->{server} =~ m|^https?://| && $self->{sfile}. If so let LWP::Simple do the fetching else do the FTP thing.

$syncer->_fetch_snapshot_HTTP( )

_fetch_snapshot_HTTP() simply invokes LWP::Simple::mirror().

__find_snap_name( $ftp, $snapext[, $verbose] )

[Not a method!]

Get a list with all the perl@\d+ files, use an ST to sort these and return the one with the highes number.

$syncer->_extract_snapshot( )

_extract_snapshot() checks the tar attribute to find out how to extract the snapshot. This could be an external command or the Archive::Tar/Comperss::Zlib modules.

$syncer->_extract_with_Archive_Tar( )

_extract_with_Archive_Tar() uses the Archive::Tar and Compress::Zlib modules to extract the snapshot. (This tested verry slow on my Linux box!)

$syncer->_extract_with_external( )

_extract_with_external() uses $self->{tar} as a sprintf() template to build a command. Yes that might be dangerous!

__vms_untargz( $untargz, $tgzfile, $verbose )

Gunzip and extract the archive in $tgzfile using a small DCL script

$syncer->patch_a_snapshot( $patch_number )

patch_a_snapshot() tries to fetch all the patches between $patch_number and perl-current and apply them. This requires a working patch program.

You should pass this extra information to Test::Smoke::Syncer::Snapshot->new():

  * patchup:  should we do this? ( 0 )
  * pserver:  which FTP server? ( public.activestate.com )
  * pdir:     directory ( /pub/apc/perl-current-diffs )
  * unzip:    ( gzip ) [ Compress::Zlib ]
  * patchbin: ( patch )
  * cleanup:  remove patches after applied? ( 1 )

$syncer->_get_patches( [$patch_number] )

_get_patches() sets up the FTP connection and gets all patches beyond $patch_number. Remember that patch numbers do not have to be consecutive.

$syncer->_apply_patches( @patch_list )

_apply_patches() calls the patch program to apply the patch and updates .patch accordingly.

@patch_list is a list of filenames of these patches.

Checks the unzip attribute to find out how to unzip the patch and uses the Test::Smoke::Patcher module to apply the patch.

$syncer->_read_patch( $file )

_read_patch() unzips the patch and returns the contents.

$syncer->_fix_dot_patch( $new_level );

_fix_dot_patch() updates the .patch file with the new patch level.

__get_directory_names( [$dir] )

[This is not a method]

__get_directory_names() retruns all directory names from $dir || cwd(). It does not look at symlinks (there should not be any in the perl source-tree).

COPYRIGHT

(c) 2002-2013, All rights reserved.

  * Abe Timmerman <abeltje@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See:

  * <http://www.perl.com/perl/misc/Artistic.html>,
  * <http://www.gnu.org/copyleft/gpl.html>

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.