Skip to content

Commit

Permalink
Syncer copy: create .patch if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultduponchelle committed Feb 7, 2025
1 parent 2255040 commit 7d8fd65
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1.84 2025-??-??
- Syncer copy: Make .patch if not already there
- Explicit rsync protocol for default rsync URL
- Convert APC (deprecated) FTP to general purpose FTP sync:
- Make FTP Host and FTP Port configurable
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ t/ftppub/perl-current/t/op/skip.t
t/ftppub/perl-current/t/op/test.t
t/ftppub/perl-current/win32/Makefile
t/ftppub/perl-current/win32/makefile.mk
t/ftppub/perl-current/.patch
t/ftppub/pl_with_pn.h
t/ftppub/snap/[email protected]
t/ftppub/snap/[email protected]
Expand Down
13 changes: 13 additions & 0 deletions lib/Test/Smoke/Syncer/Copy.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package Test::Smoke::Syncer::Copy;
use warnings;
use strict;
use Cwd;

our $VERSION = '0.029';

Expand Down Expand Up @@ -43,6 +44,17 @@ sub sync {

$self->pre_sync;
require Test::Smoke::SourceTree;
my $cwd = getcwd;
if (! chdir $self->{cdir}) {
require Carp;
Carp::croak( "[copy] Cannot chdir($self->{cdir}): $!" );
};
$self->make_dot_patch if (! -e ".patch");

if (! chdir $cwd) {
require Carp;
Carp::croak( "[copy] Cannot chdir($cwd): $!" );
};

my $tree = Test::Smoke::SourceTree->new($self->{cdir}, $self->verbose);
$tree->copy_from_MANIFEST($self->{ddir});
Expand All @@ -51,6 +63,7 @@ sub sync {
$tree->clean_from_MANIFEST( 'MANIFEST.SKIP' );

my $plevel = $self->check_dot_patch;

$self->post_sync;
return $plevel;
}
Expand Down
1 change: 1 addition & 0 deletions t/ftppub/perl-current/.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blead 2025-02-03.21:11:03 37800ef622734ef3d18eddf53581505ff036f4b6 v5.41.8-33-g37800ef622
Binary file modified t/ftppub/snap/[email protected]
Binary file not shown.
Binary file modified t/ftppub/snap/[email protected]
Binary file not shown.
2 changes: 1 addition & 1 deletion t/patcher_forest.t
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SKIP: {
my $syncer = Test::Smoke::Syncer->new( forest => %config );
ok my $pl = $syncer->sync, "Forest planted" or
skip "No source forest ($tmpdir)", $to_skip -= 4;
is $pl, '20000', "patchlevel $pl";
is $pl, '37800ef622734ef3d18eddf53581505ff036f4b6', "patchlevel $pl";
$has_forest = 1;

local *PINFO;
Expand Down
2 changes: 1 addition & 1 deletion t/smoker.t
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ EOOUT
} );
isa_ok $syncer, 'Test::Smoke::Syncer::Copy';
my $patch = $syncer->sync;
is $patch, '20000', "Patchlevel: $patch";
is $patch, '37800ef622734ef3d18eddf53581505ff036f4b6', "Patchlevel: $patch";

my $skip_tests = catfile 't', 'MANIFEST.NOTEST';
my %config = (
Expand Down
2 changes: 1 addition & 1 deletion t/syncer_rsync.t
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ SKIP: {
);
isa_ok($rsync, 'Test::Smoke::Syncer::Rsync');
my $result = $rsync->sync;
is($result, 20000, "->sync returned a patchlevel");
is($result, '37800ef622734ef3d18eddf53581505ff036f4b6', "->sync returned a patchlevel");
require Test::Smoke::SourceTree;
my $st = Test::Smoke::SourceTree->new($ddir, $verbose);
my $check = $st->check_MANIFEST;
Expand Down

0 comments on commit 7d8fd65

Please sign in to comment.