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.
This crates the new object. Keys for %args:
%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
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.
/^perl@\d+\.tgz$/
_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.
_fetch_snapshot()
$self->{server} =~ m|^https?://| && $self->{sfile}
_fetch_snapshot_HTTP() simply invokes LWP::Simple::mirror().
_fetch_snapshot_HTTP()
LWP::Simple::mirror()
[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.
_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.
_extract_snapshot()
_extract_with_Archive_Tar() uses the Archive::Tar and Compress::Zlib modules to extract the snapshot. (This tested verry slow on my Linux box!)
_extract_with_Archive_Tar()
_extract_with_external() uses $self->{tar} as a sprintf() template to build a command. Yes that might be dangerous!
_extract_with_external()
$self->{tar}
Gunzip and extract the archive in $tgzfile using a small DCL script
$tgzfile
patch_a_snapshot() tries to fetch all the patches between $patch_number and perl-current and apply them. This requires a working patch program.
patch_a_snapshot()
$patch_number
perl-current
You should pass this extra information to Test::Smoke::Syncer::Snapshot->new():
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 )
_get_patches() sets up the FTP connection and gets all patches beyond $patch_number. Remember that patch numbers do not have to be consecutive.
_get_patches()
_apply_patches() calls the patch program to apply the patch and updates .patch accordingly.
_apply_patches()
@patch_list is a list of filenames of these patches.
@patch_list
Checks the unzip attribute to find out how to unzip the patch and uses the Test::Smoke::Patcher module to apply the patch.
_read_patch() unzips the patch and returns the contents.
_read_patch()
_fix_dot_patch() updates the .patch file with the new patch level.
_fix_dot_patch()
[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).
__get_directory_names()
$dir || cwd()
(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.
To install Test::Smoke, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Smoke
CPAN shell
perl -MCPAN -e shell install Test::Smoke
For more information on module installation, please visit the detailed CPAN module installation guide.