r57616 - in /trunk/libarch-perl: ./ perllib/ perllib/Arch/ rpm/ tests/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Thu May 6 23:00:49 UTC 2010


Author: jawnsy-guest
Date: Thu May  6 23:00:34 2010
New Revision: 57616

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57616
Log:
restore a bunch of stuff from the tarball

Modified:
    trunk/libarch-perl/INSTALL
    trunk/libarch-perl/Makefile.PL
    trunk/libarch-perl/NEWS
    trunk/libarch-perl/README
    trunk/libarch-perl/perllib/Arch.pm
    trunk/libarch-perl/perllib/Arch/Backend.pm
    trunk/libarch-perl/perllib/Arch/Changes.pm
    trunk/libarch-perl/perllib/Arch/Changeset.pm
    trunk/libarch-perl/perllib/Arch/FileHighlighter.pm
    trunk/libarch-perl/perllib/Arch/Inventory.pm
    trunk/libarch-perl/perllib/Arch/Session.pm
    trunk/libarch-perl/perllib/Arch/Tree.pm
    trunk/libarch-perl/perllib/Arch/Util.pm
    trunk/libarch-perl/rpm/Makefile
    trunk/libarch-perl/tests/inventory-1
    trunk/libarch-perl/tests/registry-1
    trunk/libarch-perl/tests/session-1
    trunk/libarch-perl/tests/test-archive-1
    trunk/libarch-perl/tests/test-framework-1
    trunk/libarch-perl/tests/test-tree-1
    trunk/libarch-perl/tests/tree-1
    trunk/libarch-perl/tests/tree-2
    trunk/libarch-perl/tests/tree-3
    trunk/libarch-perl/tests/util-2

Modified: trunk/libarch-perl/INSTALL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/INSTALL?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/INSTALL (original)
+++ trunk/libarch-perl/INSTALL Thu May  6 23:00:34 2010
@@ -6,3 +6,6 @@
 	make install
 
 Optionally, the first command accepts PREFIX=/home/joe/perl option.
+
+Please note that you need to install tla (or its equivalent, like baz)
+to make this perl library useful.

Modified: trunk/libarch-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/Makefile.PL?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/Makefile.PL (original)
+++ trunk/libarch-perl/Makefile.PL Thu May  6 23:00:34 2010
@@ -31,6 +31,7 @@
 	VERSION_FROM => 'perllib/Arch.pm',
 	ABSTRACT_FROM => 'perllib/Arch.pm',
 	AUTHOR => 'Mikhael Goikhman <migo at homemail.com>',
+	LICENSE => 'gpl',
 );
 
 open MANIFEST, "<MANIFEST";

Modified: trunk/libarch-perl/NEWS
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/NEWS?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/NEWS (original)
+++ trunk/libarch-perl/NEWS Thu May  6 23:00:34 2010
@@ -1,3 +1,11 @@
+arch-perl-0.5.2 (08-Mar-2010)
+
+* Adapted all relevant tests to quietly pass (be skipped) without tla.
+* Applied fix for Changeset dir containing regexp chars.
+* Enabled caching of tree logs.
+* Enhanced history method of Arch::Tree.
+* Small improvements in documentation files.
+
 arch-perl-0.5.1 (08-Oct-2005)
 
 * Added detection of Arch Cache in Arch::Backend.

Modified: trunk/libarch-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/README?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/README (original)
+++ trunk/libarch-perl/README Thu May  6 23:00:34 2010
@@ -1,14 +1,17 @@
-Welcome to Arch-Perl 0.5.1.
+Welcome to Arch-Perl 0.5.2.
 
 The arch-perl project aims to create Perl library for GNU Arch.
+http://migo.sixbit.org/software/arch-perl/
 
-Currently, a pragmatic high-level interface is built around tla or baz.
+A pragmatic high-level interface is built around tla or baz
+(that is a fork of tla, before it was obsoleted in favour of bzr).
+
 This functionality was initially developed for ArchZoom project,
 and was highly enhanced to serve AXP and ArchWay projects as well.
 
 Feel free to participate in creating the best possible design.
 
-arch-perl is tested with perl-5.00503, perl-5.6.x and perl-5.8.x.
+arch-perl is tested with perl-5.00503, perl-5.6.x, perl-5.8.x and perl-5.10.x.
 arch-perl is tested with tla-1.1, tla-1.2, tla-1.3, tla-1.3.1, tla-1.3.3.
 arch-perl is tested with baz-1.1, baz-1.2, baz-1.3, baz-1.3.2, baz-1.4.2.
 Use environment variable ARCH_BACKEND to set path to tla or baz.
