[svk-commit] r2446 - in branches/i18n-fixes: . lib/SVK pkg t/api
t/mirror
nobody at bestpractical.com
nobody at bestpractical.com
Sun Jul 15 13:25:50 EDT 2007
Author: clkao
Date: Sun Jul 15 13:25:50 2007
New Revision: 2446
Added:
branches/i18n-fixes/pkg/buildsvk.pl (contents, props changed)
branches/i18n-fixes/pkg/maketest
branches/i18n-fixes/pkg/svk-wrapper (contents, props changed)
Modified:
branches/i18n-fixes/ (props changed)
branches/i18n-fixes/lib/SVK/XD.pm
branches/i18n-fixes/t/02basic-symlink.t
branches/i18n-fixes/t/05svm-branches.t
branches/i18n-fixes/t/07smerge-rename.t
branches/i18n-fixes/t/72sign.t
branches/i18n-fixes/t/api/root.t
branches/i18n-fixes/t/mirror/sync-crazy-replace.t
Log:
merge down for i18n fixes branch.
Modified: branches/i18n-fixes/lib/SVK/XD.pm
==============================================================================
--- branches/i18n-fixes/lib/SVK/XD.pm (original)
+++ branches/i18n-fixes/lib/SVK/XD.pm Sun Jul 15 13:25:50 2007
@@ -500,7 +500,7 @@
=item find_repos_from_co_maybe
Like C<find_repos_from_co>, but falls back to see if the given path is
-a depotpath. In that case, the checkout paths returned iwll be undef.
+a depotpath. In that case, the checkout paths returned will be undef.
=cut
Added: branches/i18n-fixes/pkg/buildsvk.pl
==============================================================================
--- (empty file)
+++ branches/i18n-fixes/pkg/buildsvk.pl Sun Jul 15 13:25:50 2007
@@ -0,0 +1,229 @@
+#!perl
+
+use strict;
+use warnings;
+use Cwd 'abs_path';
+use File::Copy 'move';
+
+use File::Spec;
+
+=head1 NAME
+
+buildsvk.pl - packaging svk
+
+=head1 SYNOPSIS
+
+
+
+=head1 DESCRIPTION
+
+Put the dist files under src and C<buildsvk.pl> will create a build
+directory with everything installed under it.
+
+=cut
+
+my $build = SVK::Build->new;
+
+my $t = time();
+
+$build->prepare_perl();
+$build->prepare_svn_core();
+
+$build->build_module('libwin32', 'Console') if $^O eq 'MSWin32';
+
+$build->build_module($_) for qw(Scalar-List-Utils Class-Autouse version Sub-Uplevel Test-Simple Test-Exception Data-Hierarchy PerlIO-via-dynamic PerlIO-via-symlink SVN-Simple PerlIO-eol Algorithm-Diff Algorithm-Annotate Pod-Escapes Pod-Simple IO-Digest TimeDate Getopt-Long Encode PathTools YAML-Syck Locale-Maketext-Simple App-CLI List-MoreUtils Path-Class Class-Data-Inheritable Class-Accessor UNIVERSAL-require File-Temp Log-Log4perl);
+$build->build_module($_) for qw(Locale-Maketext-Lexicon TermReadKey IO-Pager);
+$build->build_module($_) for qw(File-chdir SVN-Mirror);
+$build->build_module($_) for qw(FreezeThaw);
+
+if (shift) {
+ $build->perlmake_install("..");
+ $build->prepare_dist("..");
+}
+else {
+ $build->build_module('SVK');
+ $build->prepare_dist(glob($build->build_dir.'/SVK-*'));
+}
+
+
+warn 'build finished - '.(time() - $t);
+
+exit 0;
+
+package SVK::Build;
+use Archive::Extract;
+use Env::Path;
+use File::Path (qw(mkpath rmtree));
+use File::chdir;
+use File::Copy 'copy';
+
+sub prepare_perl { 1 };
+sub prepare_svn_core {
+ my $self = shift;
+ my $output = `ldd \`which svn\``;
+ for ($output =~ m/^.*$/mg) {
+ my ($lib, $file) = m/(\S.*?) => (\S.*?)\s/ or next;
+ if ($lib =~ m/libsvn_*/) {
+ warn "$lib $file";
+ copy($file, $self->build_dir);
+ }
+ }
+}
+
+sub build_dir {
+ '/tmp/svk-build/dest';
+}
+
+sub build_base {
+ '/tmp/svk-build';
+}
+
+sub prepare_build_dir {
+ my $self = shift;
+ mkpath [$self->build_dir];
+}
+
+sub new {
+ my $class = shift;
+ if ($^O eq 'MSWin32') {
+ $class .= '::Win32';
+ }
+
+ my $self = bless {}, $class;
+ $self->prepare_build_dir;
+ return $self;
+}
+
+
+sub extract {
+ my $self = shift;
+ my $ae = Archive::Extract->new( archive => shift );
+
+ $ae->extract( to => $self->build_base )
+ or die $ae->error;
+}
+
+sub perl { [ $^X, '-I'.$_[0]->perldest ] }
+sub make { 'make' }
+
+sub build_module {
+ my $self = shift;
+ my $module = shift;
+ my $subdir = shift;
+ # XXX: try to match version number only for the glob here
+ my ($dir) = glob($self->build_dir."/$module-*");
+ rmtree [$dir] if $dir;
+
+ my ($file) = glob("src/$module-*");
+ $self->extract($file);
+
+ ($dir) = glob($self->build_base."/$module-*");
+ $dir .= "/$subdir" if $subdir;
+
+ $self->perlmake_install( $subdir ? "$dir/$subdir" : $dir );
+}
+
+sub perlmake_install {
+ my ($self, $dir) = @_;
+ my $PERLDEST = $self->perldest;
+ my $PERLDESTARCH = $PERLDEST;
+
+ local $CWD = $dir;
+ warn "$CWD\n";
+ system @{$self->perl}, qw(Makefile.PL INSTALLDIRS=perl),
+ "INSTALLARCHLIB=$PERLDESTARCH",
+ "INSTALLPRIVLIB=$PERLDEST",
+ "INSTALLBIN=$PERLDEST/../bin",
+ "INSTALLSCRIPT=$PERLDEST/../bin",
+ "INSTALLMAN1DIR=$PERLDEST/../man/man1",
+ "INSTALLMAN3DIR=$PERLDEST/../man/man3";
+
+ $ENV{PERL_EXTUTILS_AUTOINSTALL} = '--skipdeps';
+ system $self->make, qw( all install ) ;
+}
+
+sub perldest {
+ my $self = shift;
+ $self->build_dir.'/perl';
+}
+
+sub prepare_dist {
+ my $self = shift;
+ my $toplevel = shift;
+ copy('svk-wrapper' => $self->build_dir."/svk");
+ chmod 0755, $self->build_dir."/svk";
+
+ open my $fh, "$toplevel/MANIFEST" or die $!;
+ while (<$fh>) {
+ chomp;
+ next unless m{^t/};
+ my $file = $_;
+ my (undef, $dir, undef) = File::Spec->splitpath($file);
+ mkpath [ $self->build_dir."/$dir" ];
+ copy($toplevel.'/'.$file => $self->build_dir."/$file");
+ }
+
+ copy('maketest' => $self->build_dir."/maketest");
+ chmod 0755, $self->build_dir."/maketest";
+}
+
+package SVK::Build::Win32;
+use base 'SVK::Build';
+use Cwd 'abs_path';
+use File::Spec;
+
+sub build_dir {
+ 'c:/tmp/svk-build';
+}
+
+sub build_base {
+ 'c:/tmp/svk-build';
+}
+
+sub perl {
+ my $self = shift;
+ [abs_path(File::Spec->catfile($self->build_dir,
+ qw(strawberry-perl perl bin perl.exe))) ];
+}
+
+sub make { 'dmake' }
+
+sub perldest {
+ abs_path(File::Spec->catfile($_[0]->build_dir, qw(strawberry-perl perl lib)));
+}
+
+sub prepare_perl {
+ my $self = shift;
+ Env::Path->PATH->Assign( map { abs_path(File::Spec->catfile($self->build_dir, 'strawberry-perl', $_, 'bin')) } qw(perl dmake mingw));
+
+ if (-d $self->perldest) {
+ warn "found strawberry perl, remove ".$self->perldest." for clean build.\n";
+ return 1;
+ }
+ $self->extract('strawberry-perl.zip');
+}
+
+sub prepare_svn_core {
+ my $self = shift;
+ return 1 if -e File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'lib', 'SVN' );
+
+ $self->extract('svn-win32-1.4.4.zip');
+ $self->extract('svn-win32-1.4.4_pl.zip');
+
+ my $svnperl = File::Spec->catfile($self->build_dir, 'svn-win32-1.4.4', 'perl', 'site', 'lib' );
+
+ my $strperl = File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'lib' );
+
+ rename(File::Spec->catfile($svnperl, "SVN") =>
+ File::Spec->catfile($strperl, "SVN")) or die $!;
+
+ rename(File::Spec->catfile($svnperl, "auto", "SVN") =>
+ File::Spec->catfile($strperl, "auto", "SVN")) or die $!;
+
+ move($_ => File::Spec->catfile($self->build_dir, 'strawberry-perl', 'perl', 'bin'))
+ for glob($self->build_dir."/svn-win32-1.4.4/bin/*.dll");
+}
+
+sub prepare_dist {
+
+}
Added: branches/i18n-fixes/pkg/maketest
==============================================================================
--- (empty file)
+++ branches/i18n-fixes/pkg/maketest Sun Jul 15 13:25:50 2007
@@ -0,0 +1,10 @@
+#!/bin/sh
+BASE=`readlink $0`
+if [ "x${BASE}" = x ]; then
+ BASE=$0
+fi
+
+BASE=`echo $BASE | sed s/maketest$//`;
+PROVE=`which prove`
+chdir /tmp
+LD_LIBRARY_PATH=${BASE} perl -I${BASE}perl "$PROVE" ${BASE}t
Added: branches/i18n-fixes/pkg/svk-wrapper
==============================================================================
--- (empty file)
+++ branches/i18n-fixes/pkg/svk-wrapper Sun Jul 15 13:25:50 2007
@@ -0,0 +1,9 @@
+#!/bin/sh
+BASE=`readlink $0`
+if [ "x${BASE}" = x ]; then
+ BASE=$0
+fi
+
+BASE=`echo $BASE | sed s/svk$//`;
+
+LD_LIBRARY_PATH=${BASE} perl -I${BASE}perl ${BASE}bin/svk $@
Modified: branches/i18n-fixes/t/02basic-symlink.t
==============================================================================
--- branches/i18n-fixes/t/02basic-symlink.t (original)
+++ branches/i18n-fixes/t/02basic-symlink.t Sun Jul 15 13:25:50 2007
@@ -24,5 +24,7 @@
}
local $^W;
-require 't/02basic.t';
+my $file = $0;
+$file =~ s'-symlink.t'.t';
+require $file;
Modified: branches/i18n-fixes/t/05svm-branches.t
==============================================================================
--- branches/i18n-fixes/t/05svm-branches.t (original)
+++ branches/i18n-fixes/t/05svm-branches.t Sun Jul 15 13:25:50 2007
@@ -41,6 +41,8 @@
}
$svk->sync ('-a', '//');
+TODO: {
+local $TODO = 'annotated copy info.';
is_output ($svk, 'info', ['//2.0'],
['Depot Path: //2.0',
'Revision: 4',
@@ -52,3 +54,5 @@
'',]
) or diag $output;
+
+}
Modified: branches/i18n-fixes/t/07smerge-rename.t
==============================================================================
--- branches/i18n-fixes/t/07smerge-rename.t (original)
+++ branches/i18n-fixes/t/07smerge-rename.t Sun Jul 15 13:25:50 2007
@@ -90,6 +90,6 @@
__("D $lcopath/A/deep/foo"),
__("C $lcopath/A/deep/test.pl"),
__("D $lcopath/A/foo"),
- __("U $lcopath/test.pl - A/deep/test.pl"),
+ __("U $lcopath/test.pl")." - A/deep/test.pl",
"New merge ticket: $uuid:/trunk:8",
'2 conflicts found.']);
Modified: branches/i18n-fixes/t/72sign.t
==============================================================================
--- branches/i18n-fixes/t/72sign.t (original)
+++ branches/i18n-fixes/t/72sign.t Sun Jul 15 13:25:50 2007
@@ -11,8 +11,9 @@
our $output;
mkpath ["t/checkout/sign-gnupg"], 0, 0700 unless -d "t/checkout/sign-gnupg";
-
-$ENV{SVKPGP} = my $gpg = __('gpg --homedir t/checkout/sign-gnupg --no-default-keyring --keyring t/svk.gpg --secret-keyring t/svk-sec.gpg --default-key svk');
+my $dir = $0;
+$dir =~ s'/72sign.t$'';
+$ENV{SVKPGP} = my $gpg = __("gpg --homedir t/checkout/sign-gnupg --no-default-keyring --keyring $dir/svk.gpg --secret-keyring $dir/svk-sec.gpg --default-key svk");
ok (`$gpg --list-keys` =~ '1024D/A50DE110');
Modified: branches/i18n-fixes/t/api/root.t
==============================================================================
--- branches/i18n-fixes/t/api/root.t (original)
+++ branches/i18n-fixes/t/api/root.t Sun Jul 15 13:25:50 2007
@@ -62,7 +62,8 @@
# reading files
-my $expected = "first line in me$/2nd line in me - mod$/";
+my $eol = $SVK::Util::EOL;
+my $expected = "first line in me${eol}2nd line in me - mod${eol}";
is($root->file_length("/trunk/me"), length($expected),
"meesa right length");
is($root->file_md5_checksum("/trunk/me"),
Modified: branches/i18n-fixes/t/mirror/sync-crazy-replace.t
==============================================================================
--- branches/i18n-fixes/t/mirror/sync-crazy-replace.t (original)
+++ branches/i18n-fixes/t/mirror/sync-crazy-replace.t Sun Jul 15 13:25:50 2007
@@ -24,7 +24,7 @@
__("A $copath/A-copy/be"),
]);
-is_output($svk, rm => ["$copath/A-copy/Q"],
+is_sorted_output($svk, rm => ["$copath/A-copy/Q"],
[
__("D $copath/A-copy/Q"),
__("D $copath/A-copy/Q/qu"),
@@ -59,7 +59,7 @@
'Committed revision 3 from revision 2.',
'Committed revision 4 from revision 3.']);
-is_output($svk, rm => ["$copath/A-copy"],
+is_sorted_output($svk, rm => ["$copath/A-copy"],
[
__("D $copath/A-copy"),
__("D $copath/A-copy/be"),
More information about the svk-commit
mailing list