[Bps-public-commit] r15005 - in Shipwright/branches/2.0: lib/Shipwright lib/Shipwright/Source
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Aug 11 12:23:08 EDT 2008
Author: sunnavy
Date: Mon Aug 11 12:23:08 2008
New Revision: 15005
Modified:
Shipwright/branches/2.0/ (props changed)
Shipwright/branches/2.0/lib/Shipwright/Source.pm
Shipwright/branches/2.0/lib/Shipwright/Source/Base.pm
Shipwright/branches/2.0/lib/Shipwright/Source/Shipwright.pm
Log:
r15554 at sunnavys-mb: sunnavy | 2008-08-12 00:19:11 +0800
added branches.yml for source
Modified: Shipwright/branches/2.0/lib/Shipwright/Source.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Source.pm (original)
+++ Shipwright/branches/2.0/lib/Shipwright/Source.pm Mon Aug 11 12:23:08 2008
@@ -20,8 +20,10 @@
$DEFAULT{url_path} = File::Spec->catfile( $DEFAULT{directory}, 'url.yml' );
$DEFAULT{version_path} =
File::Spec->catfile( $DEFAULT{directory}, 'version.yml' );
+$DEFAULT{branches_path} =
+ File::Spec->catfile( $DEFAULT{directory}, 'branches.yml' );
-for (qw/map_path url_path version_path/) {
+for (qw/map_path url_path version_path branches_path/) {
open my $fh, '>', $DEFAULT{$_} or die "can't write to $DEFAULT{$_}: $!";
close $fh;
}
Modified: Shipwright/branches/2.0/lib/Shipwright/Source/Base.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Source/Base.pm (original)
+++ Shipwright/branches/2.0/lib/Shipwright/Source/Base.pm Mon Aug 11 12:23:08 2008
@@ -14,7 +14,7 @@
__PACKAGE__->mk_accessors(
qw/source directory scripts_directory download_directory follow
min_perl_version map_path skip map keep_recommends keep_build_requires
- name log url_path version_path version/
+ name log url_path version_path branches_path version/
);
=head1 NAME
@@ -394,6 +394,19 @@
Shipwright::Util::DumpFile( $self->version_path, $map );
}
+sub _update_branches {
+ my $self = shift;
+ my $name = shift;
+ my $branches = shift;
+
+ my $map = {};
+ if ( -e $self->version_path && !-z $self->branches_path ) {
+ $map = Shipwright::Util::LoadFile( $self->branches_path );
+ }
+ $map->{$name} = $branches;
+ Shipwright::Util::DumpFile( $self->branches_path, $map );
+}
+
sub _is_skipped {
my $self = shift;
my $module = shift;
Modified: Shipwright/branches/2.0/lib/Shipwright/Source/Shipwright.pm
==============================================================================
--- Shipwright/branches/2.0/lib/Shipwright/Source/Shipwright.pm (original)
+++ Shipwright/branches/2.0/lib/Shipwright/Source/Shipwright.pm Mon Aug 11 12:23:08 2008
@@ -39,8 +39,10 @@
);
my $source_version = $source_shipwright->backend->version->{$dist};
+ my $branches = $source_shipwright->backend->branches;
$self->_update_version( $self->name || $dist, $source_version );
- $self->_update_url( $self->name || $dist, $self->source );
+ $self->_update_url( $self->name || $dist, 'shipwright:' . $self->source );
+ $self->_update_branches( $self->name || $dist, $branches->{$dist} );
# follow
if ( $self->follow ) {
More information about the Bps-public-commit
mailing list