@@ -16,5 +19,7 @@
 -- 
 Mikhael Goikhman <migo at homemail.com>
 
+Commands to obtain the latest development code:
+
 % tla register-archive http://arch.wox.org/migo@homemail.com--Perl-GPL/
 % tla get migo at homemail.com--Perl-GPL/arch-perl--devel--0

Modified: trunk/libarch-perl/perllib/Arch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch.pm (original)
+++ trunk/libarch-perl/perllib/Arch.pm Thu May  6 23:00:34 2010
@@ -21,7 +21,7 @@
 
 use vars qw($VERSION);
 
-$VERSION = '0.5.1';
+$VERSION = '0.5.2';
 $VERSION = eval $VERSION;
 
 1;
@@ -34,7 +34,7 @@
 
 =head1 SYNOPSIS 
 
-    use Arch 0.5.1;
+    use Arch 0.5.2;
 
     # perldoc Arch
     # axp man Arch

Modified: trunk/libarch-perl/perllib/Arch/Backend.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/Backend.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/Backend.pm (original)
+++ trunk/libarch-perl/perllib/Arch/Backend.pm Thu May  6 23:00:34 2010
@@ -183,8 +183,8 @@
 B<arch_backend>,
 B<arch_backend_name>,
 B<arch_backend_version>,
+B<is_tla>,
 B<is_baz>,
-B<is_tla>,
 B<has_archive_setup_cmd>,
 B<has_file_diffs_cmd>,
 B<has_register_archive_name_arg>,
@@ -192,7 +192,10 @@
 B<has_tree_id_cmd>,
 B<has_set_tree_version_cmd>,
 B<has_cache_feature>,
-B<get_cache_config>.
+B<get_cache_config>,
+B<has_commit_version_arg>,
+B<has_commit_files_separator>,
+B<has_revlib_patch_set_dir>.
 
 =over 4
 

Modified: trunk/libarch-perl/perllib/Arch/Changes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/Changes.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/Changes.pm (original)
+++ trunk/libarch-perl/perllib/Arch/Changes.pm Thu May  6 23:00:34 2010
@@ -240,15 +240,15 @@
 
 Creates a new, initially empty, changes list.
 
-Typically this is done by one of L<Arch::Changeset>, L<Arch::Tree> or
-L<Arch::Log>.
+Typically it is called indirectly from method B<get_changes> in
+L<Arch::Changeset>, L<Arch::Tree> or L<Arch::Log> class.
 
 =item B<add> I<type> I<is_dir> I<arguments...>
 
 Adds a new change element to the list of changes.
 
-Typically this is done by one of L<Arch::Changeset>, L<Arch::Tree> or
-L<Arch::Log>.
+Typically it is called indirectly from method B<get_changes> in
+L<Arch::Changeset>, L<Arch::Tree> or L<Arch::Log> class.
 
 =item B<count>
 
@@ -256,7 +256,7 @@
 
 =item B<get> I<num>
 
-Returns the I<num>th change element or all if I<num> is undefined.
+Returns the I<num>-th change element or all if I<num> is undefined.
 
 =item B<get_listing>
 

Modified: trunk/libarch-perl/perllib/Arch/Changeset.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/Changeset.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/Changeset.pm (original)
+++ trunk/libarch-perl/perllib/Arch/Changeset.pm Thu May  6 23:00:34 2010
@@ -28,6 +28,8 @@
 	my $dir = shift || die "Arch::Changeset::new: no dir\n";
 	die "No changeset dir $dir for revision $revision\n" unless -d $dir;
 
+	$dir =~ s!/$!!;
+
 	my $self = {
 		revision   => $revision,
 		dir        => $dir,
@@ -82,7 +84,7 @@
 		my $num_lines = $patch_content =~ s/\n/\n/g;
 		$num_lines += $has_end_line? 0: 1;
 		my $file = $patch_file;
-		$file =~ s!^$dir/[^/]+/!!s;
+		$file =~ s!^\Q$dir\E/[^/]+/!!s;
 		my ($file1, $file2, $line1, $line2, $prefix);
 		if ($change_type eq "new") {
 			$file1 = "/dev/null";

Modified: trunk/libarch-perl/perllib/Arch/FileHighlighter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/FileHighlighter.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/FileHighlighter.pm (original)
+++ trunk/libarch-perl/perllib/Arch/FileHighlighter.pm Thu May  6 23:00:34 2010
@@ -56,7 +56,7 @@
 
 sub dehtmlize ($) {
 	my $str = shift;
-	die "No content to htmlize" unless defined $str;
+	die "No content to dehtmlize" unless defined $str;
 
 	$str =~ s/&amp;/&/sg;
 	$str =~ s/&quot;/\"/sg;

Modified: trunk/libarch-perl/perllib/Arch/Inventory.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/Inventory.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/Inventory.pm (original)
+++ trunk/libarch-perl/perllib/Arch/Inventory.pm Thu May  6 23:00:34 2010
@@ -248,7 +248,7 @@
     print Arch::Inventory->to_string($inv->get_root_entry), "\n";
     print $inv->get_listing;
 
-or (most commonly)
+or (most commonly):
 
     use Arch::Tree;
 
@@ -335,7 +335,7 @@
 The root entry always has the following properties:
 
     $root = {
-        category => TREE        # if {arch} exists, SOURCE otherwise
+        category => TREE,       # if {arch} exists, SOURCE otherwise
         untagged => 1,
         type     => DIRECTORY,
         path     => '',

Modified: trunk/libarch-perl/perllib/Arch/Session.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/Session.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/Session.pm (original)
+++ trunk/libarch-perl/perllib/Arch/Session.pm Thu May  6 23:00:34 2010
@@ -134,7 +134,9 @@
 	my $self = shift;
 	my @keys = @_;
 
-	@keys = qw(archives categories branches versions revisions revision_descs);
+	@keys = qw(archives categories branches versions revisions revision_descs)
+		unless @keys;
+
 	foreach (@keys) {
 		if (@_ && !exist $self->{$_}) {
 			warn __PACKAGE__ . "::clear_cache: unknown key ($_), ignoring\n";

Modified: trunk/libarch-perl/perllib/Arch/Tree.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/Tree.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/Tree.pm (original)
+++ trunk/libarch-perl/perllib/Arch/Tree.pm Thu May  6 23:00:34 2010
@@ -45,6 +45,7 @@
 		dir => $root,
 		own_logs => $init{own_logs},
 		hide_ids => $init{hide_ids},
+		cache_logs => $init{cache_logs},
 	};
 
 	bless $self, $class;
@@ -120,6 +121,9 @@
 sub get_log ($$) {
 	my $self = shift;
 	my $revision = shift || die;
+
+	return $self->{cached_logs}->{$revision}
+		if $self->{cached_logs}->{$revision};
 
 	my $message;
 	if ($self->{own_logs}) {
@@ -135,7 +139,11 @@
 		$message = run_tla("cat-log", "-d", $self->{dir}, $revision);
 	}
 	return undef unless $message;
-	return Arch::Log->new($message, hide_ids => $self->{hide_ids});
+
+	my $log = Arch::Log->new($message, hide_ids => $self->{hide_ids});
+	$self->{cached_logs}->{$revision} = $log
+		if $self->{cache_logs};
+	return $log;
 }
 
 sub get_logs ($;$) {
@@ -328,6 +336,8 @@
 sub get_ancestry_logs ($%) {
 	my $self = shift;
 	my %args = @_;
+
+	my $limit = $args{limit} || 0;
 	my $callback = $args{callback};
 	my $one_version = $args{one_version} || 0;
 	my $no_continuation = $args{no_continuation} || 0;
@@ -357,7 +367,7 @@
 			$revision = $self->get_previous_revision($revision);
 		}
 		push @collected, $callback? $callback->($log): $log;
-		last unless $log;  # undefined by callback
+		last unless --$limit && $log;  # undefined by callback
 	}
 	return \@collected;
 }
@@ -375,6 +385,8 @@
 	my $filepath = shift;
 	@_ = (one_version => $_[0]) if @_ == 1;  # be compatible until summer 2005
 	my %args = @_;
+
+	my $limit = delete $args{limit} || 0;
 	my $callback = delete $args{callback};
 
 	my ($is_dir, $changed);
@@ -412,7 +424,7 @@
 			? $callback->($revision_desc, $log)
 			: $revision_desc;
 
-		$_[0] = undef unless $revision_desc;  # undefined by callback
+		$_[0] = undef unless --$limit && $revision_desc;  # undefined by callback
 		return @returned;
 	});
 }
@@ -610,7 +622,9 @@
 	my $self = shift;
 	my @keys = @_;
 
-	@keys = qw(missing_revision_descs missing_revisions);
+	@keys = qw(missing_revision_descs missing_revisions cached_logs)
+		unless @keys;
+
 	foreach (@keys) {
 		if (@_ && !exist $self->{$_}) {
 			warn __PACKAGE__ . "::clear_cache: unknown key ($_), ignoring\n";

Modified: trunk/libarch-perl/perllib/Arch/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/perllib/Arch/Util.pm?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/perllib/Arch/Util.pm (original)
+++ trunk/libarch-perl/perllib/Arch/Util.pm Thu May  6 23:00:34 2010
@@ -28,6 +28,7 @@
 @EXPORT_OK = qw(
 	arch_backend is_baz
 	run_pipe_from run_cmd run_tla
+	is_tla_functional
 	load_file save_file
 	copy_dir remove_dir setup_config_dir
 	standardize_date date2daysago date2age
@@ -45,7 +46,7 @@
 
 	# perl-5.005 does not pass compilation without "eval"...
 	my $pipe_success = $] >= 5.006?
-		eval qq{ open(PIPE, '-|', \@args) }: open(PIPE, "$args[0]|");
+		eval qq{ no warnings; open(PIPE, '-|', \@args) }: open(PIPE, "$args[0]|");
 	die "Can't start (@args): $!\n" unless $pipe_success;
 	return \*PIPE;
 }
@@ -67,6 +68,10 @@
 	my $arg1 = shift || die;
 	unshift @_, $Arch::Backend::EXE, split(' ', $arg1);
 	goto \&run_cmd;
+}
+
+sub is_tla_functional () {
+	eval { run_tla("help --help") } ? 1 : 0;
 }
 
 sub load_file ($;$) {
@@ -298,6 +303,12 @@
 
 =over 4
 
+=item B<is_tla_functional>
+
+Verify whether the system has a working arch backend installed (and
+possibly configured by environment variables, like TLA or ARCH_BACKEND),
+needed for this perl library to function.
+
 =item B<run_tla> I<subcommand_with_args>
 
 =item B<run_tla> I<subcommand> arg ...

Modified: trunk/libarch-perl/rpm/Makefile
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/rpm/Makefile?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/rpm/Makefile (original)
+++ trunk/libarch-perl/rpm/Makefile Thu May  6 23:00:34 2010
@@ -1,4 +1,4 @@
-version = 0.5.1
+version = 0.5.2
 release = 0.`date +%Y%m%d`
 cparams = ''  # configure params, not really used
 mparams = ''  # make params, like: 'CFLAGS="-O2"'

Modified: trunk/libarch-perl/tests/inventory-1
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/inventory-1?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/inventory-1 (original)
+++ trunk/libarch-perl/tests/inventory-1 Thu May  6 23:00:34 2010
@@ -5,12 +5,14 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 11;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
 
-BEGIN {
-	use_ok("Arch::Inventory", qw(:category :type));
-	use_ok("Arch::Test::Framework");
-}
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 11;
+
+use_ok("Arch::Inventory");
+use_ok("Arch::Test::Framework");
 
 my $framework = Arch::Test::Framework->new;
 my $archive   = $framework->make_archive;

Modified: trunk/libarch-perl/tests/registry-1
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/registry-1?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/registry-1 (original)
+++ trunk/libarch-perl/tests/registry-1 Thu May  6 23:00:34 2010
@@ -6,7 +6,12 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 20;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
+
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 20;
+
 use_ok("Arch::Registry");
 use_ok("Arch::Util", "run_tla");
 use_ok("Arch::Backend", "is_baz");

Modified: trunk/libarch-perl/tests/session-1
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/session-1?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/session-1 (original)
+++ trunk/libarch-perl/tests/session-1 Thu May  6 23:00:34 2010
@@ -5,7 +5,12 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 37;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
+
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 37;
+
 use_ok("Arch::Session");
 use_ok("Arch::Util", "run_tla", "save_file");
 use_ok("Arch::Backend", "has_archive_setup_cmd");

Modified: trunk/libarch-perl/tests/test-archive-1
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/test-archive-1?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/test-archive-1 (original)
+++ trunk/libarch-perl/tests/test-archive-1 Thu May  6 23:00:34 2010
@@ -5,7 +5,12 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 17;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
+
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 17;
+
 use_ok("Arch::Test::Framework");
 
 my $fw = Arch::Test::Framework->new();

Modified: trunk/libarch-perl/tests/test-framework-1
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/test-framework-1?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/test-framework-1 (original)
+++ trunk/libarch-perl/tests/test-framework-1 Thu May  6 23:00:34 2010
@@ -5,7 +5,12 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 17;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
+
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 17;
+
 use_ok("Arch::Test::Framework");
 
 my $arch_user = 'Arch Test';

Modified: trunk/libarch-perl/tests/test-tree-1
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/test-tree-1?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/test-tree-1 (original)
+++ trunk/libarch-perl/tests/test-tree-1 Thu May  6 23:00:34 2010
@@ -5,7 +5,12 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 14;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
+
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 14;
+
 use_ok("Arch::Test::Framework");
 use_ok("Arch::Backend", "is_baz", "arch_backend_version");
 

Modified: trunk/libarch-perl/tests/tree-1
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/tree-1?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/tree-1 (original)
+++ trunk/libarch-perl/tests/tree-1 Thu May  6 23:00:34 2010
@@ -5,7 +5,12 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 11;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
+
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 11;
+
 use_ok("Arch::Tree");
 
 my $arch_dir = "$FindBin::Bin/../{arch}";

Modified: trunk/libarch-perl/tests/tree-2
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/tree-2?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/tree-2 (original)
+++ trunk/libarch-perl/tests/tree-2 Thu May  6 23:00:34 2010
@@ -7,11 +7,18 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 5;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
+
 BEGIN {
+	plan skip_all => "No functional arch backend" unless is_tla_functional;
+	plan tests => 5;
+
+	# import constants at compile time
 	use_ok("Arch::Inventory", qw(:category :type));
-	use_ok("Arch::Tree");
 }
+
+use_ok("Arch::Tree");
 
 my $expected_entry_path = 'perllib/Arch/Tree.pm';
 my $expected_entry = {

Modified: trunk/libarch-perl/tests/tree-3
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/tree-3?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/tree-3 (original)
+++ trunk/libarch-perl/tests/tree-3 Thu May  6 23:00:34 2010
@@ -7,15 +7,17 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 15;
+use Test::More;
+use Arch::Util qw(is_tla_functional);
 
-BEGIN {
-	use_ok("Arch::Tree");
-	use_ok("Arch::Util", "run_tla", "save_file");
-	use_ok("Arch::Backend", "has_archive_setup_cmd");
-	use_ok("Arch::TempFiles");
-	use_ok("Arch::Session");
-}
+plan skip_all => "No functional arch backend" unless is_tla_functional;
+plan tests => 15;
+
+use_ok("Arch::Tree");
+use_ok("Arch::Util", "run_tla", "save_file");
+use_ok("Arch::Backend", "has_archive_setup_cmd");
+use_ok("Arch::TempFiles");
+use_ok("Arch::Session");
 
 # setup testing environment
 my $TEMP     = Arch::TempFiles->new;

Modified: trunk/libarch-perl/tests/util-2
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarch-perl/tests/util-2?rev=57616&op=diff
==============================================================================
--- trunk/libarch-perl/tests/util-2 (original)
+++ trunk/libarch-perl/tests/util-2 Thu May  6 23:00:34 2010
@@ -5,7 +5,8 @@
 use FindBin;
 use lib "$FindBin::Bin/../perllib";
 
-use Test::More tests => 39;
+use Test::More tests => 40;
+
 use_ok("Arch::Util", "save_file", "load_file");
 use_ok("Arch::TempFiles");
 use_ok("Arch::Session");
@@ -17,7 +18,7 @@
 
 sub run_func (@) {
 	my $func = shift;
-	my $cmd = "$func('" . join("', '", map { ref($_) || $_ } @_) . "')";
+	my $cmd = "$func(" . join(", ", map { "'" . (ref($_) || $_) . "'" } @_) . ")";
 	$func = "Arch::Util::$func";
 	my ($result_assign, $result, @result) = ("");
 	if (defined wantarray && !wantarray) {
@@ -27,7 +28,7 @@
 		$result_assign = '@result = ';
 		$cmd .= " (list context)";
 	}
-	eval "$result_assign$func(\@_);";
+	eval "$result_assign$func(" . (@_ ? '@_' : '') . ");";
 	if ($@) {
 		fail($cmd . ": $@");
 	} else {
@@ -90,9 +91,13 @@
 }
 
 my $arch_backend = run_func("arch_backend");
-run_func("run_tla", "-h");
-my $tla_output = run_func("run_tla", "--version");
-my @tla_output = run_func("run_tla", "--version");
-like($tla_output, qr/\b(Tom Lord|Arch|Bazaar|tla|baz)\b/, "check $arch_backend --version output (scalar)");
-ok(@tla_output > 0,               "check $arch_backend --version output (list)");
+my $is_tla_functional = run_func("is_tla_functional");
 
+SKIP: {
+	skip "No functional arch backend", 5 unless $is_tla_functional;
+	run_func("run_tla", "-h");
+	my $tla_output = run_func("run_tla", "--version");
+	my @tla_output = run_func("run_tla", "--version");
+	like($tla_output, qr/\b(Tom Lord|Arch|Bazaar|tla|baz)\b/, "check $arch_backend --version output (scalar)");
+	ok(@tla_output > 0,               "check $arch_backend --version output (list)");
+}




More information about the Pkg-perl-cvs-commits mailing list